feat(kanban): migrate queued commands transactionally

req: sync/014
This commit is contained in:
slhx agent
2026-07-13 18:06:47 +02:00
parent 3ace17f9f1
commit a17de85b4f
5 changed files with 251 additions and 38 deletions
+5 -4
View File
@@ -256,7 +256,8 @@ async fn kanban_command_persists_before_projection_and_restores_after_reload() -
.json()
.clone();
assert_eq!(persisted["persisted"]["order"], "1|2");
assert_eq!(persisted["persisted"]["detail"]["schemaVersion"], 1);
assert_eq!(persisted["persisted"]["detail"]["schemaVersion"], 2);
assert_eq!(persisted["persisted"]["detail"]["targetColumn"], "done");
assert_eq!(persisted["persisted"]["detail"]["causal"], 1);
let actor = persisted["persisted"]["detail"]["actor"]
.as_str()
@@ -307,12 +308,12 @@ async fn kanban_command_persists_before_projection_and_restores_after_reload() -
.execute(
r#"
window.__futureCommandStored = false;
const request = indexedDB.open('hemx-kanban-v1', 1);
const request = indexedDB.open('hemx-kanban-v1');
request.onsuccess = () => {
const tx = request.result.transaction('commands', 'readwrite');
tx.objectStore('commands').add({
id: 'future:2', schemaVersion: 2, actor: 'future', session: 'future',
causal: 2, kind: 'reorder_card', cardId: '2', eventKind: 'click', key: null,
id: 'future:2', schemaVersion: 3, actor: 'future', session: 'future',
causal: 2, kind: 'reorder_card', cardId: '2', targetColumn: 'done', eventKind: 'click', key: null,
});
tx.oncomplete = () => { window.__futureCommandStored = true; };
};