Skip to content

fix(config): preserve settings across saves and account sync - #2701

Merged
bobleer merged 1 commit into
GCWing:1.0.0-explorefrom
bobleer:bob/fix-config-persistence-sync
Aug 31, 2026
Merged

fix(config): preserve settings across saves and account sync#2701
bobleer merged 1 commit into
GCWing:1.0.0-explorefrom
bobleer:bob/fix-config-persistence-sync

Conversation

@bobleer

@bobleer bobleer commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix settings loss across local saves, account synchronization, and backup restoration. A saved realtime voice API key could disappear when an older or unconfigured account snapshot replaced local settings. The same paths also exposed other settings and model credentials to stale read/write races.

  • Preserve locally configured fixed fields omitted by older imports, and preserve a configured realtime voice key when account sync supplies an empty key. Explicit clears, resets, deleted list/map entries, and legacy migrations retain their intended behavior.
  • Commit in-memory state only after persistence succeeds. Keep configuration read/modify/write operations under one lock, retain the storage root on reload, and give backups unique names with a pre-import recovery copy.
  • Subscribe account sync to successful local configuration changes and reject a fetched cloud snapshot if local settings changed during the request. Cloud imports do not echo a local-change notification.
  • Remove write-on-read model migration, serialize fresh-value frontend edits, and save only edited AI experience fields. Treat import failures as failures and keep an explicitly empty quick-action list empty.

Type and Areas

Bug fix / regression fix. Rust configuration services and account sync, Desktop adapters, Web UI settings, regression tests, and compatibility documentation.

Motivation / Impact

Saving another setting, restarting, restoring an older backup, or receiving a delayed sync response must not silently discard unrelated settings or credentials. This also prevents failed disk writes from being committed by a later successful save and prevents concurrent model changes from losing or resurrecting entries.

Verification

GitHub CI passed on PR head 4698bfc9232f82010983b76b1b1754bf0ffb8d92: 10 successful checks, with only the 2 unrelated packaging jobs skipped by the existing impact classifier. Rust/CLI checks passed on Linux, macOS, and Windows. The full Web UI suite passed all 4,286 tests across 591 files, and frontend build/governance checks passed. No CI rules were weakened and no reruns were needed.

Passed locally before rebasing onto the latest target branch; the intervening upstream commit changes unrelated Write-tool code. Rust commands used an isolated temporary Cargo target directory, and tests used synthetic temporary settings rather than the user's configuration.

  • cargo test -p bitfun-core --no-default-features --lib service::config:: --quiet — 120 passed.
  • cargo test -p bitfun-core --no-default-features --features remote-connect --lib service::config:: --quiet — 131 passed.
  • cargo test -p bitfun-core --no-default-features --features remote-connect --lib service::remote_connect::settings_sync::tests --quiet — 4 passed.
  • The focused frontend command below — 103 passed across 7 files.
  • pnpm run check:web — passed.
  • cargo test -p bitfun-desktop --lib api::config_api::tests --quiet — passed.
  • cargo check -p bitfun-desktop --quiet and cargo build -p bitfun-desktop --bin bitfun-desktop --quiet — passed.
  • pnpm run fmt:rs and git diff --check — passed.

After rebasing, the remote-connect configuration suite was rerun on the PR commit (131 passed), and pnpm run lint:web passed with no errors.

pnpm --dir src/web-ui run test:run \
  src/infrastructure/config/services/ConfigManager.test.ts \
  src/infrastructure/config/services/AIExperienceConfigService.test.ts \
  src/infrastructure/config/services/modelConfigs.test.ts \
  src/infrastructure/api/service-api/ConfigAPI.test.ts \
  src/app/services/agentCompanionPetCommands.test.ts \
  src/infrastructure/api/adapters/peer-device-adapter.test.ts \
  src/flow_chat/components/modern/SessionFilesBadge.test.tsx

Reviewer Notes

  • AI-assisted with Codex. Testing level: focused automated regression tests and native build completed; manual UI and remote end-to-end testing were not performed.
  • Remote coverage is limited to shared configuration/sync logic and Peer adapter contracts. Remote workspace, remote control, Peer Device Mode, and Detached Dispatch were not exercised on real devices.
  • The Windows desktop library test binary hit the existing Tauri #13419 loader limitation before running tests. The repository's unchanged probe handled that known signature; Windows compilation, core/CLI tests, and portable contracts passed. Linux/macOS desktop library suites ran successfully.
  • No new host RPC or persisted schema requirement is introduced. Missing fixed fields and explicit deletion/reset payloads have separate regression coverage; supplied dynamic maps and arrays remain authoritative.
  • No visual layout changes. A rebuilt Rust backend is required to exercise the persistence and sync fixes.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 5c4de99 into GCWing:1.0.0-explore Aug 31, 2026
12 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.

1 participant