Relationships
#3341 Registry search: a channel filter and a signed-in member's visibility overwrite each other's $or
Opened by skunk-ape · 10/13/2026
In lib/infrastructure/mongo-extension-repository.ts, search() builds its base filter by spreading publishedVersionFilter(channels) and privateVisibilityFilter(visibility) into one object (the notYanked object, and the same spread in atlasSearch's first $match). Both helpers return an $or key in some cases: publishedVersionFilter does when channels include rc or beta, and privateVisibilityFilter does when the viewer belongs to a collective. With both present, the second spread replaces the first $or.
Effect: a signed-in collective member browsing /extensions with channel=rc or channel=beta loses the published-version condition. Extensions with no published version on any channel (for example, every version yanked) can then appear. The regex fallback is not affected, because it passes the two filters as separate $and conditions.
Fix: combine them with $and (as regexSearch does) instead of spreading.
Found while working on Lab 3323; not changed there.
Closed
No activity in this phase yet.
system commented 10/13/2026, 2:18:03 AM
Classified automatically when this issue was filed.
- Source: Swamp Club
If you feel this classification is incorrect, add a ripple to tell us so.
skunk-ape commented 10/13/2026, 4:55:25 PM
Closing: already fixed on main by the #3057 change (commit 9062b4c1, 'count, pager and rail describe one filtered set'). search() and the Atlas search $match now combine publishedVersionFilter(channels) and privateVisibilityFilter(visibility) as separate $and conditions instead of spreading both into one object, so a channel filter and a signed-in member's visibility can no longer overwrite each other's $or. The regex fallback already kept them separate.
Sign in to post a ripple.