@tomflow/chatloop-extension 0.3.55 → 0.3.56
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 +1 -1
- package/lib/session-file.mjs +8 -0
- package/package.json +1 -1
package/extension/manifest.json
CHANGED
package/lib/session-file.mjs
CHANGED
|
@@ -88,6 +88,14 @@ export function writeSession(input,replaceBlockedSessionId=null,resumeBlockedSes
|
|
|
88
88
|
next.activeChatId!==null&&old.activeChatId!==next.activeChatId)
|
|
89
89
|
throw fail('SESSION_CHAT_CHANGED_WITHOUT_HANDOFF');
|
|
90
90
|
}
|
|
91
|
+
// A read-only Status query and non-authoritative Worker diagnostics can
|
|
92
|
+
// re-sync the SAME durable projection. These are not a new Session
|
|
93
|
+
// transition: preserve Native's CAS timestamp and avoid rewriting disk.
|
|
94
|
+
// A genuine phase/identity/generation change still advances the record.
|
|
95
|
+
if(old && !replaceBlockedSessionId && !resumeBlockedSessionId
|
|
96
|
+
&& ['sessionId','projectId','phase','generation',
|
|
97
|
+
'activeChatId','activeChatUrl'].every(key=>old[key]===next[key]))
|
|
98
|
+
return old;
|
|
91
99
|
const temp=join(dir,'.active-session-'+randomUUID()+'.tmp');
|
|
92
100
|
try{writeFileSync(temp,JSON.stringify(next,null,2)+'\n',{flag:'wx',mode:0o600});
|
|
93
101
|
renameSync(temp,file);
|