Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@steven-tey
Copy link
Collaborator

@steven-tey steven-tey commented Aug 18, 2025

Summary by CodeRabbit

  • New Features

    • Pages now redirect to relevant destinations instead of showing 404s when data is missing (Programs, Customers, Links/Folders, Integrations, OAuth Apps, Webhooks, Stats, Connect guides).
  • Bug Fixes

    • Unified handling for missing or ineligible integrations by redirecting to the integrations list.
    • Corrected folder members navigation and permission redirect targets.
  • Chores

    • Renamed a shared page component for consistency; removed an obsolete comment; updated a folder page title to "Folder Permissions".

@vercel
Copy link
Contributor

vercel bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dub Ready Ready Preview Aug 18, 2025 2:35am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 18, 2025

Walkthrough

Replaces many notFound() calls with redirect(...) across multiple routes and components, adds slug to one page's params and signature, renames a couple of components, tweaks useParams destructuring/typing, and removes a stray comment. No other rendering or API changes.

Changes

Cohort / File(s) Summary of changes
Redirect migration (404 → redirect)
apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page-client.tsx, apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/apply/page.tsx, apps/web/app/[domain]/stats/[key]/page.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/customers/[customerId]/page-client.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/links/[...link]/page-client.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page-client.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/integrations/[integrationSlug]/manage/page.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/integrations/[integrationSlug]/page.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/integrations/new/page.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/oauth-apps/[appId]/page-client.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/edit/page-client.tsx, apps/web/ui/webhooks/webhook-header.tsx
Replaced imports of notFound with redirect from next/navigation and changed error branches to call redirect(...) (targets vary by route) instead of notFound(). Core rendering logic otherwise unchanged.
Route params / signature updates
apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/[[...guide]]/page.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/links/[...link]/page-client.tsx
ConnectGuidesPage signature updated to include slug: string in params; guide-not-found and missing-markdown branches now redirect to /{slug}/program/new/connect. Links page: refined useParams destructuring/typing (slug and link) and redirect when link path absent.
Sidebar navigation control
apps/web/app/(ee)/app.dub.co/(new-program)/sidebar-context.tsx
Removed router/useRouter and notFound usage; use redirect(...) for workspace 404 and default-program navigation; imports and navigation flows updated accordingly.
Component rename & layout change
apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx, apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page.tsx
Renamed default export dashboardPageDashboardPage. Folder users page renamed/rewrapped: FolderUsersPageFolderMembersPage (non-async), now composes FolderMembersPageClient within layout wrappers and updates titles/links.
Minor cleanup
apps/web/app/deeplink/[domain]/[key]/page.tsx
Removed a single comment line; no functional changes.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Page
  participant Data
  participant NextNav as next/navigation

  User->>Page: Request route
  Page->>Data: Fetch entity/resource
  Data-->>Page: Resource present or missing
  alt missing
    Page->>NextNav: redirect("/fallback-or-list")
  else present
    Page-->>User: Render content
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

"I hopped through routes both near and far,
Replaced the 404 with a guiding star.
Slugs on my back, redirects in tow,
I lead lost pages where they should go.
A rabbit’s blessing — tidy, swift, and neat 🐇"


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6de9933 and 2789256.

