Skip to content

fix(native): keep unread sticky after seen snapshots - #258

Merged
rynfar merged 1 commit into
nativefrom
nw/228-sticky-watermark
Nov 5, 2026
Merged

rynfar merged 1 commit into
nativefrom
nw/228-sticky-watermark

Conversation

@rynfar

@rynfar rynfar commented Nov 5, 2026

Copy link
Copy Markdown
Owner

An authoritative already-seen shell could advance beyond the native tracker's last dispatched watermark. Marking that thread unread then sent another visit for the same activity, clearing the unread state. The same failure occurred after an intervening older snapshot.

Port the already-seen branch from packages/client-runtime/src/state/threadVisits.ts: remember the greatest effective watermark before skipping, including wake timestamps. Keep the actual dispatch clock independent so observing a seen snapshot does not reset the throttle. Only crates/core/src/sidebar/visits.rs and the TV-WATERMARK ledger row change.

Verification:

  • Compiled failing-first proof extends the existing core throttle case. Before the fix, both direct rewind and rewind after an older snapshot returned Now { visited_at: 20, opened: false } instead of Skip (exit 101). Exact production/test hashes, source patches, executable hashes and raw logs are retained.
  • The identical test bytes pass with the fix, covering ordinary and wake watermarks, older snapshots, pending-fire dedupe, original throttle deadlines, and genuinely newer activity. Existing immediate completion/wake behavior also passes.
  • Strict workspace clippy, workspace tests, theme drift, 42 parity tests and conformance generation pass. Normal and explicit private snapshot builds pass.
  • Local evidence: /private/tmp/native-factory-2f5f764a/228-worker/ (immutable manifests, patches, argv/cwd/start/end/exit receipts, raw logs and hashes). Build-time HEAD is the base f5c06fd955a9c8a9d0baa050b4a6299ad3be554d; manifests bind the compiled working bytes to this PR. No claim that the later published commit existed at build time.
  • One generic offscreen integration smoke: /private/tmp/native-factory-2f5f764a/228-worker/integration-smoke.png. This is not a bug reproduction. Known native: investigate missing cached text in offscreen captures #202 glyph loss remains separate; no full-frame legibility, production performance, live persistence, relay or grants claim.
  • All 130 other ledger rows, UPSTREAM and surrounding ledger bytes are preserved. Whole-ledger formatting is RED on both baseline/current; check:changed is not green and no repo-wide fallback was run. The formatting commit hook is bypassed to avoid rewriting unowned ledger rows; focused native gates and git diff --check provide validation.

TV-WATERMARK remains partial, and #228 remains open: native still lacks ten-minute environment/thread open dedupe and local-recents behavior. This PR implements only the already-seen sticky-watermark slice. No app/controller/snapshot, dependency, web, mobile, server or contract changes. No new entry point or wire behavior; the existing native tracker handles its existing callers. No user guidance changes are needed for this internal parity correction.

Built with GPT-6.1 Sol in Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant