Repository navigation
fix(chat): cap bootstrap community auto-join at 10 - #1987
Conversation
Bootstrap ensured a channel and membership for every subscribed community, so accounts following hundreds of communities never finished before the deadline and chat never loaded. Auto-join now takes the first 10 subscriptions (Hive order, left channels skipped before counting). Explicit community joins are unchanged. Closes #1986
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
PR Summary by QodoCap chat bootstrap auto-joins at 10 communities
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
[Medium impact] The PR appears safe to merge; the new bootstrap test addresses the previous coverage gap. SummaryBootstrap now auto-joins up to 10 subscribed communities, preserving their order and skipping duplicates and channels the user left.
Reviews (2) · Last reviewed commit: "test(chat): cover bootstrap auto-join ca..." · Reviewed by Greptile |
Code Review by Qodo
1.
|
| const BATCH_SIZE = 5; | ||
|
|
||
| const leftChannels = getUserLeftChannels(userWithProps); | ||
| const uniqueCommunityIds = pickAutoJoinCommunities(communityIds, leftChannels); |
There was a problem hiding this comment.
2. Some communities vanish from chat search 🐞 Bug ≡ Correctness
pickAutoJoinCommunities stops bootstrap from calling ensureCommunityChannelMembership for subscriptions beyond the first ten, so bootstrap no longer creates those channels. When an omitted community has no existing Mattermost channel, the New chat search queries only existing channels and offers no result to join, although opening the community page can still create it.
Agent Prompt
## Issue description
Communities omitted by the bootstrap cap may have no Mattermost channel, so the New chat search cannot find them.
## Fix Focus Areas
- apps/web/src/app/api/mattermost/bootstrap/route.ts[238-260]
- apps/web/src/app/api/mattermost/channels/search/route.ts[42-69]
- apps/web/src/app/chats/_components/chats-client.tsx[801-824]
## Recommended Fix
Add an on-demand path for community search results without existing channels. Validate matches against Hive, then let the user explicitly create and join the selected community channel; do not create channels for every search result.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
🔇 Additional comments: 3
apps/web/src/specs/api/mattermost-auto-join-communities.spec.ts: 1
1-55: LGTM!apps/web/src/app/api/mattermost/bootstrap/route.ts: 1
15-15: LGTM!Also applies to: 22-24, 238-238, 243-243, 260-260
apps/web/src/server/mattermost.ts-1280-1280: 1
1280-1280:Minor · Functional Correctness · Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Deduplicate community IDs using the normalized ID.
If subscriptions contain
hive-100000andHive-100000,picked.has(id)treats them as different communities. Both use a slot, so the cap can exclude another community. Track normalized IDs for duplicate checks, while keeping the first ID and title for the membership call.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
bc929fad-6788-4541-be04-637f0a1a181d
Files selected for processing: 3-
apps/web/src/app/api/mattermost/bootstrap/route.tsapps/web/src/server/mattermost.tsapps/web/src/specs/api/mattermost-auto-join-communities.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
-
Chat bootstrap ensured a channel and membership for every subscribed community, in sequential batches. Accounts following hundreds of communities never finished before the bootstrap deadline, so
/chatsnever loaded for them.pickAutoJoinCommunities), keeping Hive's order (role holders first, then community rank).communityin the body, used by the community chat page) are unchanged.Follow-up: community channels beyond the cap are no longer created during bootstrap, so channel search should create them on demand (tracked separately).
Test plan
mattermost-auto-join-communities.spec.ts(cap, order, duplicates, left channels, case); fails when the cap is removed.pnpm test src/specs/api/: 931 passed.Closes #1986
Summary by CodeRabbit