feat: le polyfill possède la session et la normalisation des identités
Pour démarrer, une application devait écrire une promesse autour du callback
d'init(), attraper l'événement loggedin, puis fournir un thunk getSession qui
dépiaute session_id et les trois identifiants de store dans notre forme. Plus un
normalizeId. C'est précisément la plomberie que ce paquet existe pour absorber :
chaque application la réécrirait à l'identique, et c'est elle qui a produit deux
défauts aujourd'hui — un blocage et un partage cassé en silence.
En amont, une session est RENDUE ; une application n'en assemble jamais une à
partir de champs bruts. Et les identités virtuelles sont une invention du
polyfill, donc leur normalisation lui appartient.
Le wrapper init() enveloppe désormais le callback de l'appelant : il capture
l'événement, en dérive la session, puis appelle le callback avec le même
événement. Le paquet n'appelle jamais init de sa propre initiative — il
l'enveloppe. Sans callback, il capture quand même.
getSession et normalizeId quittent la surface publiée. Le chemin d'injection
reste pour les harnais, mais inatteignable depuis l'entrée : vérifié par un
import à l'exécution et par un configure() refusé à la compilation.
Défaut trouvé et corrigé en route : le broker envoie session_id en NOMBRE, et le
convertir en chaîne faisait refuser tous les appels par le binding wasm. La
valeur ne fait que transiter, elle est relayée telle quelle. Reste que toute la
chaîne la type string — inexactitude antérieure à ce commit, à traiter à part.
Une application écrit maintenant : configure({ ng, useShape, init, sharedWallet }).
This commit is contained in:
@@ -100,7 +100,11 @@ export type { NG } from "@ng-org/web";
|
||||
*/
|
||||
export { configure } from "./shared-wallet/bootstrap";
|
||||
export type { EventuallyConfig } from "./shared-wallet/bootstrap";
|
||||
export type { RegistrySession } from "./shared-wallet/account-registry";
|
||||
// `RegistrySession` went with `getSession` (2026-08-12): it was published for exactly one
|
||||
// reason — an application typed the session thunk it injected with it — and a published
|
||||
// type whose signature is gone is a promise about the target that nothing keeps. Upstream a
|
||||
// session is RETURNED, never assembled, so no consumer has a session shape to declare. It
|
||||
// stays DEFINED in `shared-wallet/account-registry.ts`, where the library uses it.
|
||||
|
||||
// --- what this block deliberately does NOT contain --------------------------
|
||||
//
|
||||
@@ -116,6 +120,17 @@ export type { RegistrySession } from "./shared-wallet/account-registry";
|
||||
// harness is allowed to do and an application is not.
|
||||
// - `connectedUser` — `ensureIdentity` awaits it. Upstream, opening the session IS the
|
||||
// connection; no application awaits a second call, so ours should not either.
|
||||
//
|
||||
// And two FIELDS of `EventuallyConfig` on 2026-08-12, for the same reason one call up:
|
||||
//
|
||||
// - `getSession` — the session is `init()`'s to deliver, and this package's to keep. An
|
||||
// application that assembles one out of `session_id` / `private_store_id` / … is
|
||||
// building a shape the target never asks for, and every consumer built the same one.
|
||||
// - `normalizeId` — the identities being normalized are this package's own invention, so
|
||||
// there was never a decision here for a consumer to make.
|
||||
//
|
||||
// Both are still substitutable through `shared-wallet/bootstrap`'s `configureStoreRegistry`
|
||||
// — the suites and the e2e harness need it, and nothing published reaches it.
|
||||
|
||||
// ── the access gate — polyfill-era in substance, one line in the app ────────
|
||||
// One call before the app renders. It shows a technical barrier only while the shared
|
||||
|
||||
Reference in New Issue
Block a user