API reference > @kontsedal/olas-cross-tab > SetDataMessage
SetDataMessage type
What a tab posts when the app writes a synced query's data outside a fetch or hydration. A receiving tab applies data to the same entry, as whatsource says it is:
'write'and'replace'are canonical. The receiver writes the server truth,server.datawhen the sender's data held a guess anddataotherwise, as a patch or as a replace that supersedes its own fetch. -'optimistic'is a guess. The receiver showsdataas a guess of its own, which leaves its stale clock alone and waits for the sender's rollback or commit. -'rollback'removes that guess.serverpresent means the sender still shows other guesses, and the receiver showsdataas one. -'commit'makesdatathe receiver's data as a commit does: the guess is committed, and the stale clock is left alone.
Signature:
typescript
type SetDataMessage = {
v: typeof PROTOCOL_VERSION;
type: 'setData';
sourceId: string;
msgId: number;
queryId: string;
keyArgs: readonly unknown[];
data: unknown;
pageParams?: readonly unknown[];
source?: RelayedSource;
server?: {
data: unknown;
pageParams?: readonly unknown[];
};
};References: PROTOCOL_VERSION, RelayedSource