Repository navigation
feat(api): config rejected and write-back failed are state, not only events - #181
Merged
Merged
Conversation
…led are state, not only events A client that connects late (the desktop notices after a restart or a reconnect) could only learn about a rejected config file or a failed credential write-back from the event at that moment; if it missed the event, the condition was invisible until it changed again. - Status.config_rejected: the last external edit that did not validate, while the previous version keeps serving. Cleared by the next successful apply. A UI write that fails validation never reaches disk and is not recorded. - Reverting a rejected edit to the version already in effect used to be swallowed as "our own write"; it now clears the rejection and emits ConfigReloaded, so the "did not validate" notice does not hang around. - ProviderView.writeback_failed: the reason a rotated credential could not be written back, until a write-back succeeds. CONTROL_API_VERSION 16 -> 17. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fylorn
force-pushed
the
feat/notice-snapshot
branch
from
September 24, 2026 12:47
4aefe41 to
db7f062
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The desktop notices bridge subscribes to
/eventsafter core has already started (and again after reconnects). Anything core reported before that moment is lost: a credential that expired at startup, a config edit rejected while lite was restarting, a credential write-back that failed. Most of these are already current state in the API (OAuthView.needs_login/failure,ProviderView.auth_rejected,ProxyView.unreachable,Status.listen_error,/quota), so lite can reconcile from a snapshot. Two were event-only; this adds them:Status.config_rejected: Option<ConfigRejection>{stage, message, line, excerpt, at_ms}— the last external edit that did not validate (the old config keeps serving). Cleared by the next successful apply. UI writes that fail validation never reach disk and aren't recorded.ConfigReloaded(origin external).ProviderView.writeback_failed: Option<Msg>— why a rotated credential could not be written back; cleared when a write-back succeeds.CONTROL_API_VERSION16 → 17. Both new fields aredefault + skip_serializing_if.Tests:
sync.rs(rejection stays until a good file; revert clears it and emits ConfigReloaded; a rejected UI write is not standing state),oauth.rs(write-back failure is visible and cleared on success). Local: fmt, clippy--all-targets/--lib-D warnings,cargo test --workspace,tsfeature clippy + tests.🤖 Generated with Claude Code