Skip to content

Sync: leave out a report too old for the wire, never misdate it - #106

Merged
phornstein merged 1 commit into
mainfrom
fix/sync-report-time-range
Oct 21, 2026
Merged

phornstein merged 1 commit into
mainfrom
fix/sync-report-time-range

Conversation

@phornstein

Copy link
Copy Markdown
Collaborator

Fixes the rust check, which has failed on main since Oct 20.

Cause. In the sync wire format (ot-sync/src/wire.rs) a report's time is a 32-bit millisecond offset from the message's send time, about ±24.8 days. Older or newer times were silently clamped, so the receiving node got a wrong time. The engine tests used fixed report times starting 2026-09-24. Once that was more than 24.8 days ago, nodes_share_one_picture_under_one_number failed every run. On the dev server it passes with times 24 days old and fails at 25.

Changes

  • wire::report_time_fits. encode_reports leaves out a report whose offset doesn't fit, instead of clamping it. The wire format is unchanged.
  • Engine::sync_flush logs a warning naming the tracks it leaves out.
  • The engine tests' t0() is now noon UTC yesterday, so test times can't go stale.
  • New test: a report at the edge of the range goes through; one past either end is left out.

Gate (dev server): cargo fmt --check, cargo clippy --workspace --all-targets -D warnings and cargo test --workspace all pass. ot-server: 227/227.

🤖 Generated with Claude Code

A report's time travels as a 32-bit millisecond offset from the send
time, about 24.8 days either side. A report outside that was clamped and
arrived with a wrong time; it is now left out, and the engine logs it.

The engine tests' reports were dated 2026-09-24, so once that was more
than 24.8 days ago nodes_share_one_picture_under_one_number failed on
main. They are now dated noon yesterday.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phornstein phornstein added the correlation Correlation, track management label Oct 21, 2026
@phornstein
phornstein merged commit 00f6556 into main Oct 21, 2026
2 of 3 checks passed
@phornstein
phornstein deleted the fix/sync-report-time-range branch October 21, 2026 20:39
phornstein added a commit that referenced this pull request Oct 22, 2026
Follow-ups to #106 from review:
- Reports too far from now for the wire are left out before the sync
  byte budget is charged, so current reports are not deferred for bytes
  never sent.
- They are logged at most once a minute, with a count and a few tracks,
  so replaying old data does not flood the log.
- The engine tests' t0 is computed once per run, so a run across
  midnight UTC keeps one time.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

correlation Correlation, track management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant