Skip to content

feat: auto-merge built-in service updates on config load#14

Merged
GeiserX merged 1 commit intomainfrom
fix/merge-builtin-services
Feb 28, 2026
Merged

feat: auto-merge built-in service updates on config load#14
GeiserX merged 1 commit intomainfrom
fix/merge-builtin-services

Conversation

@GeiserX
Copy link
Owner

@GeiserX GeiserX commented Feb 28, 2026

Summary

  • On startup, mergeBuiltInServices() reconciles the user's saved config with the latest defaultServices definitions
  • Domains, IP ranges, and service names are always taken from the source code
  • User's enabled/disabled preferences are preserved
  • New services added in future releases appear automatically
  • Config is only re-saved when changes are detected (no unnecessary writes)

How it works

  1. After loading config.json, builds a lookup of saved services by id
  2. Walks defaultServices in order (preserving source code ordering)
  3. For each built-in service:
    • If it exists in saved config: takes enabled from saved, everything else from built-in
    • If it's new: adds it with defaults (enabled: false)
  4. Appends any non-default services from saved config (forward compatibility)
  5. Logs what changed and saves only if the merge produced differences

Test plan

  • Fresh install: no config.json exists, app uses defaults — no merge needed
  • Existing install with old OpenAI domains: after upgrade, OpenAI service should have all ~30 new domains while preserving enabled/disabled state
  • Enable some services, upgrade, verify they remain enabled with updated domains
  • New service added to source code appears in existing user's service list
  • Config.json is only rewritten when actual changes are detected
  • Export/import still works correctly

Closes #13

On startup, mergeBuiltInServices() now reconciles the user's saved
config with the latest defaultServices definitions. Domains, IP ranges,
and service names are always taken from the source code while the user's
enabled/disabled preferences are preserved. New services added in future
releases appear automatically.

Closes #13
@GeiserX GeiserX merged commit dcb6f44 into main Feb 28, 2026
3 checks passed
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]: Adding new domains to the source code does not update the app

1 participant