fix(channels): Include unjoined public channels in public-channel allowlist - #266
Merged
Conversation
…owlist getPublicChannelIds built its allowlist from getChannels alone, which is membership-scoped and excludes public channels the user hasn't joined. This wrongly rejected threads in unjoined-but-public channels as private via assertChannelIsPublic, and left a latent masking bug in filterVisibleSearchResults. Merge getChannels with workspaces.getPublicChannels and dedupe by id, mirroring the #249 fix in resolveChannelRef. Fixes #263 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
@doistbot /review |
doistbot
reviewed
Jun 5, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
Thanks for putting together this fix for unjoined public channels, Francesca 😎 👊.
Few things worth tightening:
- The
getChannelsAPI call is likely redundant and can be removed, asgetPublicChannelsalready returns all public channels regardless of membership (unless you specifically need to capture archived joined channels).
I also included a few optional follow-up notes in the details below.
Optional follow-up note (1)
- [P3] src/lib/public-channels.ts:17: This is now the third place that reimplements the "joined channels +
getPublicChannels+ dedupe by id" rule (alongsideresolveChannelRefandlistChannels). Since this PR exists because those call sites drifted apart, it would be better to extract a shared helper for this workspace-channel visibility logic and build the ID set from that, so future fixes only need to land once.
getPublicChannels is workspace-scoped and returns every public channel (active and archived, joined and unjoined), making it a complete superset of the public channels getChannels would surface. Drop the redundant getChannels call and Promise.all in getPublicChannelIds — one API call instead of two. Addresses review feedback on #266. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
scottlovegrove
approved these changes
Jun 5, 2026
Contributor
|
🎉 This PR is included in version 2.45.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Overview
getPublicChannelIdsbuilt its allowlist fromgetChannelsalone, which is membership-scoped and excludes public channels the user hasn't joined. This wrongly rejected threads in unjoined-but-public channels as private via assertChannelIsPublic, and left a latent masking bug in filterVisibleSearchResults.Merge
getChannelswithworkspaces.getPublicChannelsand dedupe by id, mirroring the #249 fix in resolveChannelRef.Reference
Test Plan
npm run buildnode dist/index.js thread view id:<threadId>NOT_FOUND: This thread belongs to a private channel)