Open
Conversation
Logout no longer wipes user preferences (themes, font scale, toggles, etc.) - only session/auth keys (including imgur) are cleared. Settings now survive cookie expiration and manual logout. New Data Management section in Settings: - Clear Cache: now clears all caches (URLCache, Nuke disk/memory, WKWebView data, external stylesheet) and shows accurate size before and after clearing - Reset All Settings: restores preferences to defaults while staying logged in - Export Settings: saves preferences as a dated JSON file via share sheet - Import Settings: restores preferences from a previously exported JSON file, with warnings when importing from an older app build
- Preserve UserDefaults preferences on logout; only session/auth keys (userID, username, canSendPrivateMessages, imgur upload mode, last pasteboard URL) are cleared. - Stop wiping the Core Data store on logout. Cached forums, threads, and posts survive. Fixes a long-standing crash where logging in again after logout hit "persistent store is not reachable" — ForumsClient's background MOC retained objects tied to the deleted store and the next save-notification merge blew up. - Drop the "Logging out erases..." footer; logout is just logout now. Clear Cache (Settings): - New Data Management section with Clear Cache and Reset All Settings. - Clear Cache now wipes URLCache, Nuke disk/memory, WKWebView data, the external stylesheet cache, AND the Core Data store, and reports accurate size before/after. - Store-size estimate includes the Core Data store directory. - Avoids the stale-MOC crash by cycling ForumsClient.shared.managedObjectContext around the store reset. - DataStoreWillReset / DataStoreDidReset promoted to public Notification.Name extensions on AwfulCore. All FRC owners (ThreadListDataSource, ForumListDataSource, MessageListDataSource, ForumSpecificThemesViewController) now observe .dataStoreDidReset and re-fetch so their caches stop pointing at dangling objectIDs. - SettingsViewController rebuilds its currentUser header on reset so re-render doesn't fault the invalidated User. - RootViewControllerStack observes reset too: dismisses any modal (compose sheet, etc.) and pops every tab's nav stack plus the split view's detail nav back to root, so pushed detail VCs (PostsPageViewController, PrivateMessageViewController, profile, etc.) can't crash trying to render stale managed objects. Reset All Settings: - Restores preferences to defaults while staying logged in. Keys are removed individually (not via setPersistentDomain) so KVO fires and @AppStorage observers update immediately. Also: - Fix: AppDelegate.calculateCacheSize() offloaded to a detached utility Task so file enumeration doesn't stall the main thread when Settings appears; directorySize(at:) marked nonisolated. - Expose DataStore.storeDirectoryURL publicly so AppDelegate can size it.
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.
(This branch originally had option to export settings, but not really needed so removed)