The database publishes commits (WatchCommits); the subscription server and the database server tag the changes a subscription receives from one commit with commitId and commitCount (optional wire fields older peers ignore). The C# subscription client buffers a tagged commit and applies it through one CultCache.Commit, judged on its result, so a swap of [CultIndex] values replicates. A refusal sets Fault, raises Faulted, and stops further applying. Snapshots apply as one commit too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
26 lines
1.1 KiB
JSON
26 lines
1.1 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://github.com/GameCult/CultLib/contracts/cultnet/cultnet.database-change-raw.schema.json",
|
|
"title": "CultNet Raw Database Change Message",
|
|
"type": "object",
|
|
"required": ["schemaVersion", "messageId", "subscriptionId", "changeKind"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"schemaVersion": { "const": "cultnet.database_change_raw.v0" },
|
|
"messageId": { "type": "string", "minLength": 1 },
|
|
"subscriptionId": { "type": "string", "minLength": 1 },
|
|
"changeKind": { "enum": ["added", "updated", "removed"] },
|
|
"document": { "$ref": "./cultnet.raw-document-record.schema.json" },
|
|
"recordKey": { "type": "string", "minLength": 1 },
|
|
"schemaId": { "type": "string", "minLength": 1 },
|
|
"commitId": { "type": "string", "minLength": 1 },
|
|
"commitCount": { "type": "integer", "minimum": 2 }
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": { "properties": { "changeKind": { "const": "removed" } } },
|
|
"then": { "required": ["recordKey", "schemaId"] },
|
|
"else": { "required": ["document"] }
|
|
}
|
|
]
|
|
}
|