shennian 0.3.44 → 0.3.45
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{acknowledgeSessionIndexUpdate as
|
|
1
|
+
import{acknowledgeSessionIndexUpdate as r,listPendingSessionIndexUpdates as a}from"./store.js";const o=new WeakMap,t=new WeakSet;function c(s){const e=s,i=o.get(e);if(i)return t.add(e),i;const n=f(s).finally(()=>{o.get(e)===n&&o.delete(e),t.delete(e)&&u(s)});return o.set(e,n),n}async function f(s){const e=a(),i=[];for(const n of e)try{await s.sendBufferedEvent({type:"event",event:"session.index.updated",id:`session-index-${n.daemonInstallationId}-${n.session.id}-${n.session.indexRevision}`,payload:n},6e4),r(n.session.id,n.session.indexRevision)}catch(d){i.push(d)}if(i.length>0)throw new AggregateError(i,"one or more session indexes failed")}function u(s){c(s).catch(e=>{console.error("[session-index] sync failed; dirty revisions retained for retry",e)})}export{c as publishPendingSessionIndexes,u as requestSessionIndexPublish};
|