docs(contract): un rejet veut dire « inconnu », jamais « absent »

Le contrat n'énonçait qu'un cas particulier — createEntityDoc lève si le
document ne peut pas être enregistré — alors que c'est devenu la règle de toute
une famille d'appels.

Ceux qui doivent d'abord SAVOIR si une chose existe avant d'agir lèvent
désormais quand ils n'ont pas pu le savoir, au lieu de continuer comme si la
réponse était « rien ». C'est ce qui a cessé de fabriquer une seconde inbox, un
compte dupliqué ou une racine de registre en double.

La conséquence est actionnable et doit être dite : un rejet ne signifie pas que
la chose est absente, il signifie qu'on l'ignore. Le relancer ou le remonter,
mais surtout ne pas le lire comme un résultat vide — ce qui reviendrait à
réintroduire côté appelant exactement le défaut qu'on a retiré.
This commit is contained in:
Sylvain Duchesne
2026-08-16 10:22:36 +02:00
parent f30685bdb9
commit 1ecf511e9d
@@ -122,7 +122,7 @@ It resolves **only once that work has actually completed**: if what was shared w
**The session is the package's, not yours.** You never build one, and no call takes one. Call this package's `init` (not the one you passed to `configure`): it captures the session the SDK delivers to `init`'s callback and keeps it, then calls your callback with that same event untouched — so an application that wants the `session_id` for the `docs` primitives reads it there, and one that does not may pass no callback at all. Identity normalisation is the package's too: `@Alice`, `alice ` and `ALICE` are one person.
`createEntityDoc` throws if the document cannot be recorded in its store.
Where a call must first find out whether something already exists — a document's record in its store, a user's inbox — it throws when it could not find out, instead of proceeding as though the answer were "nothing". So `createEntityDoc` throws if the document cannot be recorded in its store, and resolving an inbox throws rather than handing back a second one. **A rejection means "unknown", never "absent"** — retry it or surface it, but do not read it as an empty result.
## Non-guarantees