Repository navigation
fix(desktop): handle post-refactor event types, publish ConfirmationSubmitted - #184
luochen1990 wants to merge 1 commit into
Conversation
8359e9e to
e9ba464
Compare
…shed ConfirmationSubmitted) The desktop handler's type switch in cmd/desktop.go was not updated after the broker refactor (nlewo#126) and the stream-logs work (nlewo#172), so several event types added to the gRPC stream have no case and fall into the default branch, logging "unexpected type %T" on every message and dropping the event. As a result the desktop service emits a constant stream of errors and never pops any notification for confirmation, fetch, or log events. Add explicit cases for the new event types: - ManagerState, Fetched, Log: silenced (high-frequency/internal; notifying would spam — Fetched fires on every 60s poll, Log carries streamed build/deploy lines, ManagerState is a startup snapshot). - ConfirmationConfirmed: silenced (immediately followed by DeploymentStarted, which already notifies — redundant). - ConfirmationCancelled: notify ("The deployment has been cancelled."). - ConfirmationSubmitted: notify, distinguishing modes — "manual" warns the user a confirmation is pending, "auto" notes it will auto-confirm shortly, "without" is silenced (immediately confirmed, no user action needed, e.g. the default build confirmer). ConfirmationSubmitted is currently never published by anyone, even though it is defined in services.proto and is the natural signal for "the confirmation buffer window has opened". Publish it from Confirmer.start()'s submit branch so the new desktop case has a producer (the desktop case is dead code without this). This mirrors the sibling ConfirmationConfirmed and ConfirmationCancelled events, which are both published from the confirmer. Fixes nlewo#182
e9ba464 to
31af331
Compare
|
Rebased onto |
|
I like these changes (especially when using build/deployConfirmer.mode = "manual" on systems with a desktop environment), but it's a bit weird to get a notification that comin is asking for confirmation, and then having to go to the console and typing a command to accept that build/deploy...but that'd be a bigger feature considering beeep doesn't support notification actions, so I get why that lives in a different branch |
Fixes #182
Problem
The desktop handler's type switch in
cmd/desktop.gowas never updatedafter #126 and #172, so the new event types (
ManagerState,Fetched,Log,Confirmation*) all hitdefault— logged asunexpected type %Tand dropped (#182 error spam; confirmation lifecycle invisible to desktop
users).
Also,
ConfirmationSubmittedis defined inservices.protobut neverpublished — unlike its
Confirmed/Cancelledsiblings.Fix
internal/manager/confirmer.go— publishConfirmationSubmittedfromthe
submitbranch.cmd/desktop.go— add the missing cases:ManagerState,Fetched,Log,ConfirmationConfirmed.ConfirmationSubmitted(by mode:manual/auto/without),ConfirmationCancelled.Both sides are mutually dependent, hence one PR.
Testing
go build/go vet/go test ./...pass. Manually verified no moreunexpected typeerrors; confirmation events now notify.