chore: add structured logging to channel connect/disconnect flows#1003
Merged
chore: add structured logging to channel connect/disconnect flows#1003
Conversation
Channel connect operations (Telegram, Discord, Slack, Feishu, QQ, DingTalk, WeCom) previously had zero logging — if the upstream token verification timed out or returned an error, the failure was silently caught and returned as a 409 JSON response with no controller log entry. This made it impossible to diagnose "channel won't connect" reports from user diagnostics exports alone. Changes: - channel-service: add start/success/failure logs to all connect*() methods and disconnect flow - channel-routes: add error logs to all route-level catch blocks (covers proxyFetch network errors that throw before service-level logging) - channel-binding-compiler: add compile_channels_summary log showing which channel types were compiled vs skipped (with skip reason)
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Siri-Ray
approved these changes
Apr 10, 2026
Merged
This was referenced Apr 13, 2026
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.
What
Add structured logging to all channel connect/disconnect operations across the controller.
Why
Channel connect failures (especially Telegram/Discord) were completely silent —
proxyFetchtimeouts or API errors were caught and returned as 409 JSON responses with zero controller log entries. This made it impossible to diagnose "channel won't connect" from user diagnostics exports.Discovered while debugging a user report where Telegram/Discord appeared unconfigured despite the user claiming they had set them up.
How
Three files changed:
channel-service.ts— start/success/failure logs for allconnect*()methods +disconnectChannel:{slack,discord,telegram,feishu,qqbot,dingtalk,wecom}_connect_{start,success}{slack,discord,telegram,feishu}_connect_verify_failedchannel_disconnect_{start,success,not_found}channel-routes.ts—channel_connect_error_<type>in all route catch blocks (coversproxyFetchnetwork errors that throw before service-level logging).channel-binding-compiler.ts—compile_channels_summarylog showing input count, compiled channel types with account counts, and skipped channels with skip reasons.Affected areas
Checklist
pnpm typecheckpassespnpm lintpasses