Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughRemoved the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (12)
💤 Files with no reviewable changes (3)
🧰 Additional context used📓 Path-based instructions (16)apps/web/**/*.{ts,tsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/app/**/*.{ts,tsx}📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
apps/web/**/*.tsx📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)
Files:
apps/web/app/(app)/*/page.tsx📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)
Files:
apps/web/app/(app)/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/page-structure.mdc)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)
Files:
**/*.{tsx,ts}📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.{tsx,ts,css}📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.tsx📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
**/*.{jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
!(pages/_document).{jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Files:
**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
Files:
apps/web/components/**/*.tsx📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
Files:
**/{pages,routes,components}/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/gmail-api.mdc)
Files:
🧠 Learnings (6)📚 Learning: 2025-11-25T14:38:23.265ZApplied to files:
📚 Learning: 2025-11-25T14:38:23.265ZApplied to files:
📚 Learning: 2025-11-25T14:38:18.874ZApplied to files:
📚 Learning: 2025-11-25T14:38:18.874ZApplied to files:
📚 Learning: 2025-07-08T13:14:07.449ZApplied to files:
📚 Learning: 2025-11-25T14:38:56.992ZApplied to files:
🧬 Code graph analysis (9)apps/web/app/(app)/admin/page.tsx (1)
apps/web/app/(app)/license/page.tsx (1)
apps/web/app/(app)/[emailAccountId]/cold-email-blocker/page.tsx (1)
apps/web/app/(app)/[emailAccountId]/calendars/page.tsx (1)
apps/web/app/(app)/organization/[organizationId]/page.tsx (1)
apps/web/app/(app)/accounts/page.tsx (1)
apps/web/app/(app)/[emailAccountId]/settings/page.tsx (1)
apps/web/components/PageHeader.tsx (1)
apps/web/app/(app)/[emailAccountId]/integrations/page.tsx (1)
⏰ 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). (4)
🔇 Additional comments (9)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/web/utils/outlook/folders.ts(2 hunks)version.txt(1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
apps/web/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/web/CLAUDE.md)
apps/web/**/*.{ts,tsx}: Use TypeScript with strict null checks
Use@/path aliases for imports from project root
Use proper error handling with try/catch blocks
Format code with Prettier
Follow consistent naming conventions using PascalCase for components
Centralize shared types in dedicated type filesImport specific lodash functions rather than entire lodash library to minimize bundle size (e.g.,
import groupBy from 'lodash/groupBy')
Files:
apps/web/utils/outlook/folders.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/data-fetching.mdc)
**/*.{ts,tsx}: For API GET requests to server, use theswrpackage
Useresult?.serverErrorwithtoastErrorfrom@/components/Toastfor error handling in async operations
**/*.{ts,tsx}: Use wrapper functions for Gmail message operations (get, list, batch, etc.) from @/utils/gmail/message.ts instead of direct API calls
Use wrapper functions for Gmail thread operations from @/utils/gmail/thread.ts instead of direct API calls
Use wrapper functions for Gmail label operations from @/utils/gmail/label.ts instead of direct API calls
**/*.{ts,tsx}: For early access feature flags, create hooks using the naming conventionuse[FeatureName]Enabledthat return a boolean fromuseFeatureFlagEnabled("flag-key")
For A/B test variant flags, create hooks using the naming conventionuse[FeatureName]Variantthat define variant types, useuseFeatureFlagVariantKey()with type casting, and provide a default "control" fallback
Use kebab-case for PostHog feature flag keys (e.g.,inbox-cleaner,pricing-options-2)
Always define types for A/B test variant flags (e.g.,type PricingVariant = "control" | "variant-a" | "variant-b") and provide type safety through type casting
**/*.{ts,tsx}: Don't use primitive type aliases or misleading types
Don't use empty type parameters in type aliases and interfaces
Don't use this and super in static contexts
Don't use any or unknown as type constraints
Don't use the TypeScript directive @ts-ignore
Don't use TypeScript enums
Don't export imported variables
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions
Don't use TypeScript namespaces
Don't use non-null assertions with the!postfix operator
Don't use parameter properties in class constructors
Don't use user-defined types
Useas constinstead of literal types and type annotations
Use eitherT[]orArray<T>consistently
Initialize each enum member value explicitly
Useexport typefor types
Use `impo...
Files:
apps/web/utils/outlook/folders.ts
**/{server,api,actions,utils}/**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/logging.mdc)
**/{server,api,actions,utils}/**/*.ts: UsecreateScopedLoggerfrom "@/utils/logger" for logging in backend code
Add thecreateScopedLoggerinstantiation at the top of the file with an appropriate scope name
Use.with()method to attach context variables only within specific functions, not on global loggers
For large functions with reused variables, usecreateScopedLogger().with()to attach context once and reuse the logger without passing variables repeatedly
Files:
apps/web/utils/outlook/folders.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/prisma-enum-imports.mdc)
Always import Prisma enums from
@/generated/prisma/enumsinstead of@/generated/prisma/clientto avoid Next.js bundling errors in client componentsImport Prisma using the project's centralized utility:
import prisma from '@/utils/prisma'
Files:
apps/web/utils/outlook/folders.ts
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/security.mdc)
**/*.ts: ALL database queries MUST be scoped to the authenticated user/account by including user/account filtering in WHERE clauses to prevent unauthorized data access
Always validate that resources belong to the authenticated user before performing operations, using ownership checks in WHERE clauses or relationships
Always validate all input parameters for type, format, and length before using them in database queries
Use SafeError for error responses to prevent information disclosure. Generic error messages should not reveal internal IDs, logic, or resource ownership details
Only return necessary fields in API responses using Prisma'sselectoption. Never expose sensitive data such as password hashes, private keys, or system flags
Prevent Insecure Direct Object References (IDOR) by validating resource ownership before operations. AllfindUnique/findFirstcalls MUST include ownership filters
Prevent mass assignment vulnerabilities by explicitly whitelisting allowed fields in update operations instead of accepting all user-provided data
Prevent privilege escalation by never allowing users to modify system fields, ownership fields, or admin-only attributes through user input
AllfindManyqueries MUST be scoped to the user's data by including appropriate WHERE filters to prevent returning data from other users
Use Prisma relationships for access control by leveraging nested where clauses (e.g.,emailAccount: { id: emailAccountId }) to validate ownership
Files:
apps/web/utils/outlook/folders.ts
**/*.{tsx,ts}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
**/*.{tsx,ts}: Use Shadcn UI and Tailwind for components and styling
Usenext/imagepackage for images
For API GET requests to server, use theswrpackage with hooks likeuseSWRto fetch data
For text inputs, use theInputcomponent withregisterPropsfor form integration and error handling
Files:
apps/web/utils/outlook/folders.ts
**/*.{tsx,ts,css}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Implement responsive design with Tailwind CSS using a mobile-first approach
Files:
apps/web/utils/outlook/folders.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{js,jsx,ts,tsx}: Don't useaccessKeyattribute on any HTML element
Don't setaria-hidden="true"on focusable elements
Don't add ARIA roles, states, and properties to elements that don't support them
Don't use distracting elements like<marquee>or<blink>
Only use thescopeprop on<th>elements
Don't assign non-interactive ARIA roles to interactive HTML elements
Make sure label elements have text content and are associated with an input
Don't assign interactive ARIA roles to non-interactive HTML elements
Don't assigntabIndexto non-interactive HTML elements
Don't use positive integers fortabIndexproperty
Don't include "image", "picture", or "photo" in img alt prop
Don't use explicit role property that's the same as the implicit/default role
Make static elements with click handlers use a valid role attribute
Always include atitleelement for SVG elements
Give all elements requiring alt text meaningful information for screen readers
Make sure anchors have content that's accessible to screen readers
AssigntabIndexto non-interactive HTML elements witharia-activedescendant
Include all required ARIA attributes for elements with ARIA roles
Make sure ARIA properties are valid for the element's supported roles
Always include atypeattribute for button elements
Make elements with interactive roles and handlers focusable
Give heading elements content that's accessible to screen readers (not hidden witharia-hidden)
Always include alangattribute on the html element
Always include atitleattribute for iframe elements
AccompanyonClickwith at least one of:onKeyUp,onKeyDown, oronKeyPress
AccompanyonMouseOver/onMouseOutwithonFocus/onBlur
Include caption tracks for audio and video elements
Use semantic elements instead of role attributes in JSX
Make sure all anchors are valid and navigable
Ensure all ARIA properties (aria-*) are valid
Use valid, non-abstract ARIA roles for elements with ARIA roles
Use valid AR...
Files:
apps/web/utils/outlook/folders.ts
!(pages/_document).{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
Don't use the next/head module in pages/_document.js on Next.js projects
Files:
apps/web/utils/outlook/folders.tsversion.txt
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)
**/*.{js,ts,jsx,tsx}: Use lodash utilities for common operations (arrays, objects, strings)
Import specific lodash functions to minimize bundle size (e.g.,import groupBy from 'lodash/groupBy')
Files:
apps/web/utils/outlook/folders.ts
⏰ 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)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: test
🔇 Additional comments (2)
version.txt (1)
1-1: Version bump looks good.Standard version increment to v2.21.13.
apps/web/utils/outlook/folders.ts (1)
58-60: Consistent pagination limits applied.The changes correctly mirror the approach in
getOutlookRootFoldersby adding.top(999)at the top level and$top=999in the nested expand query. This ensures consistent behavior across both functions.The same pagination consideration from line 40 applies here: if child folders exceed 999 items at any level, remaining folders won't be fetched.
| .top(999) | ||
| .expand( | ||
| `childFolders($select=${fields};$expand=childFolders($select=${fields}))`, | ||
| `childFolders($select=${fields};$top=999;$expand=childFolders($select=${fields};$top=999))`, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's examine the full context of the file to understand the implementation
cat -n apps/web/utils/outlook/folders.ts | head -80Repository: elie222/inbox-zero
Length of output: 3109
🌐 Web query:
Microsoft Graph API mailFolders $top parameter maximum limit documentation
💡 Result:
Short answer — Microsoft’s official query-parameters doc: the $top minimum is 1 and "the maximum depends on the corresponding API" (no single global value). (learn.microsoft.com)
What that means for mailFolders:
- There is no explicit mailFolders-specific $top max documented on the v1.0 reference; behavior depends on the endpoint/version. (learn.microsoft.com)
- Community/Microsoft Q&A and examples report practical limits: mailFolders queries often use $top up to 250 (beta examples) and message/folder-listing scenarios commonly cap page sizes at 999 (or 1000 rejected; i.e. max 999) for many list endpoints. Use paging (@odata.nextLink) rather than requesting very large pages. (stackoverflow.com)
If you want, I can check a specific endpoint/version (v1.0 vs beta) and return exact observed limits and a test URL for that endpoint.
Citations:
- 1: https://learn.microsoft.com/en-us/graph//query-parameters?utm_source=openai
- 2: https://learn.microsoft.com/en-us/graph//query-parameters?utm_source=openai
- 3: https://stackoverflow.com/questions/42901755/microsoft-graph-outlook-mail-list-all-mail-folders-not-just-the-top-level-o?utm_source=openai
🏁 Script executed:
# Check if pagination (@odata.nextLink) is handled anywhere in the outlook utilities
rg -n "nextLink|@odata" apps/web/utils/outlook/Repository: elie222/inbox-zero
Length of output: 1982
🏁 Script executed:
# Check if there's pagination handling in the response types or retry logic
rg -n "nextLink|@odata" apps/web/utils/outlook/retry.ts apps/web/utils/outlook/client.tsRepository: elie222/inbox-zero
Length of output: 44
🏁 Script executed:
# Look for how this file is used to understand if pagination is expected at a higher level
rg -n "getOutlookRootFolders|getOutlookChildFolders" apps/web/ -A 3 -B 1Repository: elie222/inbox-zero
Length of output: 3533
🏁 Script executed:
# Check if the test file has any pagination test scenarios
cat -n apps/web/utils/outlook/folders.test.ts | grep -i "999\|nextlink\|pagination\|limit" -A 3 -B 3Repository: elie222/inbox-zero
Length of output: 44
🏁 Script executed:
# Let's see more of the folders.test.ts file to understand test coverage
wc -l apps/web/utils/outlook/folders.test.tsRepository: elie222/inbox-zero
Length of output: 104
🏁 Script executed:
# Look at the test file to see if it covers >999 folder scenario
tail -200 apps/web/utils/outlook/folders.test.tsRepository: elie222/inbox-zero
Length of output: 5079
Missing pagination handling for folders exceeding 999 items.
The $top=999 parameter is appropriate for Microsoft Graph API mailFolders queries. However, unlike other Outlook utilities in the codebase (e.g., message.ts, thread.ts, batch.ts), getOutlookRootFolders and getOutlookChildFolders do not handle @odata.nextLink pagination. If any folder has more than 999 children, remaining children are silently dropped, contradicting the PR's goal of "loading all Outlook folders."
Required fix: Implement pagination by:
- Declaring the response type with
"@odata.nextLink"?: string - Looping through pages using
@odata.nextLinkuntil exhausted (follow the pattern inapps/web/utils/outlook/message.tslines 208-218) - Accumulating all folder results before returning
This is particularly important for the nested expand queries at lines 40 and 60, where deeply nested folders could exceed the limit at multiple levels.
🤖 Prompt for AI Agents
In apps/web/utils/outlook/folders.ts around line 40, the requests use `$top=999`
without handling `@odata.nextLink`, so folders >999 children are dropped;
declare the response type to include `"@odata.nextLink"?: string`, perform a
loop that follows `@odata.nextLink` (mirror the pattern in
apps/web/utils/outlook/message.ts lines 208-218) to fetch subsequent pages,
accumulate all folder results into a single array before returning, and apply
the same pagination handling for the nested `childFolders($expand=...)`
responses so deeply nested pages are also fully retrieved.
Load all Outlook folders by setting
utils/outlook/folders.getOutlookRootFoldersandutils/outlook/folders.getOutlookChildFoldersto request up to 999 child folders per levelRemove
descriptionsupport fromPageHeaderand update pages to pass onlytitle; increase Outlook folder fetch limits to 999 per level in apps/web/utils/outlook/folders.ts.📍Where to Start
Start with the Outlook folder fetching changes in apps/web/utils/outlook/folders.ts, then review the
PageHeaderprop update in apps/web/components/PageHeader.tsx.Macroscope summarized 4485c6f.
Summary by CodeRabbit
Bug Fixes
Chores / UI
✏️ Tip: You can customize this high-level summary in your review settings.