Skip to content

fix(desktop): handle post-refactor event types, publish ConfirmationSubmitted - #184

Open
luochen1990 wants to merge 1 commit into
nlewo:mainfrom
luochen1990:fix/desktop-dropped-events
Open

luochen1990 wants to merge 1 commit into
nlewo:mainfrom
luochen1990:fix/desktop-dropped-events

Conversation

@luochen1990

@luochen1990 luochen1990 commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #182

Problem

The desktop handler's type switch in cmd/desktop.go was never updated
after #126 and #172, so the new event types (ManagerState, Fetched,
Log, Confirmation*) all hit default — logged as unexpected type %T
and dropped (#182 error spam; confirmation lifecycle invisible to desktop
users).

Also, ConfirmationSubmitted is defined in services.proto but never
published — unlike its Confirmed/Cancelled siblings.

Fix

internal/manager/confirmer.go — publish ConfirmationSubmitted from
the submit branch.

cmd/desktop.go — add the missing cases:

  • Silenced (spam/redundant): ManagerState, Fetched, Log,
    ConfirmationConfirmed.
  • Notify: 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 more
unexpected type errors; confirmation events now notify.

@luochen1990
luochen1990 force-pushed the fix/desktop-dropped-events branch from 8359e9e to e9ba464 Compare August 1, 2026 13:25
@luochen1990 luochen1990 changed the title fix: desktop service drops all events (missing switch cases + unpublished ConfirmationSubmitted) fix(desktop): handle post-refactor event types, publish ConfirmationSubmitted Aug 1, 2026
…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
@luochen1990
luochen1990 force-pushed the fix/desktop-dropped-events branch from e9ba464 to 31af331 Compare September 7, 2026 11:20
@luochen1990

Copy link
Copy Markdown
Contributor Author

Rebased onto main (after the #185 multi-fetcher refactor) — the branch now includes the switch-case fixes adapted to the new event types. The server-side part (publishing ConfirmationSubmitted/ConfirmationConfirmed/ConfirmationCancelled events from the manager) is still missing on main, so the original fix remains relevant. The broader interactive-notification feature this grows into lives in luochen1990/comin feat/reboot-interactive-notification if you want to look ahead.

@byte-sized-emi

Copy link
Copy Markdown

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

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.

comin desktop logs spurious error on every startup (unexpected type *protobuf.Event_ManagerState_)

2 participants