@tomflow/chatloop-extension 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/extension/manifest.json
CHANGED
|
@@ -114,12 +114,19 @@ const onBrowserMessage=(message, sender, reply) => {
|
|
|
114
114
|
throw Error("INVALID_RELOAD_SOURCE");
|
|
115
115
|
reply({status: "ACCEPTED"});
|
|
116
116
|
await chrome.tabs.remove(id);
|
|
117
|
-
// Reload
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
try{
|
|
117
|
+
// Reload terminates pending MV3 Native Messaging Promises immediately.
|
|
118
|
+
// Each span's terminal record follows its BEGIN across a one-shot
|
|
119
|
+
// Native process, which can take longer than a single 300-ms drain.
|
|
120
|
+
// The business receipt is already sent; only soft audit transport
|
|
121
|
+
// may run until this bounded teardown deadline (never retry Action).
|
|
122
|
+
try{
|
|
123
|
+
const deadline=Date.now()+2300;
|
|
124
|
+
while(Date.now()<deadline){
|
|
125
|
+
if(await workerApi.audit.drain(Math.min(700,deadline-Date.now())))break;
|
|
126
|
+
const health=workerApi.audit.health();
|
|
127
|
+
if(health.pending===0&&health.inFlight===0)break;
|
|
128
|
+
}
|
|
129
|
+
}catch{/* Audit cannot change the accepted business result. */}
|
|
123
130
|
chrome.runtime.reload();
|
|
124
131
|
} catch (error) {reply({status: "FAILED", code: error.message});}
|
|
125
132
|
})();
|