Skip to content

fix: persist refresh interval to UserDefaults on first launch#519

Open
Astro-Han wants to merge 1 commit intosteipete:mainfrom
Astro-Han:fix/persist-refresh-frequency
Open

fix: persist refresh interval to UserDefaults on first launch#519
Astro-Han wants to merge 1 commit intosteipete:mainfrom
Astro-Han:fix/persist-refresh-frequency

Conversation

@Astro-Han
Copy link
Contributor

Summary

  • Write the resolved refreshFrequency value to UserDefaults when the key is absent or contains an unrecognized raw value, matching the pattern used by sessionQuotaNotificationsEnabled and other settings
  • Add test coverage for both the first-launch write-back and invalid raw value repair scenarios

Closes #506

Test plan

  • swift build passes
  • swift test — all SettingsStore tests pass (923 total, 7 pre-existing OAuth/keychain environment failures unrelated to this change)
  • Manual: launch CodexBar, verify defaults read com.steipete.codexbar | grep refreshFrequency shows the key
  • Manual: change refresh cadence in Settings, quit and relaunch, verify the setting persists

Write the resolved refreshFrequency value to UserDefaults when the key
is absent or contains an unrecognized raw value, matching the pattern
used by sessionQuotaNotificationsEnabled and other settings. This
ensures the key appears in the plist from the very first run and
survives app restarts.
@Astro-Han Astro-Han force-pushed the fix/persist-refresh-frequency branch from 6fec72b to 383da85 Compare March 17, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Refresh interval setting not persisted to UserDefaults (resets to default on every launch)

1 participant