Add competitive directory routes with exact subscriptions - #827
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedToo many files! This PR contains 104 files, which is 4 over the limit of 100. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (104)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
|
||
| const { commentCid } = params; | ||
| const routeCommunityAddress = resolveCommunityRouteAddress(params.communityAddress); | ||
| const { communityAddress: routeCommunityAddress } = useResolvedCommunityRoute(); |
There was a problem hiding this comment.
Directory permalink join skips provenance
Medium Severity
On a directory-coded post URL such as /s/funny/comments/…, the sidebar SubscribeButton is rendered without directoryCode or directoryRevision. While the post is still loading and the canonical redirect to the owner’s exact address has not run, Join uses the generic subscribe() path instead of joinDirectoryWinnerAccount, so the account can gain the community without the matching directory slot metadata.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d0d4a9d. Configure here.
There was a problem hiding this comment.
Fixed in 92bb184. Directory-coded post aliases now suppress the sidebar subscription action until the post owner is known and the route has canonicalized to the exact community address, so Join cannot create ambiguous or incorrect provenance.
| const winnerIsHidden = Boolean(hideNsfwCommunities && winner?.nsfw); | ||
|
|
||
| useEffect(() => { | ||
| if (!account || !list || !winner || winnerIsHidden) return; |
There was a problem hiding this comment.
Hidden NSFW skips directory reconciliation
Medium Severity
When hideNsfwCommunities is on and the directory winner is marked NSFW, DirectorySlotReconciler returns early and ManualDirectoryChangeNotice renders nothing. Users with auto-switch enabled therefore never get an automatic subscription update or a manual winner-change prompt for that slot while the filter stays enabled.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d0d4a9d. Configure here.
There was a problem hiding this comment.
Declined intentionally. When hideNsfwCommunities is enabled, a hidden NSFW winner must not prompt the user or silently auto-subscribe them to content they chose to hide. Reconciliation resumes if a later winner is visible or the user disables the filter.
|
Review follow-up: the live post-merge sync check exposed a stale-cache race between GitHub's Verified the fix against Lists merge |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0a00264. Configure here.
| ? advanceStarterProvenance(account, previousAddress, winner, result, 'trackWinner') | ||
| : account.seeditStarterSubscriptions; | ||
| return applyDirectoryState(account, result, provenance); | ||
| }; |
There was a problem hiding this comment.
Auto-switch enable leaves old subscription
Medium Severity
Turning on per-directory automatic switching after the directory winner already changed uses joinDirectorySubscription, which adds the new winner and retargets the slot but leaves the prior slot address in account.subscriptions. Later automatic reconciliation sees the slot already on the winner and does not remove the old follow, so the home feed can keep both communities.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0a00264. Configure here.
There was a problem hiding this comment.
Fixed in 92bb184. Enabling auto-switch now atomically adopts the current acknowledged winner: it removes the previous slot-attributable subscription unless another slot still tracks it, keeps the current winner, and updates provenance. Added a regression test.
|
Review follow-up (
Verification: 169 Vitest tests, production build, lint, TypeScript, Knip, AI workflow parity, llms generation, immutable directory sync, and Chrome/Firefox/WebKit desktop+mobile route regression checks all pass. React Doctor reports only the nine existing barrel-import advisories already present in touched files. |


Summary
/s/<code>routes resolve deterministic versioned directory winners/comments/<cid>permalinks pinned to exact community addressesLists dependency
Validation
corepack yarn install --immutable,yarn llms:generate, andgit diff --checkCloses #826
Note
Cursor Bugbot is generating a summary for commit d0d4a9d. Configure here.