Skip to content

fix(wizard): check config save return values and report failures#35

Merged
missuo merged 3 commits into
missuo:mainfrom
erning:fix/config-save-error-handling
Mar 30, 2026
Merged

fix(wizard): check config save return values and report failures#35
missuo merged 3 commits into
missuo:mainfrom
erning:fix/config-save-error-handling

Conversation

@erning

@erning erning commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

Why

The ObjC configSet() wrapper was declared void and silently discarded
the error code from sp_config_set(). With 18-20 sequential config writes,
a mid-save failure (corrupted YAML, disk full) would leave config partially
saved with no user feedback.

What changed

  • configSet() now returns BOOL and checks the sp_config_set return code.
  • The save method tracks all failures via saveOk flag and shows an alert
    if any write fails.
  • Added Rust-side tests for config_set error behavior (corrupted YAML,
    valid YAML).

Test plan

  • cargo test -p koe-core --lib — config tests pass
  • make builds successfully
  • Manual: chmod 444 ~/.koe/config.yaml, save in wizard — should show
    error alert; restore permissions and verify normal save works

erning added 3 commits March 30, 2026 11:00
Verify config_set returns Err on corrupted YAML and succeeds on valid
config. These tests validate the Rust FFI contract that the ObjC
layer should be checking.
configSet() was declared void and silently discarded the error code
from sp_config_set. With 18-20 sequential writes, a mid-save failure
(corrupted YAML, disk full, permission denied) would leave config
partially saved with no user feedback.

Now configSet returns BOOL, and the save method tracks all failures
to show an alert when any write fails.
Move config_set tests after normalize_hotkey_config test to avoid
merge conflict with statusbar-hotkey-display branch. Combine into
one function to prevent parallel test races on HOME env var.
@missuo missuo merged commit 5165645 into missuo:main Mar 30, 2026
@erning erning deleted the fix/config-save-error-handling branch March 31, 2026 01:35
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.

2 participants