Pre-flight Checks
Bug Description
When or pushes mutations to the cloud server, the returned cloud seqs (BIGSERIAL from PostgreSQL) are discarded. The local call uses local integer seqs that have no relationship to the cloud seqs.
This means:
- Mutations are pushed to cloud successfully
- Cloud assigns BIGSERIAL seqs (1, 2, 3...) independently
- Local marks mutations 963, 964... as acked
- Cloud has NO record of seq 963, 964... — it has seq 1, 2, 3...
- On next sync, local sees mutations 963+ as unacked and re-pushes them
- Data duplication on every sync cycle
Root Cause
Location: lines 486-492
The system has two independent seq generators:
- Local: INTEGER PRIMARY KEY AUTOINCREMENT
- Cloud: BIGSERIAL
There is no mapping between them. After push, the cloud seqs are lost.
Impact
- Critical: Data duplication — every sync re-pushes all mutations
- Local reports acked but cloud has different seqs
- Autosync is unreliable for multi-machine scenarios
- 52 unacked mutations pile up even when push succeeded
Environment
- Engram Version: 1.13.1
- Cloud Server: Self-hosted with PostgreSQL backend
- Projects affected: Any enrolled project using cloud sync
Proposed Fix
Store the cloud seq mapping after push:
Or alternatively, modify to accept cloud seqs and maintain the mapping internally.
Tags
- cloud-sync
- bug
- sync-failure
Pre-flight Checks
Bug Description
When or pushes mutations to the cloud server, the returned cloud seqs (BIGSERIAL from PostgreSQL) are discarded. The local call uses local integer seqs that have no relationship to the cloud seqs.
This means:
Root Cause
Location: lines 486-492
The system has two independent seq generators:
There is no mapping between them. After push, the cloud seqs are lost.
Impact
Environment
Proposed Fix
Store the cloud seq mapping after push:
Or alternatively, modify to accept cloud seqs and maintain the mapping internally.
Tags