Skip to content

fix(sidebar): cancel fallback timer on unmount and add unmount test#662

Merged
Kewton merged 1 commit intodevelopfrom
feature/651-worktree
Apr 14, 2026
Merged

fix(sidebar): cancel fallback timer on unmount and add unmount test#662
Kewton merged 1 commit intodevelopfrom
feature/651-worktree

Conversation

@Kewton
Copy link
Copy Markdown
Owner

@Kewton Kewton commented Apr 14, 2026

Summary

  • アンマウント時にフォールバックタイマーをキャンセルする useEffect クリーンアップを追加
  • コンポーネントがアンマウントされた後に stale なタイマーが発火して意図しないフルページリロードが起きるケースを防止
  • アンマウント時にタイマーがキャンセルされることを検証するユニットテストを追加

Test plan

  • npm run test:unit が全テストパス
  • サイドバーのブランチクリック後のページリロードが発生しない

🤖 Generated with Claude Code

Add useEffect cleanup to clear the fallback navigation timer when the
Sidebar component unmounts, preventing a stale timer from firing after
the component is gone and triggering an unexpected full-page reload.

Also adds a unit test that verifies the timer is cancelled on unmount.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Kewton Kewton merged commit 4f41707 into develop Apr 14, 2026
5 checks passed
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