fix(channels): surface channel error status in selector#2169
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChannelSelector determines a channel's displayed status by collecting connection statuses from all modes and selecting the best match according to a defined priority order (connected, connecting, error, disconnected), replacing hardcoded checks. A test case verifies error states now surface correctly. ChangesChannel Error State Visibility
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
graycyrus
left a comment
There was a problem hiding this comment.
Walkthrough
Clean bug fix that surfaces error channel connection states in the selector instead of silently falling back to Disconnected. The refactor from chained .find() calls to a priority-array lookup is a nice readability win and makes it trivial to adjust priority ordering later. Test covers the exact scenario from #2141.
| File | Change | Description |
|---|---|---|
ChannelSelector.tsx |
Bug fix + refactor | Add CHANNEL_STATUS_PRIORITY array, replace chained .find() with priority-based lookup that includes error |
ChannelSelector.test.tsx |
New test | Seed Telegram bot_token in error state, verify Error badge renders instead of Disconnected |
LGTM — well-scoped fix that matches the issue's acceptance criteria. The status aggregation logic is channel-agnostic so the Telegram test implicitly covers Discord too. All CI green, coverage gate passing.
…#2169) Co-authored-by: honor2030 <11687299+honor2030@users.noreply.github.com>
…#2169) Co-authored-by: honor2030 <11687299+honor2030@users.noreply.github.com>
Summary
errorchannel connection states in the Channels selector instead of falling back toDisconnectedconnectedandconnectingahead oferrorso healthy/in-progress modes still winCloses #2141
Test Plan
PATH="/opt/homebrew/opt/node@24/bin:/opt/homebrew/bin:$PATH" pnpm debug unit src/components/channels/__tests__/ChannelSelector.test.tsxPATH="/opt/homebrew/opt/node@24/bin:/opt/homebrew/bin:$PATH" pnpm --filter openhuman-app format:checkPATH="/opt/homebrew/opt/node@24/bin:/opt/homebrew/bin:$PATH" pnpm --filter openhuman-app compileNotes
node v16.13.1cannot run this repo's Corepack/pnpm (URL.canParseis unavailable).Summary by CodeRabbit
Bug Fixes
Tests