fix: 위젯 삭제된 키링이 위젯 리스트에 있는 현상 수정 & 키링 정렬 추가#37
Merged
Conversation
- AvailableKerying -> WidgetKeyring (네이밍이 너무 안좋아서 수정) - 위 변화에 따른 전역적인 수정 - 위젯편집에서 기존 오래된순 -> 최신순 정렬
- WidgetKeyring에 createdAt 필드 추가 및 최신순 정렬 적용 - 기존 데이터 호환을 위한 backward-compatible 디코더 구현 - 삭제된 키링 캐시 정리 및 createdAt 누락 데이터 마이그레이션 - UserDefaults 버전 체크로 마이그레이션 1회만 진행하는 방식임!
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.
🎯 PR 내용
1. 삭제된 키링이 위젯 편집 목록에 남아있던 버그 수정
원인 :
아주 오래 전(언제인진 모르겠다.)
키링 삭제 시, 위젯용 캐시(JSON)가 정리되지 않았던거로 파악됨.
왜냐면 지금 삭제하면 캐시가 잘 지워지기 때문에.
해결 (중요) :
이건, 기존 유저들을 위해 새로운 로직이 필요한 부분이다.
그래서 보관함 최초 접근 시에 실제 보유 키링과 캐시를 비교하여 정리해주는
마이그레이션 메서드를 집어넣었다.
위젯 키링 목록 최신순 정렬 적용
위젯 관련 네이밍 개선 (AvailableKeyring → WidgetKeyring)
최신순 정렬에서 헤맨 부분
기존
WidgetKeyring모델에는createdAt필드가 없었음[단순히 필드 추가하면?]
[해결 1] backward-compatible 디코더 추가
[해결 2] 마이그레이션 추가
[추가 고려] 근데 마이그레이션으로 해결했는데 왜 디코더를 유지해야 하나?
📱 스크린샷 (UI 변경 시)
🔗 관련 이슈
✅ 체크리스트