fix: prevent stale settings sync overwrites#342
Conversation
Sentry Preview Error TriageNo Sentry errors found for this PR's preview deployment as of Tue, 23 Jun 2026 20:07:52 GMT. This comment updates automatically after each push. |
Code Coverage OverviewLanguages: JavaScript JavaScript / code-coverage/vitestThe overall coverage in the branch remains at 27%, unchanged from the branch. Show a code coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88ec7c6a24
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2cc1cda4a
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ffe95bf45
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6372b415e5
ℹ️ 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".
Deploying with
|
| Status | Preview URL | Commit | Alias | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! | https://pr-342-charm.justin-tech.workers.dev | bbf6d89 | pr-342 |
Tue, 23 Jun 2026 20:10:52 GMT |
Description
Add an
updatedAtfreshness marker to settings-sync payloads and use it to avoid uploading stale offline settings over newer account data. The hook now pulls newer remote settings before uploading, ignores older remote echoes, and keeps explicit clear markers intact for later syncs.Fixes #334
Type of change
Checklist:
AI disclosure:
This patch adds a persisted local freshness timestamp for settings sync and includes an
updatedAtfield in the Matrix account-data payload. The sync hook now compares local and remote freshness before uploading, applies newer remote settings instead of overwriting them, ignores stale remote updates that arrive after newer local changes, and keeps explicit remote-clear markers round-trippable. The accompanying tests cover the new timestamped upload payload, stale-overwrite prevention, stale remote event rejection, and the test-mock reset needed to keep the suite isolated.