Skip to content

Save Button Disappears and Directory Is Saved Unexpectedly - cc-switch

Quick fix

Make autosave submit only persisted directory values and preserve unsaved directory drafts during settings refreshes and concurrent saves.

Error output
The successful mutation refetch makes the path look saved and removes its **Save** button, even though the directory-specific Save flow was never invoked.

`useSettings.autoSaveSettings()` puts the entire draft form into the payload submitted to `settingsApi.save()`. Therefore, toggling an unrelated preference such as `Show profile switcher` also writes a configuration directory whose **Save** button has not been clicked.

The refetch after a successful save makes the new path appear saved and removes the **Save** button. Resetting an existing override to its default has the same problem: the next autosave of an unrelated preference deletes the persisted override.

  1. Change the immediate autosave logic so its payload uses persisted values for configuration directories instead of the current unsaved draft values.

  2. Preserve dirty configuration-directory drafts after query refreshes so a successful mutation's refetch does not incorrectly treat them as saved.

  3. Handle overlapping directory Save and preference toggle operations, and cover all eight directory fields, repeated autosaves, explicit Save, reset to defaults, cancel or revert, save or refetch failures, and interrupted Save in tests.

Toolcc-switch
Version受影响:372b1698968ced988ce046d705732cb799000533(v7 settings redesign 后的 current main)
PlatformsLinux
Can resetting an existing configuration-directory override to its default also be submitted unexpectedly by autosaving an unrelated setting?
Yes. The issue reproduction shows that the next save of an unrelated preference removes the persisted override.
Are directory changes submitted without clicking Save when the page is canceled, reverted, or unmounted?
The issue's baseline tests show that the cancel, revert, and unmount-without-saving control cases pass; autosaving another preference triggers the problem.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.