non unique TS in sqlite#2342
Conversation
Greptile SummaryThis PR addresses duplicate-timestamp
Confidence Score: 4/5Safe to merge for fresh deployments, but existing databases with the old UNIQUE constraint on ts will not benefit from the fix and will continue to throw constraint errors on duplicate timestamps. The schema change correctly removes the UNIQUE constraint for new databases, but _ensure_tables uses CREATE TABLE IF NOT EXISTS, so any on-disk database already carrying the old constraint is untouched. Deployments with existing store files will still hit the exact failure the PR means to resolve. dimos/memory2/observationstore/sqlite.py — the _ensure_tables method needs a migration path to cover existing databases. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["time.time() timestamps\n(may duplicate on burst)"] --> B["Go2Memory.insert(obs)"]
B --> C{"Table exists?"}
C -- "New DB\n(no UNIQUE)" --> D["INSERT succeeds ✓"]
C -- "Old DB\n(UNIQUE constraint)" --> E["UNIQUE constraint failed ✗"]
E --> F["Exception — observation dropped"]
D --> G["SQLite: ts REAL NOT NULL"]
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…mos into fix/ivan/mem2timestamps
we gave up on sensor assigned timestamps on go2
(timestamps have different weird bugs on different firmware versions, unable to get image timestamps from the device)
so now we use time.time()
issue is that during network dropout issues and latency, we receive a bunch of messages together, and hit UNIQUE constraints in mem2 for ts.. for now unblocking this by allowing non UNIQUE ts storage, and will investigate solutions later
PS also removing markers detector from memory blueprint