Skip to content

fix: recover invalid persisted settings#36

Open
itzptk wants to merge 1 commit into
mainfrom
fix/issue-12-invalid-settings-startup-20260605162553
Open

fix: recover invalid persisted settings#36
itzptk wants to merge 1 commit into
mainfrom
fix/issue-12-invalid-settings-startup-20260605162553

Conversation

@itzptk

@itzptk itzptk commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Recover invalid persisted settings by repairing bad fields back to defaults instead of throwing during startup reads.
  • Preserve valid persisted values and existing missing-key legacy repair behavior.
  • Persist the repaired settings payload after recovery.

Fixes #12

Verification

  • RED before fix: npm run test:node -- electron/services/settings-store.test.ts -t "repairs invalid persisted setting values" failed with a ZodError for checkIntervalMinutes: 30 at SettingsStore.getSettings.
  • GREEN focused: npm run test:node -- electron/services/settings-store.test.ts -t "repairs invalid persisted setting values" passed.
  • npm run test:node -- electron/services/settings-store.test.ts passed: 5 tests / 1 file.
  • npx vitest run --exclude electron/services/background-scheduler.test.ts passed: 110 tests / 14 files.
  • npm run build passed: Angular production build plus Electron tsup build.

Local verification note

  • npm run test:node was attempted but the local fresh npm ci install left node_modules/electron/path.txt missing because npm blocked Electron install scripts; the unrelated background-scheduler.test.ts suite could not import Electron. The targeted settings-store suite and the remaining Node/Electron suites passed as listed above.

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.

Recover from invalid persisted settings at startup

1 participant