๐ [fix] ์ ๊ธฐ๋ฅ ์์ญ ๋ฒ๊ทธ ์ผ๊ด ์์ โ ์ฝ๋๋ฒ ์ด์ค ์ ์ ์กฐ์ฌ ๊ฒฐ๊ณผ#181
Merged
Merged
Conversation
๋ฆฌ๋ทฐ์์ ํ๋นํ๋ค๊ณ ํ๋จํ ํญ๋ชฉ์ ํจ์นํ๋ค.
- AppEnvironment: isUnitTesting์ NSClassFromString("XCTestCase") fallback ์ ๊ฑฐ.
ํ
์คํธ ์คํด์ด IS_UNIT_TESTING=1์ ์ฃผ์
ํ๋ฏ๋ก ํ๊ฒฝ ๋ณ์๋ง์ผ๋ก ํ์ ํด ๋ฆด๋ฆฌ์ค
ํ
๋ ๋ฉํธ๋ฆฌ ๋ฌด๋ ฅํ/ํฅํ UI ํ
์คํธ ๋ถํ
์คํจ ๋ฆฌ์คํฌ๋ฅผ ์ฐจ๋จ.
- SafetySnapshotService: ํ
์คํธ ์ ์ฉ beforeApplyingSnapshot seam์ #if DEBUG๋ก
๊ฒฉ๋ฆฌ(production restore ์ฃฝ์ ์ฝ๋ ์ ๊ฑฐ). backup ์ ์ธ ์คํจ๋ฅผ Log.error๋ก ๋ณด๊ณ .
- CoreDataStorage: ๋๊ธฐํ ์์ ํ๋๊ทธ ์ ์ฅ์๋ฅผ ์ฃผ์
๊ฐ๋ฅํ userDefaults๋ก ๋ถ๋ฆฌํด
ํ
์คํธ๊ฐ .standard(์ค์ ์ฑ suite)๋ฅผ ์ค์ผ์ํค์ง ์๋๋ก ํจ. hasEverHadUserCollection
setter์ UserDefaults I/O๋ฅผ lock ์๊ณ์์ญ ๋ฐ์ผ๋ก ์ด๋. completeFirstImportWait์
timedOut/waiting ๊ฐฑ์ ์์๋ฅผ fail-safeํ๊ฒ ์กฐ์ ํด TOCTOU ์๋์ฐ ์ ๊ฑฐ.
- Log.Snapshot์ isFirstImportTimedOut ์ถ๊ฐ(Crashlytics ์ง๋จ ๊ณต๋ฐฑ ๋ณด์),
event/click์ isFirebaseConfigured ๊ฐ๋ ์คํ์ผ ํต์ผ.
- logSyncDiagnostics ํด๋ก์ owner ๋ค์ด๋ฐ/guard ๋ค ๋น ์ค, #if DEBUG ๋ฐ ํ
์คํธ helper
extension MARK ์ถ๊ฐ, ์ ๊ท ํ์ผ ์์ฑ์ ํค๋ ์ ๋ ฌ.
- ํ
์คํธ: ๊ฒฉ๋ฆฌ๋ UserDefaults suite ์ฃผ์
์ผ๋ก ์ ํํ๊ณ ์ ์ reset helper ์ ๊ฑฐ.
https://claude.ai/code/session_01L4kUZhiUNUtnr18SabrHzR
[review] PR #179 ๋ฆฌ๋ทฐ ์ฝ๋ฉํธ ๋ฐ์ โ ํ ์คํธ seam ๊ฒฉ๋ฆฌยท์ง๋จยท์ปจ๋ฒค์ ๋ณด๊ฐ
- cleanupOrphanedEntities๊ฐ ์ฒซ import ํ 120์ด grace period๋ฅผ ๋ฌด์ํ๊ณ ์ผ์์ orphan์ ์ญ์ ํ ์ ์๋ ๊ฒฝ๋ก ์ฐจ๋จ (isWithinGracePeriod ๊ฐ๋ ์ถ๊ฐ) - ์ฑ๊ณต import๋ก UC๊ฐ ๋ณต๊ตฌ๋๋ฉด recovery grace ํ์์คํฌํ๋ฅผ ์ ๋ฆฌํ๋ clearRecoveryInitiatedIfRecovered ์ฐ๊ฒฐ (๊ธฐ์กด clearRecoveryInitiated ๋ฐ๋ API ํด์) - ๋ฐ๋ณต sync ์คํจ๋ก ์ปฌ๋ ์ ์์ฑ์ด ์ต์ ๋ ๋ณดํธ ๋ชจ๋ ์ํ๋ฅผ ์ธ์ ๋น 1ํ Alert๋ก ์๋ด (isAwaitingCloudDataWithoutCollection + SceneDelegate.handleCloudSyncError) - CoreDataStorage ํ์ผ ๊ธธ์ด ํ๋ ์ด๊ณผ๋ก Data Recovery extension์ CoreDataStorage+Recovery.swift๋ก ๋ถ๋ฆฌ - ํ๊ท ํ ์คํธ 6๊ฐ ์ถ๊ฐ (์ด 19๊ฐ ํต๊ณผ) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
๋น๋์ SwiftLint autocorrect ๋จ๊ณ๊ฐ ์์ ํ unneeded_override ๋ฑ ๊ธฐ๊ณ์ ๋ณ๊ฒฝ. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
์ฝ๋๋ฒ ์ด์ค ์ ์ ์กฐ์ฌ์์ ๋ฐ๊ฒฌยท๊ฒ์ฆ๋ ๋ฒ๊ทธ ์์ : - Items.reset()์ด npcLike relay๋ฅผ ์ด๊ธฐํํ์ง ์์ ๋ฐ์ดํฐ ์ด๊ธฐํ ํ์๋ NPC ์ข์์ ๋ชฉ๋ก์ด ํ๋ฉด์ ๋จ๋ ๋ฌธ์ ์์ - NPCLikeEntity.toDomain()์ด genderAsia ๋์ gender๋ฅผ ์ฝ์ด CoreData ์๋ณต ์ genderAsia๊ฐ ์์ค๋๋ ๋งคํ ์ค๋ฅ ์์ - CloudKit ๋ถ๋ถ import๋ก DailyTask progressList๊ฐ amount๋ณด๋ค ์งง์์ง๋ฉด toggle ์ index out of range๋ก ํฌ๋์ํ๋ ๋ฌธ์ ์์ โ toDomain ์ ๊ทํ + ๋ชจ๋ธ/storage toggle ๊ธธ์ด ๋ณด์ (์๊ฐ ์น์ ) - MusicPlayerManager: block ๊ธฐ๋ฐ ๊ณก ์ข ๋ฃ ์ต์ ๋ฒ๊ฐ removeObserver(self)๋ก ์ ๊ฑฐ๋์ง ์์ ๋์ ๋ฑ๋ก๋๊ณ (์๋ ๋ค์ ๊ณก ๋ค์ค ์คํ), ํน์ AVPlayerItem์ ๋ฐ์ธ๋ฉ๋์ด ๊ณก ์ ํ ํ ์๋ฆผ์ ๋ชป ๋ฐ๋ ๋ฌธ์ ์์ โ ํ ํฐ ๋ณด๊ด + object nil + currentItem ๊ฒ์ฆ, ๋ฑ๋ก ์ง์ ์ player ์ฌ์์ฑ ์์ ์ผ๋ก ์ผ์ํ - MusicPlayerManager: ์ ๊ธํ๋ฉด ์ํธ์ํฌ ๋ค์ด๋ก๋๋ฅผ ๊ณก๋ณ disposeBag์ผ๋ก ๊ต์ฒดํด ์ด์ ๊ณก ์ด๋ฏธ์ง๊ฐ ๋ฆ๊ฒ ๋์ฐฉํด now playing ์ ๋ณด๋ฅผ ๋ฎ์ด์ฐ๋ ๋ฌธ์ ์์ - VillagersCellReactor/NPCCellReactor: updateLike/updateHouse ์ state๋ฅผ ๊ฐฑ์ ํ์ง ์์ ๋ชฉ๋ก ์ ์ ํํธ/์ง ๋ฒํผ์ด ์๊ฐ์ ์ผ๋ก ํ ๊ธ๋์ง ์๋ ๋ฌธ์ ์์ - SafetySnapshotService.pendingWorkItem์ OSAllocatedUnfairLock์ผ๋ก ๋ณดํธํ๊ณ flushNow๋ฅผ ์ ์ฉ queue ๋๊ธฐ ์คํ์ผ๋ก ๋ณ๊ฒฝ (๋ฉํฐ์ค๋ ๋ data race ํด์) - AppCoordinator: AnimalsCoordinator๋ง setUpParent ๋๋ฝ๋์ด ์๋ ๋น๋์นญ ์์ - DashboardCoordinator๊ฐ ์ฌ์ฉํ๋ "Unknown error" ๋ก์ปฌ๋ผ์ด์ ์ด์ ํค ์ถ๊ฐ (ko/en) - ํ๊ท ํ ์คํธ 2๊ฐ ์ถ๊ฐ (progressList ์์ ์๋๋ฆฌ์ค, ์ด 21๊ฐ ํต๊ณผ) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the โ๏ธ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
โจ Finishing Touches๐งช Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
์ถฉ๋ ํด๊ฒฐ: - CoreDataStorageICloudResetTests.swift: ์์ชฝ ํ ์คํธ ํฉ์งํฉ ์ ์ง (progressList ์์ ํ ์คํธ 2๊ฑด + sync protection ํ ์คํธ ์ ์ง) - docs/features/icloud-sync.md: SafetySnapshot ๋์์ฑ ๋ณดํธ ์ค๋ช ์ ์ง Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
๊ฐ์
์ฝ๋๋ฒ ์ด์ค ์ ์ฒด๋ฅผ ์ ์ ์กฐ์ฌ(๋ณ๋ ฌ ๋ฆฌ๋ทฐ ์์ด์ ํธ 4๊ฐ + ์๋ ์ฝ๋ ์ถ์ ๊ฒ์ฆ)ํ์ฌ ๋ฐ๊ฒฌํ ๋ฒ๊ทธ๋ค์ ์ผ๊ด ์์ ํฉ๋๋ค.
Base๊ฐ
codex/fix-icloud-sync-reset(#179)์ธ ์ด์ :SafetySnapshotService,CoreDataDailyTaskStorage๋ฑ #179์์ ๋ณ๊ฒฝ๋ ํ์ผ์ ํจ๊ป ์์ ํ๋ฏ๋ก ์ถฉ๋ ๋ฐฉ์ง๋ฅผ ์ํด #179 ์์ ์คํํ์ต๋๋ค. #179 ๋จธ์ง ํ ์๋์ผ๋ก develop์ผ๋ก retarget ๋ฉ๋๋ค.์์ ํ ๋ฒ๊ทธ (๊ฒ์ฆ ์๋ฃ)
Items.reset()npcLikerelay ์ด๊ธฐํ ๋๋ฝ โ ๋ฐ์ดํฐ ์ด๊ธฐํ ํ์๋ NPC ์ข์์๊ฐ ํ๋ฉด์ ์์กด, ์ดํ ํ ๊ธ ์ stale ๋ชฉ๋ก ๊ธฐ๋ฐ์ผ๋ก ์ ์ฅMusicPlayerManagerremoveObserver(self)๋ก ์ ๊ฑฐ๋์ง ์์choice()๋ง๋ค ๋์ โ ๊ณก ์ข ๋ฃ ์ ํธ๋ค๋ฌ ๋ค์ค ์คํ(fullRepeat์์ ๊ณก ๊ฑด๋๋). ๋ํ ํน์ AVPlayerItem์ ๋ฐ์ธ๋ฉ๋์ด ๊ณก ์ ํ ํ ์๋ฆผ ๋๋ฝ ๊ฐ๋ฅ. ํ ํฐ ๋ณด๊ด +object: nil+ currentItem ๊ฒ์ฆ์ผ๋ก ์์ , ๋ฑ๋ก ์ง์ ์ player ์ฌ์์ฑ ์์ ์ผ๋ก ์ผ์ํVillagersCellReactor/NPCCellReactorupdateLike/updateHouse๊ฐ state๋ฅผ ๊ฐฑ์ ํ์ง ์์ ๋ชฉ๋ก ์ ์ ํํธ/์ง ๋ฒํผ์ด ์๊ฐ์ ์ผ๋ก ํ ๊ธ๋์ง ์์ (์์ธ ํ๋ฉด reactor์๋ ์๋ ๋ก์ง์ด ์ reactor์ ๋๋ฝ)DailyTask/CoreDataDailyTaskStorage/ ๋งคํprogressList๊ฐamount๋ณด๋ค ์งง์ผ๋ฉด UI๋amount๊ธฐ์ค์ผ๋ก ์ ์ ๋ง๋ค์ด toggle ์ index out of range ํฌ๋์ (๋ฉ์ธ ์ค๋ ๋ + ๋ฐฑ๊ทธ๋ผ์ด๋ ์์ชฝ).toDomain()๊ธธ์ด ์ ๊ทํ + ๋ชจ๋ธ/storage toggle ๋ณด์ ์ผ๋ก ์์ (์์ ๋ฐ์ดํฐ ์๊ฐ ์น์ )SafetySnapshotServicependingWorkItem์ด CoreData ์ ์ฅ ์๋ฆผ(์์ ์ค๋ ๋)ยทmainยทsync-reset ์๋ฆผ์์ ๋๊ธฐํ ์์ด ์ ๊ทผ๋๋ data race โOSAllocatedUnfairLock๋ณดํธ +flushNow()์ ์ฉ queue ๋๊ธฐ ์คํ์ผ๋ก debounce ์ฐ๊ธฐ์ ํ์ผ I/O ์ง๋ ฌํNPCLikeEntity.toDomain()genderAsia์gender๊ฐ์ ์ฝ์ด CoreData ์๋ณต๋ง๋คgenderAsia์์คMusicPlayerManager.setUpBackground()AppCoordinatorAnimalsCoordinator๋งsetUpParent(to:)๋๋ฝ (latent โ ์์ ์ ๋ฆฌ ๊ฒฝ๋ก ๋ฌด๋ ฅํ)Localizable.stringsDashboardCoordinator๊ฐ ์ฌ์ฉํ๋"Unknown error"ํค๊ฐ ko/en ๋ชจ๋ ๋ถ์ฌ โ ์ถ๊ฐ์กฐ์ฌํ์ง๋ง ์์ ํ์ง ์์ ํญ๋ชฉ (์ฌ์ )
ํ ์คํธ
make testโCoreDataStorageICloudResetTests21๊ฐ ํต๊ณผ (progressList ์์ ํ๊ท ํ ์คํธ 2๊ฐ ์ ๊ท)swiftlintโ ์๋ฌ 0make validateโ ํต๊ณผ๐ค Generated with Claude Code