Skip to content

fix: preserve defaulted settings on partial updates#26

Open
itzptk wants to merge 1 commit into
mainfrom
fix/issue-25-settings-update-defaults-20260605014629
Open

fix: preserve defaulted settings on partial updates#26
itzptk wants to merge 1 commit into
mainfrom
fix/issue-25-settings-update-defaults-20260605014629

Conversation

@itzptk

@itzptk itzptk commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Split app settings validation into shared field definitions so the full settings schema keeps defaults, while partial update parsing leaves omitted fields omitted.
  • Added a regression test proving non-default defaulted settings survive a partial update that only changes checkIntervalMinutes.

Closes #25

Verification

  • node_modules/.bin/tsx -e "import { appSettingsUpdateSchema } from './src/shared/contracts.ts'; console.log(JSON.stringify(appSettingsUpdateSchema.parse({ checkIntervalMinutes: 60 })))"{"checkIntervalMinutes":60}
  • npm run test:node -- settings-store → 5 tests passed
  • ELECTRON_OVERRIDE_DIST_PATH=/tmp npm run test:node → 15 files / 117 tests passed
  • npm run build → Angular production build and tsup Electron build succeeded

Notes

  • Initial full npm run test:node without ELECTRON_OVERRIDE_DIST_PATH was blocked by the local npm install not writing node_modules/electron/path.txt; using the override avoids Electron binary resolution for unit tests that do not launch Electron.

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.

Keep settings updates from resetting defaulted fields

1 participant