fix(listings): don't collapse the feed to Global for non-chapter locations - #1477
fix(listings): don't collapse the feed to Global for non-chapter locations#1477rajanpanth wants to merge 1 commit into
Conversation
…tions
getRegionsForUserLocationUsingChapters bails out with ['Global'] whenever
the user's location has no Superteam chapter. buildListingQuery feeds the
result straight into `where.region = { in: ... }` for the home and all
contexts, so for those users the region filter degrades to "Global only".
Two kinds of listing disappear from the feed as a result:
- listings whose region is the user's own country (userLocation was
dropped along with everything else), and
- listings scoped to a multi-country region that contains that country,
e.g. a `European Union` listing for a user located in Sweden, or a
`North America` listing for a user in Canada.
Both are listings the user is allowed to submit to: userRegionEligibilty
resolves them through countries[].regions and returns true. So the feed
hides work the submission endpoint would happily accept.
The chapter lookup is only needed to add chapter.region; the two
multi-country lookups below already key off userLocation directly and
work fine without a chapter. Push chapter.region conditionally instead of
returning early.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@rajanpanth is attempting to deploy a commit to the Superteam Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
Next review available in: 59 minutes Limit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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 |
The bug
getRegionsForUserLocationUsingChaptersinsrc/utils/chapterRegion.tsgives up as soon as the user's location has no Superteam chapter:buildListingQueryfeeds the result straight into the Prisma filter for thehomeandallcontexts:so for those users the region filter degrades to Global only.
Why it matters
The early return throws away
userLocationitself and skips the two multi-country lookups below it, which never needed a chapter — they key offuserLocationdirectly. Two kinds of listing vanish from the feed:European Unionlisting for a user in Sweden, or aNorth Americalisting for a user in Canada. Both regions are defined statically insrc/constants/country.tsand don't depend on any chapter existing.These are listings the user is allowed to submit to:
userRegionEligibiltyresolves them viacountries[].regionsand returnstrue. So the feed hides work thatvalidateSubmissionRequestwould happily accept — a silent discovery gap for every talent user outside a chapter country.The fix
The chapter lookup is only needed to contribute
chapter.region. Push it conditionally instead of returning early; the rest of the function already works without a chapter.🤖 Generated with Claude Code