Skip to content

Unify server list#3162

Merged
feruzm merged 6 commits intodevelopmentfrom
server
Apr 3, 2026
Merged

Unify server list#3162
feruzm merged 6 commits intodevelopmentfrom
server

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Apr 3, 2026

Summary by CodeRabbit

  • Chores

    • Removed the preconfigured server-list API client; node sources were updated and the app now fetches nodes dynamically while honoring a saved server preference.
    • Updated an SDK dependency to a newer patch version.
  • Bug Fixes

    • Channel "join" system posts are now grouped and formatted like other add/join system messages, improving chat thread display.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5058b06d-cc92-467a-851c-4daecbd89c41

📥 Commits

Reviewing files that changed from the base of the PR and between 7f190c6 and 1f623d5.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json

📝 Walkthrough

Walkthrough

Removed the preconfigured server-list Axios client, updated the hardcoded SERVER_LIST endpoints, switched node discovery to fetch https://ecency.com/public-nodes.json, and integrated fetched nodes into SDK initialization; also added system_join_channel/system_join_team handling for chat system messages.

Changes

Cohort / File(s) Summary
API Client Removal
src/config/serverListApi.ts
Deleted module exporting preconfigured Axios slist (baseURL from config, Authorization header, Content-Type, pass-through interceptors).
Server Endpoints Update
src/constants/options/api.ts
Updated SERVER_LIST contents: removed several endpoints, added https://rpc.mahdiyari.info, https://api.c0ff33a.uk, https://api.syncad.com, and reordered entries.
Dynamic Node Resolution
src/providers/ecency/ecency.ts, src/providers/queries/sdk-config.ts
getNodes() now fetches https://ecency.com/public-nodes.json and uses data.hived ?? data; fallback returns a shallow copy of SERVER_LIST. initSdkConfig() awaits getNodes() and conditionally prepends a validated savedServer if non-empty and not duplicated.
Chat System Message Handling
src/screens/chats/container/chatThreadContainer.tsx, src/screens/chats/utils/messageFormatters.tsx
Treat system_join_channel (and system_join_team routing) as join/add events so they are grouped/rendered via SystemMessageItem and formatted with formatJoinedMessage.
Dependency Bump
package.json
Bumped @ecency/sdk dependency from ^2.0.38 to ^2.0.39.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

deploy-pr-build

Poem

🐰
I hopped through code with nimble care,
Removed the old client from its lair,
Nodes now bloom from ecency's air,
Saved servers join when they declare,
A tiny hop toward fresher fare! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Unify server list' accurately reflects the primary changes: consolidating server/node list management by removing the dedicated serverListApi module, updating SERVER_LIST constants, and refactoring getNodes to fetch from a unified source (ecency.com/public-nodes.json) instead of multiple endpoints.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch server

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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 omits system_join_team while 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

📥 Commits

Reviewing files that changed from the base of the PR and between a672fe9 and 5d70ac1.

📒 Files selected for processing (3)
  • src/providers/queries/sdk-config.ts
  • src/screens/chats/container/chatThreadContainer.tsx
  • src/screens/chats/utils/messageFormatters.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/providers/queries/sdk-config.ts

@feruzm feruzm merged commit c227444 into development Apr 3, 2026
1 of 4 checks passed
@feruzm feruzm deleted the server branch April 3, 2026 13:40
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.

1 participant