feat(kanban): expose redacted sync diagnostics
req: operations/001 req: security/002 req: sync/016
This commit is contained in:
@@ -51,6 +51,7 @@ function migrateCommandLog(request, oldVersion) {
|
||||
schemaVersion: COMMAND_SCHEMA,
|
||||
targetColumn: command.targetColumn || "done",
|
||||
accountPartition: command.accountPartition || "demo:demo",
|
||||
queuedAt: Number.isSafeInteger(command.queuedAt) ? command.queuedAt : Date.now(),
|
||||
});
|
||||
}
|
||||
meta.put({ from: oldVersion, to: DATABASE_VERSION, migrated: legacy.length }, MIGRATION_KEY);
|
||||
@@ -139,6 +140,7 @@ async function appendReorder(database, accountPartition, wire) {
|
||||
actor,
|
||||
session: stableSession(),
|
||||
causal,
|
||||
queuedAt: Date.now(),
|
||||
kind: "reorder_card",
|
||||
cardId: String(wire[2] || "1"),
|
||||
targetColumn: "done",
|
||||
@@ -199,6 +201,7 @@ function validate(command) {
|
||||
if (typeof command.actor !== "string" || !command.actor) invalidCommand(command, "actor");
|
||||
if (typeof command.session !== "string" || !command.session) invalidCommand(command, "session");
|
||||
if (!Number.isSafeInteger(command.causal) || command.causal < 1) invalidCommand(command, "causal");
|
||||
if (!Number.isSafeInteger(command.queuedAt) || command.queuedAt < 0) invalidCommand(command, "queuedAt");
|
||||
if (command.id !== `${command.actor}:${command.causal}`) invalidCommand(command, "id");
|
||||
if (command.kind !== "reorder_card") invalidCommand(command, "kind");
|
||||
if (typeof command.cardId !== "string" || !command.cardId) invalidCommand(command, "cardId");
|
||||
|
||||
Reference in New Issue
Block a user