补齐移动壳基础能力失败观测

移动剪贴板触觉网络记录原生异常日志

相关测试覆盖稳定错误和日志边界

配置门禁和文档同步基础能力观测约束
This commit is contained in:
2026-06-20 19:34:26 +08:00
parent 75bf78f0a5
commit 48bad28a96
10 changed files with 122 additions and 34 deletions
@@ -2381,6 +2381,10 @@ for (const snippet of [
'writeMobileClipboardText(text)',
'readMobileHostBridgeClipboardText',
'ok(request, await readMobileClipboardText())',
'logMobileClipboardFailure',
'mobile clipboard failed for',
"logMobileClipboardFailure('write.set_string', error)",
"logMobileClipboardFailure('read.get_string', error)",
"message: 'clipboard write unavailable'",
"message: 'clipboard read unavailable'",
]) {
@@ -2393,8 +2397,10 @@ if (!clipboardTestSource.includes("'猫'.repeat(100000)")) {
}
for (const snippet of [
'maps native clipboard write failures to stable host errors',
'mobile clipboard failed for write.set_string',
"message: 'clipboard write unavailable'",
'maps native clipboard read failures to stable host errors',
'mobile clipboard failed for read.get_string',
"message: 'clipboard read unavailable'",
'rejects unavailable clipboard text without reporting a successful empty value',
`Clipboard.getStringAsync).${'mo'}${'ck'}ResolvedValue(undefined as never)`,
@@ -2409,6 +2415,9 @@ for (const snippet of [
for (const snippet of [
'try {',
'return ok(request, await getMobileNetworkStatus())',
'logMobileNetworkFailure',
'mobile network failed for',
"logMobileNetworkFailure('status.query', error)",
'return failure(request, {',
"code: 'host_error'",
"message: 'network status unavailable'",
@@ -2420,6 +2429,7 @@ for (const snippet of [
for (const snippet of [
'converts native network failures to a stable host_error response',
"new Error('network query failed')",
'mobile network failed for status.query',
"message: 'network status unavailable'",
]) {
if (!hostBridgeNetworkTestSource.includes(snippet)) {
@@ -2439,6 +2449,9 @@ if (
!hapticsSource.includes('Haptics.ImpactFeedbackStyle.Medium') ||
!hapticsSource.includes('Haptics.ImpactFeedbackStyle.Light') ||
!hapticsSource.includes('await Haptics.impactAsync(toExpoImpactStyle(style))') ||
!hapticsSource.includes('logMobileHapticsFailure') ||
!hapticsSource.includes('mobile haptics failed for') ||
!hapticsSource.includes("logMobileHapticsFailure('impact.dispatch', error)") ||
!hapticsSource.includes("message: 'haptics impact unavailable'") ||
!hapticsSource.includes('ok(request, true)')
) {
@@ -2449,6 +2462,7 @@ if (
for (const snippet of [
'reports unavailable native feedback with a stable HostBridge error',
'mobile haptics failed for impact.dispatch',
"message: 'haptics impact unavailable'",
]) {
if (!hapticsTestSource.includes(snippet)) {