Skip to content

Invalidate dashboard cache when leaving git/release menus#12

Merged
MCamner merged 2 commits into
mainfrom
perf/invalidate-cache-on-mutating-back
Jun 21, 2026
Merged

Invalidate dashboard cache when leaving git/release menus#12
MCamner merged 2 commits into
mainfrom
perf/invalidate-cache-on-mutating-back

Conversation

@MCamner

@MCamner MCamner commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Follow-up to #11

The dashboard header cache reuses a render for up to MQ_DASHBOARD_CACHE_TTL (5s). The git and release menus can commit/stash/tag, so returning to the main loop could show a stale Dirty (N) header until the TTL expired — the one correctness gap the cache left open.

Fix

Call mq_dashboard_cache_invalidate at the end of open_git_menu and open_release_menu, so the next print_header re-renders fresh Git status immediately on Back. Non-mutating menus keep relying on the TTL (no churn cost added).

Guarded with command -v so it's a no-op if the UI helper isn't sourced.

Verification

  • tests/dashboard-header-cache-smoke.sh extended: asserts both menus wire the invalidation on return.
  • zsh -n clean on mqlaunch.sh; full selftest green; shell lint 108 files.

🤖 Generated with Claude Code

MCamner and others added 2 commits June 21, 2026 03:57
The dashboard header cache (#11) reuses a render for up to 5s. The git
and release menus can commit/stash/tag, so returning to the main loop
could show a stale "Dirty (N)" header until the TTL expired.

Invalidate the cache at the end of open_git_menu and open_release_menu
so the next header re-renders fresh Git status immediately. Other,
non-mutating menus keep relying on the TTL.

Smoke test asserts both menus wire the invalidation on return.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MCamner MCamner merged commit 543af9d into main Jun 21, 2026
1 check passed
@MCamner MCamner deleted the perf/invalidate-cache-on-mutating-back branch June 21, 2026 08:03
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