Unify server list#3162
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRemoved the preconfigured server-list Axios client, updated the hardcoded Changes
Sequence DiagramsequenceDiagram
participant App as Application
participant initSdk as initSdkConfig
participant getNodes as getNodes()
participant ExtAPI as ecency.com
participant ConfigMgr as SDKConfig
App->>initSdk: initialize SDK
initSdk->>getNodes: request node list
getNodes->>ExtAPI: GET /public-nodes.json
ExtAPI-->>getNodes: JSON (hived or root data)
getNodes-->>initSdk: parsed node array
initSdk->>ConfigMgr: setHiveNodes(savedServer + fetchedNodes)
ConfigMgr-->>initSdk: confirmation
initSdk-->>App: SDK ready
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/screens/chats/utils/messageFormatters.tsx (1)
97-101: Unify system-join type checks to avoid drift.Line 100 adds
system_join_channel, but this formatter still omitssystem_join_teamwhile container logic treats both as system-add/join. Consider using a shared constant (or include both types here) so formatting and rendering rules stay aligned.Proposed refactor
+const SYSTEM_JOIN_TYPES = new Set([ + 'system_add_to_channel', + 'system_add_to_team', + 'system_join_team', + 'system_join_channel', +]); + export const formatPostBody = ( post: ChatPost, userLookup: Record<string, any>, timestamp?: number, ): string => { - if ( - post?.type === 'system_add_to_channel' || - post?.type === 'system_add_to_team' || - post?.type === 'system_join_channel' - ) { + if (post?.type && SYSTEM_JOIN_TYPES.has(post.type)) { return formatJoinedMessage(post, userLookup, timestamp); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/screens/chats/utils/messageFormatters.tsx` around lines 97 - 101, The conditional in the message formatter that checks post?.type for system events currently lists 'system_add_to_channel', 'system_add_to_team', and 'system_join_channel' but omits 'system_join_team', causing drift with container logic; update the formatter in messageFormatters (the block checking post?.type) to either reference a shared constant/enum of system-add/join types or include both 'system_join_team' and 'system_join_channel' so formatting rules match rendering logic (ensure the same symbol set is used wherever container logic determines system-add/join events).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/screens/chats/utils/messageFormatters.tsx`:
- Around line 97-101: The conditional in the message formatter that checks
post?.type for system events currently lists 'system_add_to_channel',
'system_add_to_team', and 'system_join_channel' but omits 'system_join_team',
causing drift with container logic; update the formatter in messageFormatters
(the block checking post?.type) to either reference a shared constant/enum of
system-add/join types or include both 'system_join_team' and
'system_join_channel' so formatting rules match rendering logic (ensure the same
symbol set is used wherever container logic determines system-add/join events).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: be0a3c53-0048-46ca-9a4f-4bce3de1c2c9
📒 Files selected for processing (3)
src/providers/queries/sdk-config.tssrc/screens/chats/container/chatThreadContainer.tsxsrc/screens/chats/utils/messageFormatters.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/providers/queries/sdk-config.ts
Summary by CodeRabbit
Chores
Bug Fixes