mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 18:09:40 +02:00
- New SyncChange / FieldChange / SyncOp types replace `any[]` in
applyServerChanges. The wire format is now self-documenting and
TypeScript catches malformed callsites at compile time.
- isValidSyncChange() validates incoming server payloads at the boundary:
malformed entries are dropped with a single warn log, valid ones are
applied. A bad row from the server can no longer corrupt IndexedDB.
Hand-rolled type guards keep us free of a runtime-validation dep.
- applyServerChanges() and readFieldTimestamps() are now top-level
exports (extracted out of createUnifiedSync's closure) so they can be
imported directly by tests. Behaviour is unchanged — the closure
variant inside the sync manager just resolves the module-level
symbol now.
- New sync.test.ts covers:
* pure isValidSyncChange and readFieldTimestamps cases
* field-level LWW: server-newer wins, split outcome when local-newer
on one field and server-newer on another
* insert with __fieldTimestamps stamping
* soft-delete LWW guard
* malformed-entry drop with valid entries surviving
* sync-loop guard: server-applied writes don't generate _pendingChanges
- fake-indexeddb added as devDependency for the integration tests.
Note: the monorepo's vitest install is currently tangled across mixed
@vitest/* package versions in the lockfile, so `pnpm test` fails before
reaching this file. The tests are written to pass on any vitest 4.x once
that's untangled — needs its own dedicated cleanup pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| CalendarLogo.svelte | ||
| CardsLogo.svelte | ||
| ChatLogo.svelte | ||
| CitycornersLogo.svelte | ||
| ClockLogo.svelte | ||
| ContactsLogo.svelte | ||
| ContextLogo.svelte | ||
| index.ts | ||
| InventoryLogo.svelte | ||
| LightWriteLogo.svelte | ||
| MailLogo.svelte | ||
| ManaLogo.svelte | ||
| MemoroLogo.svelte | ||
| MoodlitLogo.svelte | ||
| MusicLogo.svelte | ||
| NutriPhiLogo.svelte | ||
| PlantaLogo.svelte | ||
| PresiLogo.svelte | ||
| QuestionsLogo.svelte | ||
| SkillTreeLogo.svelte | ||
| StorageLogo.svelte | ||
| TodoLogo.svelte | ||
| UloadLogo.svelte | ||
| ZitareLogo.svelte | ||