diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-31 02:15:17 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-31 02:15:17 +0900 |
| commit | ed93dd099f43dd6746276a72953485de91b49c8c (patch) | |
| tree | db737032e32508b7de24d94696a13e4bfebe8978 /src/client/sync/queue.test.ts | |
| parent | 78609e0b390e9a485c8935c17db6e0093660ebef (diff) | |
| download | kioku-ed93dd099f43dd6746276a72953485de91b49c8c.tar.gz kioku-ed93dd099f43dd6746276a72953485de91b49c8c.tar.zst kioku-ed93dd099f43dd6746276a72953485de91b49c8c.zip | |
feat(sync): add sync support for note-related entities
Extend the sync system to handle NoteType, NoteFieldType, Note, and
NoteFieldValue entities. This includes:
- Server sync repository and routes for push/pull of new entities
- Client sync queue, push, pull, and conflict resolution for notes
- Update Card sync to include noteId and isReversed fields
- Add comprehensive tests for all sync functionality
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/client/sync/queue.test.ts')
| -rw-r--r-- | src/client/sync/queue.test.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/client/sync/queue.test.ts b/src/client/sync/queue.test.ts index b62ece2..2038e0d 100644 --- a/src/client/sync/queue.test.ts +++ b/src/client/sync/queue.test.ts @@ -303,6 +303,10 @@ describe("SyncQueue", () => { decks: [{ id: deck.id, syncVersion: 5 }], cards: [], reviewLogs: [], + noteTypes: [], + noteFieldTypes: [], + notes: [], + noteFieldValues: [], }); const found = await localDeckRepository.findById(deck.id); @@ -327,6 +331,10 @@ describe("SyncQueue", () => { decks: [], cards: [{ id: card.id, syncVersion: 3 }], reviewLogs: [], + noteTypes: [], + noteFieldTypes: [], + notes: [], + noteFieldValues: [], }); const found = await localCardRepository.findById(card.id); @@ -361,6 +369,10 @@ describe("SyncQueue", () => { decks: [], cards: [], reviewLogs: [{ id: reviewLog.id, syncVersion: 2 }], + noteTypes: [], + noteFieldTypes: [], + notes: [], + noteFieldValues: [], }); const found = await localReviewLogRepository.findById(reviewLog.id); @@ -376,6 +388,10 @@ describe("SyncQueue", () => { decks: [], cards: [], reviewLogs: [], + noteTypes: [], + noteFieldTypes: [], + notes: [], + noteFieldValues: [], }); expect(listener).toHaveBeenCalled(); @@ -401,6 +417,10 @@ describe("SyncQueue", () => { decks: [serverDeck], cards: [], reviewLogs: [], + noteTypes: [], + noteFieldTypes: [], + notes: [], + noteFieldValues: [], }); const found = await localDeckRepository.findById("server-deck-1"); @@ -444,6 +464,10 @@ describe("SyncQueue", () => { decks: [], cards: [serverCard], reviewLogs: [], + noteTypes: [], + noteFieldTypes: [], + notes: [], + noteFieldValues: [], }); const found = await localCardRepository.findById("server-card-1"); @@ -482,6 +506,10 @@ describe("SyncQueue", () => { decks: [], cards: [], reviewLogs: [serverLog], + noteTypes: [], + noteFieldTypes: [], + notes: [], + noteFieldValues: [], }); const found = await localReviewLogRepository.findById("server-log-1"); @@ -497,6 +525,10 @@ describe("SyncQueue", () => { decks: [], cards: [], reviewLogs: [], + noteTypes: [], + noteFieldTypes: [], + notes: [], + noteFieldValues: [], }); expect(listener).toHaveBeenCalled(); |
