Repository navigation
fix(ios): keep the fresh-install directory layout on clear-app-state - #3198
Conversation
…tate Clearing removed Documents, Library/Caches, Library/Preferences, SystemData, and tmp themselves. iOS does not recreate tmp on relaunch, so every URLSession download task failed until the app was reinstalled. Recreate the directories a fresh install has, empty, after clearing.
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
The PR is ready at 528b66e. The code keeps the fresh-install directory layout on clear-app-state as intended, and I found no problems in the change. Not blocking: the directory list in app-settings.ts matches the iOS 26.5 layout, so a short note in the commands.md sentence or the constant's comment would say so, since older runtimes and tvOS or visionOS simulators could differ. Extra empty directories are harmless because the old code already wiped those containers. You can take this or leave it. The Cubic P2 thread on the tvOS and visionOS guard still applies, but it is the same documentation caveat and not a defect (#3198 (comment)). The Cubic P3 thread on non-atomic mkdir does not apply, so please resolve it: a mkdir failure surfaces as an error, and a rerun converges to the full layout (#3198 (comment)). The one reported check passed, and it covers the route this diff touches (clearIosSimulatorAppState and its unit test). I did not run the unit test or any simulator. The regression claim comes from reading the diff. The iOS 26.5 live validation and the claim that asset downloads fail on main come from the PR body. I did not check the layout on other iOS runtimes, tvOS or visionOS. No conflicts are known, and nothing else must happen before merge. |
The recreated directory list was checked against an iOS 26.5 fresh install. Older runtimes and tvOS or visionOS simulators may differ; an extra empty directory there is harmless.
|
Added the note in 3791616: the comment on |
|
I re-reviewed this PR at 3791616 and found no code problems. Since the earlier review at 528b66e, the new commit changes comments and docs only, so the code I reviewed before still stands. The one check reported on this head passes, and there are no conflicts. I did not check the iOS 26.5 layout claim on a live simulator, and I did not individually verify the two resolved threads. The delta does not touch their code. Nothing else must happen before merge. |
Summary
Follow-up to #3156. On an iOS simulator,
settings clear-app-stateremoves the data container's top-level directories, not just their contents. On relaunch iOS recreatesDocumentsandLibrary, but nottmporSystemData. Withouttmp, everyURLSessiondownload task fails until the app is reinstalled. We hit it as Expo's asset loader failing to fetch fonts (UnableToDownloadAssetException) afterapp.clearState(), while plain data requests kept working.After clearing, the container now gets back the directories a fresh install has (
Documents,Library/Caches,Library/Preferences,SystemData,tmp), empty. 3 files: the fix, its unit test, and the commands doc.Validation
528b66ee9:pnpm check:affected --runpasses. The extendedapp-settings.test.tscase fails on main.settings clear-app-state <bundle>and a relaunch:Documents,Library/{Caches,Preferences},SystemData,tmptmporSystemData; asset downloads fail