Skip to content

[code-review] wailskit/im.go: editing a disabled IM adapter silently re-enables it (Enabled missing from #107 preserve list) #155

Description

@topcheer

Description

SaveIMAdapter (desktop/wailskit/im.go L119-183) silently flips a disabled adapter back to enabled whenever any other field is edited.

Trigger scenario

  1. User disables adapter via SetIMAdapterEnabled(name, false) (cost/noise/debug reasons)
  2. User opens Edit dialog, changes only the token field, saves
  3. values["enabled"] missing → adapterCfg.Enabled = true
  4. Preserve list omits Enabled → persisted Enabled flips false → true
  5. On next start the adapter is unexpectedly online

Expected vs actual

Fix

Add Enabled to the preserve list — e.g. only override when values["enabled"] is explicitly "true"/"false"; otherwise keep existing.Enabled.

Severity

High — deterministic silent state loss on a routine UI action; user-intent violation with operational impact (adapter comes online unexpectedly).

Verified by independent review subagent (sa-1, static analysis + full call-chain verification).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions