Skip to content

fix(framework): savePreferences returns the typed error on a failed write#618

Merged
suleimansh merged 1 commit into
mainfrom
suleimansh/fix/save-prefs-result
Jul 16, 2026
Merged

fix(framework): savePreferences returns the typed error on a failed write#618
suleimansh merged 1 commit into
mainfrom
suleimansh/fix/save-prefs-result

Conversation

@suleimansh

Copy link
Copy Markdown
Member

savePreferences advertises a { ok: false, error } result and returns it for the not-enabled case, but a failed store.save threw straight through, so the client saw a rejected RPC instead of the typed error. The write is now wrapped in try/catch, so both failure modes (not-enabled, write-failed) return { ok: false } and the client handles them the same.

Regression test added via provideTelefuncContext (a store whose save throws -> { ok: false, error: 'failed to save preferences' }). Changeset: patch.

@suleimansh suleimansh added bug Something isn't working priority: medium Worth doing, not urgent the-framework ♻️ labels Jul 16, 2026
@suleimansh suleimansh self-assigned this Jul 16, 2026
@suleimansh
suleimansh merged commit 4a70c5a into main Jul 16, 2026
2 checks passed
@suleimansh
suleimansh deleted the suleimansh/fix/save-prefs-result branch July 16, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: medium Worth doing, not urgent the-framework ♻️

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant