Skip to content

Update notice: show it on an open board when the check lands, re-check daily (T326) - #266

Merged
smarzban merged 5 commits into
mainfrom
tsk/t326-update-notice-show-it-on-an
Oct 22, 2026
Merged

smarzban merged 5 commits into
mainfrom
tsk/t326-update-notice-show-it-on-an

Conversation

@smarzban

Copy link
Copy Markdown
Owner

T326. A board learned of a new release silently: the background check only wrote update.json, and the notice was read once at open. A board left open for days never checked again.

What changed

  • update::UpdateCheck replaces startup(). It reads the cached notice at open and starts at most one background check when the cache is 24 h old. The fetch thread writes the cache and flags the landing (a Drop guard, so a panic also lands).
  • BoardModel::poll_update_check runs in board_frame's settle step beside the other background polls. It shows a landed result and re-plans once due_at (last check + 24 h) passes. Single flight: in-process in_flight flag plus the existing mark_check_started stamp across processes. No blocking I/O on the UI thread; the cache is read only when due or landed.
  • set_update_notice also writes the right seat, so wide split stays in sync.
  • Brief discrepancy: quick capture did check before this change (startup() sat outside the full_board_open gate in load_board_inner). It is gated now; quick_capture_and_the_cli_never_check fails without the gate.
  • Unchanged: TSK_NO_UPDATE_CHECK, silent failures, releases/latest, status message wins the slot.
  • Docs: storage.md Update check; CHANGELOG Unreleased → Fixed.

Tests (each fails with its fix hunk reverted by hand)

Test Revert that fails it
a_finished_background_check_reaches_an_open_board_without_a_restart drop poll_update_check() from board_frame
an_open_board_checks_again_once_a_day_with_one_check_in_flight drop the in_flight guard; or never re-plan
opt_out_suppresses_the_open_board_check_and_its_notice drop the opt_out() check in poll
quick_capture_and_the_cli_never_check ungate the check from full_board_open
an_update_notice_that_lands_with_a_preview_open_reaches_the_right_seat (lib) drop the right-seat write

Live proof (Herdr, isolated state)

TSK_STATE_DIR=<scratch> only (the brief's TSK_CONFIG_DIR does not exist in src/; config lives in the state dir). update.json seeded {"last_check_unix":1,"latest":"v0.13.0"}. TSK_UPDATE_CURL = stub that sleeps 8 s then prints {"tag_name":"v99.0.0"}. Release build of this branch.

At open:

─────────────────────────────────────────────────────────
 tsk-t326-update-notice-show-it-on-an
 : commands · ? help

About 8 s later, same process (pid 68592, elapsed 00:09, no restart):

─────────────────────────────────────────────────────────
 v99.0.0 available, run tsk update
 : commands · ? help

Not driven live: the 24 h re-check (covered by the time-injected test) and wide split (unit test only).

Checks

cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test green; cargo clippy --all-targets --target x86_64-pc-windows-gnu -- -D warnings green.

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
herdr-tsk Ignored Ignored Preview Oct 22, 2026 12:32pm UTC

@smarzban
smarzban merged commit 5109a61 into main Oct 22, 2026
8 checks passed
@smarzban
smarzban deleted the tsk/t326-update-notice-show-it-on-an branch October 22, 2026 12:42
smarzban added a commit that referenced this pull request Oct 22, 2026
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