From 53dc7b9c6b5f2607bd32dc1f4230c74d88f70bd0 Mon Sep 17 00:00:00 2001 From: Sylvain Duchesne Date: Thu, 24 Sep 2026 13:01:49 +0200 Subject: [PATCH] docs: fusionner le commentaire duplique sur la souscription bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deux blocs disaient « la souscription est maintenue vivante pour la session », l'un accroche a onSetupFailed et l'autre a l'appel de souscription - exactement le defaut de commentaire orphelin que cette tache devait corriger ailleurs. --- .../polyfill/src/emulated-verifier/open-repo.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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) => {