[bug] enabling or disabling a channel needs a service restart #1586

Closed
opened 2026-10-27 13:40:59 +00:00 by sam · 2 comments
Owner

reconcile's pinProcessBindings (internal/app/archiemessaging/reconcile.go) refuses a Telegram enable or disable from stored settings and reports 'chat.telegram enabled/disabled; takes effect on restart'. composeChannels only composes Telegram when it was enabled at startup, so a channel turned on later has no instance for the supervisor to start.

Design

Compose the Telegram instance always; its channel is nil until a token resolves, which is what disabled means. The parked supervisor runs it when it appears and parks again when it goes. reconcile applies enablement: enableChannel builds and swaps a channel in, disableChannel swaps it out; both update the status declaration (Configured, ReloadSupported) and wait for the channel to leave or reach stopped before reporting applied, via a status poll bounded by channelApplyTimeout. channelChanges no longer treats enable/disable as a transport change.

Acceptance criteria

Tests drive reconcileOnce with stored settings: version 1 with a token enables Telegram and is recorded applied only once the channel is running it; version 2 clears the token, disables it and records applied.


Imported from beads archie-core-teaq · GitHub #1558 · type bug · priority P2 · created 2026-10-08

reconcile's pinProcessBindings (internal/app/archiemessaging/reconcile.go) refuses a Telegram enable or disable from stored settings and reports 'chat.telegram enabled/disabled; takes effect on restart'. composeChannels only composes Telegram when it was enabled at startup, so a channel turned on later has no instance for the supervisor to start. ### Design Compose the Telegram instance always; its channel is nil until a token resolves, which is what disabled means. The parked supervisor runs it when it appears and parks again when it goes. reconcile applies enablement: enableChannel builds and swaps a channel in, disableChannel swaps it out; both update the status declaration (Configured, ReloadSupported) and wait for the channel to leave or reach stopped before reporting applied, via a status poll bounded by channelApplyTimeout. channelChanges no longer treats enable/disable as a transport change. ### Acceptance criteria Tests drive reconcileOnce with stored settings: version 1 with a token enables Telegram and is recorded applied only once the channel is running it; version 2 clears the token, disables it and records applied. --- _Imported from beads `archie-core-teaq` · GitHub #1558 · type bug · priority P2 · created 2026-10-08_
sam added the mediumbug labels 2026-10-27 13:40:59 +00:00
sam self-assigned this 2026-10-27 13:40:59 +00:00
Author
Owner

The supervisor's enableChannel/disableChannel/restartChannel helpers and the per-instance rebuild closures were deleted in c5f24ec9: since #1399 channels are extensions composed at startup, and nothing called them. The design above (built-in Telegram, pinProcessBindings) is stale. A fix now means recomposing an extension channel on a settings change and swapping it in with setChannelState, which org channels already use.

The supervisor's enableChannel/disableChannel/restartChannel helpers and the per-instance rebuild closures were deleted in c5f24ec9: since #1399 channels are extensions composed at startup, and nothing called them. The design above (built-in Telegram, pinProcessBindings) is stale. A fix now means recomposing an extension channel on a settings change and swapping it in with setChannelState, which org channels already use.
Author
Owner

Fixed in a9621b91c, on main and deployed.

Fixed in a9621b91c, on main and deployed.
sam closed this issue 2026-11-14 03:24:04 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1586