原生壳补齐Tauri请求超时
H5 Tauri HostBridge transport 按 timeoutMs 释放卡住的 invoke 请求 补充 Tauri 超时、计时器清理和迟到回包不改写结果的单测 桌面壳配置门禁锁定 Tauri transport 超时封装 同步宿主壳方案文档和共享决策日志
This commit is contained in:
@@ -773,7 +773,11 @@ function collectRustSourceRelativePaths(files) {
|
||||
}
|
||||
|
||||
function extractNativeAppTauriInvokeCommands(source) {
|
||||
return [...source.matchAll(/\btauriInvoke[\s\S]*?\(\s*([^,\n]+?)\s*,/g)]
|
||||
return [
|
||||
...source.matchAll(
|
||||
/\btauriInvoke(?:<[^)]*>)?\(\s*([A-Z_][A-Z0-9_]*)\s*,/g,
|
||||
),
|
||||
]
|
||||
.map((match) => match[1].trim())
|
||||
.filter(Boolean);
|
||||
}
|
||||
@@ -1264,6 +1268,17 @@ assertSameList(
|
||||
if (nativeAppHostBridgeSource.includes("'host_bridge_request'")) {
|
||||
throw new Error('H5 native app HostBridge must use HOST_BRIDGE_TAURI_COMMAND');
|
||||
}
|
||||
for (const snippet of [
|
||||
'function createNativeHostBridgeTimeoutError()',
|
||||
'async function invokeTauriHostBridgeWithTimeout',
|
||||
'Promise.race',
|
||||
'tauriInvoke<HostBridgeResponse<Result>>(HOST_BRIDGE_TAURI_COMMAND',
|
||||
"message: 'host_bridge_timeout'",
|
||||
]) {
|
||||
if (!nativeAppHostBridgeSource.includes(snippet)) {
|
||||
throw new Error(`H5 native app Tauri transport missing ${snippet}`);
|
||||
}
|
||||
}
|
||||
|
||||
assertSameList(
|
||||
capability.windows ?? [],
|
||||
|
||||
Reference in New Issue
Block a user