Skip to content

fix(config): prevents settings reset on partial update#34

Merged
wgordon17 merged 4 commits intogordon-code:mainfrom
wgordon17:fix/settings-reset-on-change
Mar 30, 2026
Merged

fix(config): prevents settings reset on partial update#34
wgordon17 merged 4 commits intogordon-code:mainfrom
wgordon17:fix/settings-reset-on-change

Conversation

@wgordon17
Copy link
Copy Markdown
Member

Summary

  • Fixes updateConfig() resetting all settings to defaults when changing a single field
  • Zod v4's .partial().safeParse() inflates missing fields with .default() values — filters validated output to caller-provided keys only
  • Adds 4 regression tests, renames misleading test block, simplifies beforeEach

- merges split solid-js/store imports in test file
- trims redundant comment line in updateConfig
- adds empty-object regression test for updateConfig
- adds mixed valid/invalid field rejection test
Queries limit field from GraphQL rateLimit object and displays it dynamically in the footer. GitHub Enterprise Cloud orgs grant 10k pts/hr instead of the standard 5k, causing the old hardcoded display to show impossible values like 9000/5k/hr. Warning threshold is now proportional (< limit * 0.1) instead of hardcoded < 500. Adds safePositiveInt guard to reject 0/NaN/Infinity limit values with fallback to previous or 5000.
- inlines one-use keysProvided variable in updateConfig
- adds updateRateLimitFromHeaders unit tests (valid, missing, malformed header)
- adds safePositiveInt edge case tests (zero, negative limit fallback)
- documents resetConfig() safety outside reactive root
@wgordon17 wgordon17 merged commit f6af41a into gordon-code:main Mar 30, 2026
1 check passed
@wgordon17 wgordon17 deleted the fix/settings-reset-on-change branch April 8, 2026 17:00
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.

1 participant