-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: revalidate every 60s #1833
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
WalkthroughUpdated getStaticProps in three page files to change ISR behavior: when neither brand nor recordMap is present, revalidate switches from false to 60 seconds; when present, it remains 10 seconds. No other logic, exports, or signatures changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
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. ✨ 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 (
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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: 0
🧹 Nitpick comments (3)
pages/view/domains/[domain]/[slug]/d/[documentId].tsx (1)
288-289: Optional: Centralize ISR values to avoid drift across filesThis same ternary appears in 3 places. Consider extracting constants to keep the values consistent and easier to tweak.
Apply this minimal diff here:
- revalidate: brand || recordMap ? 10 : 60, + revalidate: + (brand || recordMap) ? ISR_REVALIDATE_BRANDED : ISR_REVALIDATE_UNBRANDED,And add (outside this hunk) a small constants module and import:
TypeScript (new file):
// src/lib/isr.ts export const ISR_REVALIDATE_BRANDED = 10; export const ISR_REVALIDATE_UNBRANDED = 60;Add import at top of this file:
import { ISR_REVALIDATE_BRANDED, ISR_REVALIDATE_UNBRANDED } from "@/lib/isr";pages/view/[linkId]/index.tsx (1)
157-158: Optional: Consolidate ISR values via shared constantsSame suggestion as in the other files to reduce duplication and prevent accidental divergence.
Apply this minimal diff here:
- revalidate: brand || recordMap ? 10 : 60, + revalidate: + (brand || recordMap) ? ISR_REVALIDATE_BRANDED : ISR_REVALIDATE_UNBRANDED,Add (outside this hunk) the shared constants and import:
// src/lib/isr.ts export const ISR_REVALIDATE_BRANDED = 10; export const ISR_REVALIDATE_UNBRANDED = 60;import { ISR_REVALIDATE_BRANDED, ISR_REVALIDATE_UNBRANDED } from "@/lib/isr";pages/view/[linkId]/d/[documentId].tsx (1)
270-271: Optional: Factor out ISR constants for consistencyMirroring the other files will keep these values aligned and easier to adjust.
Apply this minimal diff here:
- revalidate: brand || recordMap ? 10 : 60, + revalidate: + (brand || recordMap) ? ISR_REVALIDATE_BRANDED : ISR_REVALIDATE_UNBRANDED,Add (outside this hunk) the shared constants and import:
// src/lib/isr.ts export const ISR_REVALIDATE_BRANDED = 10; export const ISR_REVALIDATE_UNBRANDED = 60;import { ISR_REVALIDATE_BRANDED, ISR_REVALIDATE_UNBRANDED } from "@/lib/isr";
📜 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)
pages/view/[linkId]/d/[documentId].tsx(1 hunks)pages/view/[linkId]/index.tsx(1 hunks)pages/view/domains/[domain]/[slug]/d/[documentId].tsx(1 hunks)
🔇 Additional comments (4)
pages/view/domains/[domain]/[slug]/d/[documentId].tsx (1)
288-289: LGTM: ISR fallback now refreshes every 60s instead of disabling revalidationSwitching from
falseto60for the unbranded/non‑Notion path prevents pages from going stale indefinitely and lets them self-heal within a minute. This aligns with the PR objective without altering any data-loading semantics.pages/view/[linkId]/index.tsx (2)
157-158: LGTM: Document-link pages now revalidate every 60s when unbranded/no recordMapThe change matches the stated intent and should reduce long-lived stale content for static (non‑Notion) docs. Branded/Notion pages remain at 10s.
157-158: Confirm DATAROOM_LINK revalidate policy• In pages/view/[linkId]/index.tsx at line 230 you’ve hard-coded
revalidate: 10, whereas the main return (line 157) usesrevalidate: brand || recordMap ? 10 : 60,If your intent is to keep “10 s for branded/recorded pages, 60 s otherwise” across all branches, update the DATAROOM_LINK branch to the same conditional. Otherwise, please confirm that always using 10 s there is deliberate.
@@ pages/view/[linkId]/index.tsx:229 - revalidate: 10, + revalidate: brand || recordMap ? 10 : 60,pages/view/[linkId]/d/[documentId].tsx (1)
270-271: LGTM: Dataroom document pages now revalidate every 60s when unbranded/no recordMapMatches the new policy while keeping 10s for branded/Notion content. No changes to data flow or types.
Summary by CodeRabbit