fix: 배포 후 SW 캐시 미정리로 인한 접속 불가 수정#263
Merged
Merged
Conversation
배포 후 chunk load error 발생 시 clearCachesAndReload()에서 SW unregister/cache delete의 Promise를 await하지 않아 캐시 정리 완료 전에 리로드가 실행되는 버그 수정. - hooks.client.ts: async/await로 순차 실행 보장 - sw.js: SKIP_WAITING 메시지 핸들러 추가 사용자가 수동 캐시 삭제 없이 배너 새로고침 버튼으로 복구 가능. Ref: https://damoang.net/free/5900985 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sdk-kr
pushed a commit
that referenced
this pull request
Mar 6, 2026
## Summary - #263 (`ed96314`) 커밋 revert - 해당 변경으로 인해 무한 새로고침이 발생하는 문제 확인 ## Reverted commit - `ed96314` fix: 배포 후 SW 캐시 미정리로 인한 접속 불가 수정 (#263) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sdk-kr
pushed a commit
that referenced
this pull request
Mar 7, 2026
## Summary - 배포 후 "새로고침하면 된다" 메시지만 나오고 접속 불가한 문제 수정 - SW unregister/cache delete Promise를 await하지 않아 캐시 정리 전에 리로드되는 버그 ## 원인 `clearCachesAndReload()`에서 `forEach`로 `unregister()`와 `caches.delete()`를 호출하면서 반환된 Promise를 무시. 캐시 정리가 완료되기 전에 `location.replace()`가 실행되어 이전 SW가 여전히 stale 캐시를 제공. ## 변경 내역 - `hooks.client.ts`: `async/await`로 SW 해제 → 캐시 삭제 → 리로드 순차 보장 - `sw.js`: `SKIP_WAITING` 메시지 핸들러 추가 (대기 중인 새 SW 즉시 활성화) ## 사용자 영향 - Before: 수동으로 브라우저 캐시 전체 삭제 필요 - After: 배너의 "새로고침" 버튼 한 번으로 복구 Ref: https://damoang.net/free/5900985 ## Test plan - [ ] 배포 후 기존 SW 캐시가 남아있는 상태에서 chunk error 발생 시 자동 복구 확인 - [ ] 배너 새로고침 버튼 클릭 시 정상 로딩 확인 - [ ] 새 SW 대기 중일 때 SKIP_WAITING으로 즉시 활성화 확인 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
sdk-kr
pushed a commit
that referenced
this pull request
Mar 7, 2026
## Summary - #263 (`c6ed450`) 커밋 revert - 해당 변경으로 인해 무한 새로고침이 발생하는 문제 확인 ## Reverted commit - `c6ed450` fix: 배포 후 SW 캐시 미정리로 인한 접속 불가 수정 (#263) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
원인
clearCachesAndReload()에서forEach로unregister()와caches.delete()를 호출하면서 반환된 Promise를 무시. 캐시 정리가 완료되기 전에location.replace()가 실행되어 이전 SW가 여전히 stale 캐시를 제공.변경 내역
hooks.client.ts:async/await로 SW 해제 → 캐시 삭제 → 리로드 순차 보장sw.js:SKIP_WAITING메시지 핸들러 추가 (대기 중인 새 SW 즉시 활성화)사용자 영향
Ref: https://damoang.net/free/5900985
Test plan
🤖 Generated with Claude Code