Refusals an application meets
The errors an application's own code can see — in the frame, or at build — what each means, and what to do instead. The refusals a host shows a person when a document cannot be opened are a different list, in the host bridge.
REPLICATED_TABLE_IMMUTABLE
Applies to passable, session. When: An UPDATE or DELETE ran against a replicated table.
Do instead: Write through window.dai.replicated.change or .remove instead (SHARED-WRITE-SURFACE).
NOT NULL constraint failed: t._r_replica
Applies to passable, session. When: A raw INSERT ran against a replicated table — by hand, from a kit control, or from a seed block. SQLite's own message, not a named refusal.
Do instead: Insert through window.dai.replicated.insert (SHARED-WRITE-SURFACE, SHARED-KIT-READS).
ROW_REJECTED
Applies to passable, session. When: The write rules refused a row. From an application, almost always an insert in a session document that did not name its session ("… carries no session, but <table> declares the session profile"); otherwise a raw UPDATE that tried to mark a superseded row current again.
Do instead: Pass the session as the third argument of insert (SESSION-ROW-CARRIES-SESSION), and never UPDATE a replicated table.
WRITE_SURFACE_UNAVAILABLE
Applies to passable, session. When: A shared write ran without the host's write rules — usually a document opened straight in a browser.
Do instead: Tell the person to open the document in the DAI opener (SHARED-NEEDS-HOST).
NO_DOCUMENT_OPEN
Applies to passable, session. When: A shared write ran before window.dai.openDatabase() resolved.
Do instead: Await openDatabase() before the first write.
CLOSE_NOT_PERMITTED
Applies to session. When: A non-creator called session.close under close=creator.
Do instead: Offer the close control only to the creator (SESSION-CLOSE).
NOT_SEAT_CREATOR
Applies to session. When: Someone other than the session's creator called session.reseat.
Do instead: Offer the fresh-invite repair only to the creator (SESSION-CONTESTED-SEAT).
CANNOT_RESEAT
Applies to session. When: session.reseat was called on a session with no contested seat.
Do instead: Offer the repair only when a seat is contested (SESSION-CONTESTED-SEAT).
REPLICATION_SCHEMA_INVALID
Applies to passable, session. When: At build: a replicated table declared a PRIMARY KEY, AUTOINCREMENT or an _r_ column, or the session profile was malformed or had no replicated table.
Do instead: Fix schema.sql (SHARED-NO-KEY, SHARED-NO-R-COLUMNS, SESSION-PROFILE).