收口微信九宫切图诊断日志
微信九宫切图失败日志改为固定阶段标签 原生壳门禁拒绝九宫切图日志输出原生错误对象 同步宿主壳方案和共享决策记录
This commit is contained in:
@@ -2789,7 +2789,10 @@ function assertWechatShareGridFailureBoundaries() {
|
||||
|
||||
for (const snippet of [
|
||||
"WECHAT_SHARE_GRID_SAVE_UNAVAILABLE_MESSAGE = '九宫切图保存失败。'",
|
||||
"console.error(`[share-grid] ${label}`, error)",
|
||||
'function logShareGridFailure(label, _error)',
|
||||
'console.error(`[share-grid] ${label}`)',
|
||||
'logShareGridFailure(label, error)',
|
||||
"logShareGridFailure('save failed', error)",
|
||||
'reject(new Error(WECHAT_SHARE_GRID_SAVE_UNAVAILABLE_MESSAGE))',
|
||||
'errorMessage: WECHAT_SHARE_GRID_SAVE_UNAVAILABLE_MESSAGE',
|
||||
]) {
|
||||
@@ -2803,6 +2806,8 @@ function assertWechatShareGridFailureBoundaries() {
|
||||
"reject(new Error(error.errMsg || '导出切图失败'))",
|
||||
"reject(new Error(error.errMsg || '保存到相册失败'))",
|
||||
"error && error.message ? error.message : '九宫切图保存失败。'",
|
||||
"console.error(`[share-grid] ${label}`, error)",
|
||||
"console.error('[share-grid] save failed', error)",
|
||||
]) {
|
||||
if (shareGridSource.includes(forbiddenSnippet)) {
|
||||
throw new Error(`wechat share-grid shell must not expose native failure detail via ${forbiddenSnippet}`);
|
||||
@@ -2812,7 +2817,9 @@ function assertWechatShareGridFailureBoundaries() {
|
||||
'hides downloadFile native failure details from the page',
|
||||
"expect(page.data.errorMessage).toBe('九宫切图保存失败。')",
|
||||
"expect(page.data.errorMessage).not.toContain('private native download detail')",
|
||||
"expect(consoleError).toHaveBeenCalledWith(",
|
||||
"expect(consoleError).toHaveBeenCalledWith('[share-grid] download failed')",
|
||||
"expect(consoleError).toHaveBeenCalledWith('[share-grid] save failed')",
|
||||
"expect(consoleError.mock.calls.flat()).not.toContain('private native download detail')",
|
||||
]) {
|
||||
if (!shareGridTestSource.includes(snippet)) {
|
||||
throw new Error(`wechat share-grid boundary test must include ${snippet}`);
|
||||
|
||||
Reference in New Issue
Block a user