From f77317c4d1dae79a5523cafb380f3ac0b0787934 Mon Sep 17 00:00:00 2001 From: Sylvain Duchesne Date: Thu, 13 Aug 2026 08:45:00 +0200 Subject: [PATCH] =?UTF-8?q?docs(contract):=20trois=20comportements=20que?= =?UTF-8?q?=20l'appelant=20doit=20conna=C3=AEtre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les signatures étaient à jour, les affirmations non. Trois choses visibles par une application n'y figuraient pas. L'ordre d'appel : ensureIdentity() se résout quand une session est ouverte, donc l'attendre avant d'avoir appelé init() ne se résout JAMAIS. Silencieux, sans erreur — le pire mode de défaillance possible pour qui intègre. C'est aussi la raison de dire lequel des deux init() appeler, comme on le dit déjà pour ng. La barrière monte à chaque chargement en page de tête, pas seulement au premier. Et la page peut se recharger toute seule quand on y revient : une application qui garde de l'état en mémoire le perd, et ne pouvait pas le deviner. Aucune de ces phrases ne décrit comment c'est fait — seulement ce qu'un appelant doit prévoir. --- .project/concepts/app-contract/contract_polyfill-surface.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.project/concepts/app-contract/contract_polyfill-surface.md b/.project/concepts/app-contract/contract_polyfill-surface.md index 8a862fe..4342722 100644 --- a/.project/concepts/app-contract/contract_polyfill-surface.md +++ b/.project/concepts/app-contract/contract_polyfill-surface.md @@ -16,7 +16,8 @@ This package covers placement (creating and listing an application's documents b An application using this package must: - serve a wallet file (`.ngw`) from its own bundle, and pass its URL and password to `configure` as `sharedWallet: { fileUrl, password }`; -- call `ensureIdentity()` in a browser context before rendering its interface; it mounts a barrier in the document. +- call `init(…)` — this package's, not the one it passed to `configure` — and then await `ensureIdentity()`, in a browser context, before rendering its interface. `ensureIdentity()` resolves once a session is open, so awaiting it before `init` has been called never resolves; +- expect `ensureIdentity()` to mount a full-screen barrier on every top-level load, and the page to reload itself once when a person returns to it: hold no un-persisted state across that call. ## Surface