diff --git a/packages/polyfill/src/emulated-verifier/open-repo.ts b/packages/polyfill/src/emulated-verifier/open-repo.ts index 421620c..ed9d500 100644 --- a/packages/polyfill/src/emulated-verifier/open-repo.ts +++ b/packages/polyfill/src/emulated-verifier/open-repo.ts @@ -405,13 +405,6 @@ export async function openRepoUnguarded(nuri: Nuri): Promise { } stopWaiting(); }; - // The bootstrap subscription is kept ALIVE for the session — holding it open - // is the whole point. We wait for the FIRST `State` event specifically (the - // barrier), NOT any push: the platform pushes `TabInfo` before `State`, and - // resolving on `TabInfo` would return before the real sync barrier. - // Unguarded on purpose: the caller already decided. `ensureRepoOpen` applied - // rule 2 above; `ensurePhysicalRepoOpen` is the machinery's door and is not - // subject to the boundary at all (see physical.ts). // A failed establish is REPORTED, and `subscribe.ts` offers this channel precisely // so that a caller can retry. Let the listener go, so the next caller opens a NEW // subscription rather than joining a fan-out that is not going to push. There is no @@ -437,7 +430,14 @@ export async function openRepoUnguarded(nuri: Nuri): Promise { }; // The bootstrap subscription is kept ALIVE for the session - holding it open is the // whole point. It is a LISTENER on the document's one real subscription, which is why - // it says nothing about whether that subscription exists. + // it says nothing about whether that subscription EXISTS: that is {@link docChannel}'s + // answer, and the two together are what `openRepoUnguarded` asks above. + // + // We wait for the FIRST `State` event specifically (the barrier), NOT any push: the + // platform pushes `TabInfo` before `State`, and resolving on `TabInfo` would return + // before the real sync barrier. Unguarded on purpose - the caller already decided: + // `ensureRepoOpen` applied rule 2, and `ensurePhysicalRepoOpen` is the machinery's door + // and is not subject to the boundary at all (see physical.ts). mine.release = subscribeDocUnguarded( nuri, (_r, type) => {