Skip to content

fix: prevent save status indicator from persisting on note switch#102

Merged
j4rviscmd merged 2 commits intomainfrom
fix/save-status-stuck
Mar 28, 2026
Merged

fix: prevent save status indicator from persisting on note switch#102
j4rviscmd merged 2 commits intomainfrom
fix/save-status-stuck

Conversation

@j4rviscmd
Copy link
Copy Markdown
Owner

Summary

  • Remove isTimerActiveRef guard that caused a deadlock when save status transitioned from 'saved' to 'idle' during note navigation
  • The timer was cleared via clearTimeout but the ref was never reset, leaving the checkmark icon visible indefinitely
  • Add cleanup function to clear timer on component unmount

Root Cause

In SaveStatusIndicator.tsx, when status changed from 'saved''idle' (note switch):

  1. clearTimeout() killed the 3-second timer
  2. isTimerActiveRef.current remained true (never reset since timer callback never fires)
  3. setDisplay(null) was guarded by !isTimerActiveRef.current, creating a deadlock
  4. The checkmark stayed visible forever

Fix

  • Remove isTimerActiveRef entirely
  • Always set display to null when status === 'idle'
  • Add useEffect cleanup function to clear timer on unmount

Test plan

  • Edit a note and wait for the auto-save checkmark to appear
  • Switch to another note while the checkmark is visible
  • Verify the checkmark disappears immediately on note switch
  • Verify the checkmark still shows normally when editing and saving

🤖 Generated with Claude Code

Remove isTimerActiveRef guard that caused a deadlock when status
transitioned from 'saved' to 'idle' during note navigation — the
timer was cleared but the ref was never reset, leaving the checkmark
visible indefinitely. Add cleanup function to clear timer on unmount.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@j4rviscmd j4rviscmd added the bug Something isn't working label Mar 28, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@j4rviscmd j4rviscmd merged commit 3ec39c8 into main Mar 28, 2026
2 checks passed
@j4rviscmd j4rviscmd deleted the fix/save-status-stuck branch March 28, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant