From 82be3684fab2b4272d8daeecf8d42df1e151daf4 Mon Sep 17 00:00:00 2001 From: Sylvain Duchesne Date: Thu, 24 Sep 2026 12:57:43 +0200 Subject: [PATCH] docs: corriger la justification fausse a cote de l'assertion d'etat de synchro Le commentaire affirmait qu'aucune des deux valeurs ne permet de prendre une lecture a zero ligne pour une absence definitive. `unknown` le permet, et deliberement : `index-deposit.noRowsMeansAbsent` l'accepte, parce que la ou il n'y a pas de semantique `State` il n'y a pas de barriere a avoir manquee. Les deux valeurs ne sont pas interchangeables, et laquelle est juste depend de la page - ce que l'assertion epingle dans les deux mondes est la meme chose : pas `"synced"`. --- .../test/cold-read-for-document.test.ts | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/polyfill/test/cold-read-for-document.test.ts b/packages/polyfill/test/cold-read-for-document.test.ts index 0d2edb6..e2eb52d 100644 --- a/packages/polyfill/test/cold-read-for-document.test.ts +++ b/packages/polyfill/test/cold-read-for-document.test.ts @@ -116,14 +116,20 @@ describe("reading the messages left on my note, on a page that has just loaded", // ...because nothing on THIS page ever brought the NOTE into view. The address lives // on it. // - // `"timed-out"`, not `"unknown"`, since 2026-09-24: a registry reset now DOWNGRADES the - // documents it takes subscriptions away from instead of forgetting their state, so - // `"unknown"` means only "no barrier was ever expected here" and can be read as - // authoritative. Note this particular value is a harness artefact and not what a real - // reload produces: `reloadPage` resets the registry inside one process, so the note is - // still in it from the first page, where a browser reload would start with an empty - // module and answer `"unknown"`. Either way it is the safe reading - neither value lets - // a zero-row read be called a definitive absence here. + // `"timed-out"`, not `"unknown"`, since 2026-09-24: a reset DISOWNS the documents it takes + // subscriptions away from rather than forgetting them, so `"unknown"` keeps its one + // meaning - "no barrier was ever expected here". + // + // CORRECTED 2026-09-24, and the reason that used to stand here was FALSE. It said neither + // value lets a zero-row read be called a definitive absence: `unknown` does, and + // deliberately - `emulated-verifier/index-deposit.ts` `noRowsMeansAbsent` returns true for + // it, because where there are no `State` semantics there is no barrier to have missed. The + // two values are not interchangeable, and which one is correct depends on the page. This + // particular one is a harness artefact: `reloadPage` resets the registry inside ONE process, + // so the note is still known to it from the first page, and `"timed-out"` - "opened here, + // and no barrier to show for it" - is the exact truth. A browser reload starts with an empty + // module, where nothing was ever opened and `"unknown"` is the exact truth instead. What + // this line pins in both worlds is the same thing: not `"synced"`. expect(getSyncState(note)).toBe("timed-out"); });