Skip to content

js-bao-wss-client


js-bao-wss-client / DocumentFormatMismatchEvent

Interface: DocumentFormatMismatchEvent ​

Payload of the document:format-mismatch event (client.on("document:format-mismatch", ...)).

Fired when the platform refuses a document because the format this client believed it had is not the format the platform resolved. The document is CLOSED when this arrives — its local rows and its unacknowledged writes are kept, nothing is evicted — because two of the three open shapes have no waiter to reject: a cached open sends its handshake from a microtask, and an already-open document re-syncs on reconnect. An open that WAS waiting on the network rejects with the same error as well.

Diagnose from declared and actual before doing anything: the server also logs Document format disagreement naming its own pinned format. Evicting the document clears this client's belief, which repairs a stale row and HIDES a mis-pinned document.

Properties ​

actual ​

actual: 1 | 2

What the platform resolved for the document.


declared ​

declared: 1 | 2

What this client believed, from its own local metadata row.


documentId ​

documentId: string


error ​

error: JsBaoError

The very error a waiting documents.open rejects with: code is DOCUMENT_FORMAT_MISMATCH and details carries documentId, declared and actual.

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30