Skip to content

fix(desktop): make the performance-pressure prompt idempotent per label#4434

Merged
esengine merged 1 commit into
main-v2from
fix/perf-prompt-idempotent
Jun 15, 2026
Merged

fix(desktop): make the performance-pressure prompt idempotent per label#4434
esengine merged 1 commit into
main-v2from
fix/perf-prompt-idempotent

Conversation

@esengine

@esengine esengine commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Problem

The performance-pressure report prompt (performance.lag / performance.longtask / performance.heap) kept re-appearing for users on a persistent slowdown. The only gate was a 10-minute time cooldown — so a steady event-loop lag or recurring long task re-tripped the threshold every cooldown window and the prompt popped again, even after the user had already reported the exact same issue. The dashboard already de-dupes by stable label, so these repeat client reports add no signal — just annoyance.

Fix

Make the prompt idempotent per pressure label:

  • Once a label is reported (Send), record it in localStorage, scoped to the current build commit, and never re-prompt that label again on this build. A new build can re-surface the issue once (still useful telemetry; if the build fixed it, no prompt at all).
  • Once a label is dismissed, suppress it for the rest of the session (in-memory).
  • The existing 10-minute cooldown and hidden-window guards stay as fallbacks for not-yet-handled labels.

All storage access is guarded (typeof localStorage, try/catch) so the crash surface keeps working in private-mode / quota / non-DOM contexts.

Notes

The decision and persistence logic are extracted into pure, exported functions (shouldPromptForPerformanceLabel, parseReportedPerf, serializeReportedPerf) and unit-tested in crash-reporting.test.ts (suppression, cooldown, hidden-skip, build-scoped round-trip, corrupt/missing storage).

Verification

  • pnpm exec tsx src/__tests__/crash-reporting.test.ts — 28 passed
  • pnpm typecheck — clean

A steady slowdown re-tripped the lag/long-task threshold every cooldown
window, so the report prompt kept reappearing even after the user already
reported it. Suppress a pressure label once it is reported (persisted per
build so a new build can re-surface it once) or dismissed (session only),
keeping the existing cooldown and hidden-window guards as fallbacks.
@esengine esengine requested a review from SivanCola as a code owner June 15, 2026 03:52
@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 15, 2026
@esengine esengine merged commit a15c0b9 into main-v2 Jun 15, 2026
15 checks passed
@esengine esengine deleted the fix/perf-prompt-idempotent branch June 15, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant