-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add support for customizing deep link page behavior #2773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe deeplink page query now selects iOS data and the linked Domain's AASA flag and changes redirect behavior based on link presence and AASA. Prisma schemas add a Link→Domain relation and Domain→Link[] relation (plus field reordering). Several UI icon exports and the CUSTOMER_STORIES export were removed. Changes
Sequence Diagram(s)sequenceDiagram
participant UA as User Agent
participant Page as Next.js deeplink page
participant DB as Prisma
UA->>Page: GET /deeplink/[domain]/[key]
Page->>DB: findUnique Link select { url, ios, domain, shortDomain { appleAppSiteAssociation } }
alt Link not found
Page-->>UA: 302 to https://<domain>
else Link found
alt shortDomain.appleAppSiteAssociation == true
Page-->>UA: 200 render deep-link preview
else shortDomain.appleAppSiteAssociation == false
alt link.ios present
Page-->>UA: 302 to link.ios (App Store)
else
Page-->>UA: 302 to link.url
end
end
end
rect rgba(200,230,255,0.18)
Note over Page,DB: New/expanded selection and AASA-based gating
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (7)
💤 Files with no reviewable changes (5)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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). (2)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
packages/prisma/schema/link.prisma (1)
67-69: Align Domain side with an explicit back-reference.If you adopt the relation name above, update Domain.links accordingly (see domain.prisma). Keeps the schema unambiguous and self-documenting.
🧹 Nitpick comments (3)
packages/prisma/schema/link.prisma (1)
67-69: RelationMode is “prisma”—DB‐level FK risk is mitigated; optional relation naming for clarity
- Your datasource is configured with
relationMode = "prisma", so Prisma will not emit actual database foreign keys for this relation. Migrations therefore won’t fail due to missingDomain.slugentries.- You still may want to name the
Link↔Domainrelation for readability and future-proofing (especially if you ever add anotherLink→Domainrelation).Optional refactor—add a relation name:
- // Link short domain - shortDomain Domain? @relation(fields: [domain], references: [slug]) + // Link short domain + shortDomain Domain? @relation("ShortDomain", fields: [domain], references: [slug])No other
Link↔Domainrelations exist, so"ShortDomain"won’t collide. This change is purely cosmetic and safe to defer or omit.packages/prisma/schema/domain.prisma (1)
19-21: Name the back-reference to match Link.shortDomain.This pairs the relation explicitly and avoids future ambiguity.
Apply:
- links Link[] + links Link[] @relation("ShortDomain")apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx (1)
42-46: Constrain redirect protocols to http(s) only.If
link.ioscould ever contain a custom scheme, Next.js redirect may reject it or create UX inconsistencies. Gate to http(s) and fall back tolink.url.Apply:
- if (!link.shortDomain?.appleAppSiteAssociation) { - redirect(link.ios ?? link.url); - } + if (!link.shortDomain?.appleAppSiteAssociation) { + const dest = link.ios?.startsWith("http") ? link.ios : link.url; + redirect(dest); + }
📜 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.
📒 Files selected for processing (3)
apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx(2 hunks)packages/prisma/schema/domain.prisma(1 hunks)packages/prisma/schema/link.prisma(1 hunks)
🔇 Additional comments (2)
packages/prisma/schema/domain.prisma (1)
14-15: LGTM — field reorder only.No functional change; unlikely to produce a migration in Prisma.
apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx (1)
18-35: Query shape looks good; minimal fields and nested select.The select matches the new Prisma relation and keeps payload lean.
Ensure
prisma generatehas been run after the schema changes soshortDomainis available on the client types.
Summary by CodeRabbit
New Features
Bug Fixes
UI Changes