📒 Files selected for processing (2)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page-client.tsx (3 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: steven-tey
PR: dubinc/dub#2756
File: apps/web/ui/webhooks/webhook-header.tsx:20-20
Timestamp: 2025-08-18T02:31:22.226Z
Learning: The Next.js redirect() function can be used in both Server Components and Client Components, as well as Route Handlers and Server Actions. It is not server-only as previously thought.
📚 Learning: 2025-08-18T02:31:22.226Z
Learnt from: steven-tey
PR: dubinc/dub#2756
File: apps/web/ui/webhooks/webhook-header.tsx:20-20
Timestamp: 2025-08-18T02:31:22.226Z
Learning: The Next.js redirect() function can be used in both Server Components and Client Components, as well as Route Handlers and Server Actions. It is not server-only as previously thought.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page-client.tsx
📚 Learning: 2025-08-18T02:31:22.226Z
Learnt from: steven-tey
PR: dubinc/dub#2756
File: apps/web/ui/webhooks/webhook-header.tsx:20-20
Timestamp: 2025-08-18T02:31:22.226Z
Learning: The Next.js redirect() function can be used in both Server Components and Client Components, as well as Route Handlers and Server Actions, according to the official Next.js documentation. It is not server-only.

Applied to files:

  • apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page-client.tsx
🧬 Code Graph Analysis (1)
apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page.tsx (3)
apps/web/ui/layout/page-content/index.tsx (1)
  • PageContent (11-100)
apps/web/ui/layout/page-width-wrapper.tsx (1)
  • PageWidthWrapper (4-21)
apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page-client.tsx (1)
  • FolderMembersPageClient (30-188)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (6)
apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page-client.tsx (3)

30-30: Rename looks good

Export rename to FolderMembersPageClient is clear and consistent with the page import.


106-112: Back link path and copy update LGTM

Updated href to /links/folders and clearer "View all folders" label improve UX consistency.


126-127: Minor UI polish LGTM

Explicit space between formatted count and unit reads well.

apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page.tsx (3)

1-3: Imports and composition look good

Good use of PageContent + PageWidthWrapper and the renamed client component.


5-9: Page signature is appropriate

Params typing is explicit and minimal; keeping the page non-async is fine here.


12-25: Layout and help link LGTM

The new header title and help article link add clarity. The content wrapper structure is consistent with the app’s layout components.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch not-found-redirect

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@steven-tey
Copy link
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 18, 2025

✅ Actions performed

Full review triggered.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 17

🧹 Nitpick comments (1)
apps/web/app/app.dub.co/(dashboard)/[slug]/links/[...link]/page-client.tsx (1)

42-42: Optional: tighten route param typing for [...link]

If this route is always a catch-all segment, consider narrowing link to string[] in the useParams generic to match the route contract and avoid string cases.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 762369a and 6de9933.

📒 Files selected for processing (16)
  • apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/[[...guide]]/page.tsx (2 hunks)
  • apps/web/app/(ee)/app.dub.co/(new-program)/sidebar-context.tsx (2 hunks)
  • apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page-client.tsx (2 hunks)
  • apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/apply/page.tsx (2 hunks)
  • apps/web/app/[domain]/stats/[key]/page.tsx (2 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/customers/[customerId]/page-client.tsx (2 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/links/[...link]/page-client.tsx (1 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/links/folders/[folderId]/members/page-client.tsx (2 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/integrations/[integrationSlug]/manage/page.tsx (2 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/integrations/[integrationSlug]/page.tsx (2 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/integrations/new/page.tsx (2 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/oauth-apps/[appId]/page-client.tsx (2 hunks)
  • apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/edit/page-client.tsx (1 hunks)
  • apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx (1 hunks)
  • apps/web/app/deeplink/[domain]/[key]/page.tsx (0 hunks)
  • apps/web/ui/webhooks/webhook-header.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/app/deeplink/[domain]/[key]/page.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/[[...guide]]/page.tsx (1)
apps/web/lib/get-integration-guide-markdown.ts (1)
  • getIntegrationGuideMarkdown (6-29)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (13)
apps/web/app/[domain]/stats/[key]/page.tsx (1)

24-26: Swap to redirect("/") on missing dashboard looks good

Server-side redirect is appropriate here and matches the PR goal. The follow-up redirect to the share URL remains intact and safe since link?.dashboard is checked beforehand.

apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/integrations/[integrationSlug]/manage/page.tsx (2)

16-18: notFound → redirect is correct and target path is consistent

Both non-Dub workspace and missing integration now redirect to /${params.slug}/settings/integrations. This aligns with the PR objective and keeps UX consistent.


24-26: Redirect on missing integration is appropriate

Using a redirect instead of a 404 matches the new handling. No additional guards needed since redirect() aborts rendering.

apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/integrations/[integrationSlug]/page.tsx (2)

2-2: Importing redirect is correct for server-side navigation

This page is server-rendered; using redirect from next/navigation is the right API.


47-49: Unified redirect for missing/comingSoon is clean and safe

Collapsing the conditions to a single redirect simplifies the control flow. Since redirect() throws, subsequent code won't run in those cases.

apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/edit/page-client.tsx (1)

16-16: LGTM: capturing slug for redirect target
Including slug from useWorkspace() enables constructing the proper settings path. No issues here.

apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx (1)

33-37: Rename to PascalCase is fine; no functional impact

Changing the default export from dashboardPage to DashboardPage is stylistic and does not affect behavior.

apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/apply/page.tsx (2)

8-8: LGTM: switching to next/navigation.redirect on the server
Importing redirect in a Server Component is appropriate.


23-24: LGTM: server-side redirect on missing program
Redirecting to “/programs” when getProgram returns null is correct and non-breaking.

apps/web/app/app.dub.co/(dashboard)/[slug]/settings/(basic-layout)/integrations/new/page.tsx (1)

4-4: Server-side redirect here is correct and aligns with App Router semantics

Switching from notFound to redirect in this server component is appropriate. The early redirect for non-"dub" workspaces prevents unnecessary rendering, and the target path is consistent with the rest of the module.

Also applies to: 14-15

apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/[[...guide]]/page.tsx (3)

5-5: Server-side redirect is appropriate

Using redirect here is correct (server component). This keeps the flow consistent and avoids rendering a 404.


9-15: Param signature update looks good

Including slug in params aligns with the route path and enables correct, scoped redirects.


24-31: Defensive redirects on missing guide/content are sound

Redirecting back to the connect index when the guide is invalid or content is missing is a sensible UX choice. The upstream getIntegrationGuideMarkdown already sanitizes inputs.

@steven-tey steven-tey merged commit 552e0fe into main Aug 18, 2025
7 of 8 checks passed
@steven-tey steven-tey deleted the not-found-redirect branch August 18, 2025 02:38
@coderabbitai coderabbitai bot mentioned this pull request Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants