Refactor mini_sim_db toward local-first sync workflow - #10
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 882f8abcaa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if fields: | ||
| upd_cases(self.local_db_path, {case: fields}) |
There was a problem hiding this comment.
Update local timestamp on fallback writes
When SimDbClient applies an update locally (for dual-write or offline fallback), it forwards user fields directly to upd_cases without setting updated_at. In the new sync workflow, pending detection relies on last_synced_updated_at < updated_at, so any local-only update that does not include a newer timestamp can be permanently omitted from sync-export after an initial sync. This is reproducible with a transport failure path: export once, run client.update(...) offline, then sync_status still reports zero pending even though fields changed.
Useful? React with 👍 / 👎.
Summary
remote_api/moduleWhat changed
remote_api/sim_db_client.pyandsim_db_server.pyjob_id+updated_atSync model
mini_sim_db_sync_v1JSON filejob_idupdated_atwinsVerification
python3 -m unittest -vNotes
This PR intentionally builds on the SQLite storage PR that is already merged. The remote API remains available, but it is now treated as an optional transport layer rather than the primary architecture.