Conversation
Signed-off-by: prxt6529 <prxt@6529.io>
|
Warning Rate limit exceeded@prxt6529 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 0 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
WalkthroughAdded Sentry tunnel/monitoring error suppression and moved filtering into typed probe helpers; centralized client instrumentation network/error normalization; hardened fetch + JSON error handling; stabilized per-part keys and animation container in drop components; adjusted drop finalization to avoid placeholder parts; small defensive clipboard fix; tests and docs updated. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as App (Sentry SDK)
participant ServerConfig as sentry.server/edge.config
participant Probe as config/sentryProbes
participant Before as instrumentation-client.beforeSend
Note over App: Error/event emitted
App->>ServerConfig: beforeSend(event, hint)
ServerConfig->>Probe: filterTunnelRouteErrors(event, hint)
alt Filtered out
Probe-->>ServerConfig: null
ServerConfig-->>App: null
else Not filtered
Probe-->>ServerConfig: filteredEvent
ServerConfig->>Before: pass filteredEvent
Before->>Before: shouldFilterEvent / handleNetworkError / fingerprinting
Before-->>ServerConfig: processedEvent
ServerConfig-->>App: processedEvent
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
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: 0
🧹 Nitpick comments (1)
components/waves/CreateDropStormParts.tsx (1)
31-39: StablepartKeysimprove list rendering; consider intrinsic IDsThe memoized
partKeysand updatedkey={partKeys[partIndex]}give more predictable keys for Framer Motion than ad‑hoc content keys. This assumespartsis updated immutably; otherwisepartKeyscan drift fromparts.length. IfCreateDropPartalready exposes a stable identifier (e.g.idortempId), using that directly for keys would be even more robust thanindex/media.length.Please verify:
partsis always replaced, not mutated in place, when adding/removing parts.- Whether
CreateDropParthas a stable id property you could use instead of index/length for keys.Also applies to: 73-92
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
AGENTS.md(1 hunks)components/waves/CreateDropStormParts.tsx(4 hunks)components/waves/drops/wave-drops-all/hooks/useWaveDropsClipboard.ts(1 hunks)instrumentation-client.ts(2 hunks)services/api/common-api.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version
**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed sincemainvianpm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) vianpm run lint
Use<Link>from Next.js for internal navigation instead of<a>tags or HTML anchors
Use<Image>fromnext/imageinstead of HTML<img>elements
Files:
components/waves/drops/wave-drops-all/hooks/useWaveDropsClipboard.tsinstrumentation-client.tsservices/api/common-api.tscomponents/waves/CreateDropStormParts.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All code must pass TypeScript type checking vianpm run type-check(tsc --noEmit)
Use'use cache'directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16
Files:
components/waves/drops/wave-drops-all/hooks/useWaveDropsClipboard.tsinstrumentation-client.tsservices/api/common-api.tscomponents/waves/CreateDropStormParts.tsx
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always addreadonlybefore props in React components
Files:
components/waves/CreateDropStormParts.tsx
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: Applies to app/api/**/*.{ts,tsx,js,jsx} : Catch `UrlGuardError` explicitly if returning a tailored response; otherwise let it bubble so the caller can surface the correct status code.
Applied to files:
services/api/common-api.ts
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: Applies to app/api/**/*.{ts,tsx,js,jsx} : When needing custom headers or timeouts for external requests, pass them via `@/lib/security/urlGuard` helper options rather than re-implementing your own wrapper.
Applied to files:
services/api/common-api.ts
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: Applies to app/api/**/*.{ts,tsx,js,jsx} : Never call `fetch` directly with user-controlled or scraped URLs. Use helpers from `@/lib/security/urlGuard` (`parsePublicUrl`, `assertPublicUrl`, `fetchPublicUrl`, `fetchPublicJson`) to validate URLs against host/IP allowlists and DNS checks before making network requests.
Applied to files:
services/api/common-api.ts
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: Applies to app/api/**/*.{ts,tsx,js,jsx} : Follow the project default responses (`NextResponse.json`) and reuse existing util modules instead of duplicating logic.
Applied to files:
services/api/common-api.ts
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: Applies to app/api/**/*.{ts,tsx} : Use TypeScript types for request parameters and responses; avoid `any` unless a 3rd-party payload truly has no shape guarantees.
Applied to files:
services/api/common-api.ts
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Include all required imports and ensure proper naming of key components
Applied to files:
components/waves/CreateDropStormParts.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
Applied to files:
components/waves/CreateDropStormParts.tsxAGENTS.md
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Use TypeScript and React functional components with hooks
Applied to files:
components/waves/CreateDropStormParts.tsx
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: All changes must pass the same commands listed in the top-level AGENTS.md: `npm run test`, `npm run lint`, and `npm run type-check` (or the targeted `test:cov:changed` when appropriate).
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to {middleware,proxy}.ts : Request boundary logic using `middleware.ts` should be renamed to `proxy.ts` with exported `proxy` function (Node runtime); legacy `middleware.ts` is only for edge-only cases
Applied to files:
AGENTS.md
🧬 Code graph analysis (1)
components/waves/CreateDropStormParts.tsx (1)
__mocks__/react-use.js (1)
React(2-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). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
components/waves/drops/wave-drops-all/hooks/useWaveDropsClipboard.ts (1)
1124-1150: Defensive key check inhandleKeyDownis soundThe added
typeof event.key === "string"guard safely prevents.toLowerCasefrom throwing while preserving existing behavior for normal keyboard events.services/api/common-api.ts (1)
58-113: Improved error handling inexecuteApiRequestlooks correctThe new
try/catchkeeps HTTP semantics (non‑OK viahandleApiError), preserves abort behavior, adds guarded JSON parsing, and surfaces clearer network errors while respectingparseJson === false. No functional regressions evident.Please ensure you have tests (or add them) covering:
parseJson: false(no JSON parsing),- invalid JSON bodies (new “Failed to parse response as JSON…” error),
- aborted requests vs real network failures (TypeError mapping).
instrumentation-client.ts (1)
16-25: Sentry noise filters are well‑scoped and consistentCentralizing
noisyPatterns,referenceErrors, andfilenameExceptionsand using them inbeforeSendto drop known noisy events (e.g. ResizeObserver, Firefox/inpage.js/extension noise) is consistent with the new AGENTS.md Sentry guidance, while preserving IndexedDB tagging behavior.Please double‑check against Sentry docs for
beforeSendin@sentry/nextjsthat:
- returning
nullstill reliably drops events,- these same filters (patterns/filenames) are mirrored in
sentry.server.config.tsandsentry.edge.config.tswhere appropriate.Also applies to: 52-79
AGENTS.md (1)
96-137: Sentry error‑handling playbook is clear and aligned with codeThe new section establishes a fix‑first workflow, defines where silencing belongs, and matches the filtering patterns added in
instrumentation-client.ts. Good central reference for future Sentry work.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
components/waves/CreateDropStormParts.tsx (2)
31-55: Stable key generation works but is still index-coupled; also easy Sonar clean-upThe
partIdCounterRef/partIdsRef+useMemoapproach gives stable keys for non-quoted parts across content edits and re-renders, and uses deterministic IDs for quoted drops, which is a solid improvement.Two points to consider:
Index-coupled behavior on insertion/removal in the middle
Keys for non-quoted parts are effectively tied to their array index. If a part is removed or inserted anywhere except at the end, subsequent parts inherit different keys than before (e.g., removing index 0 shifts keys for all following items). That can cause React to reuse DOM/state between logically different parts. If the UI allows middle insertions/reordering, you may want a per-part stable identifier onCreateDropPart(e.g.,localId) and use that as the key source instead of positional refs.Assumption about immutable
partsupdates
useMemois keyed only on thepartsreference. If a parent mutates the existing array in place (same reference, different contents),partKeyswill not recompute andpartKeys[partIndex]may become undefined or stale. This is fine ifpartsis always updated immutably (new array on change), but worth double‑checking upstream.You can also satisfy the Sonar warning and slightly simplify the control flow by turning the nested
ifin theelseinto anelse if:- parts.forEach((part, index) => { - if (part.quoted_drop) { - const quotedKey = `quoted-${part.quoted_drop.drop_id}-${part.quoted_drop.drop_part_id}`; - keys.push(quotedKey); - } else { - if (index < partIdsRef.current.length) { - keys.push(partIdsRef.current[index]); - } else { - const newId = `part-${partIdCounterRef.current++}`; - partIdsRef.current[index] = newId; - keys.push(newId); - } - } - }); + parts.forEach((part, index) => { + if (part.quoted_drop) { + const quotedKey = `quoted-${part.quoted_drop.drop_id}-${part.quoted_drop.drop_part_id}`; + keys.push(quotedKey); + } else if (index < partIdsRef.current.length) { + keys.push(partIdsRef.current[index]); + } else { + const newId = `part-${partIdCounterRef.current++}`; + partIdsRef.current[index] = newId; + keys.push(newId); + } + });Please confirm that
partsis always updated immutably (new array instance on any change) and that you don’t support arbitrary reordering/middle insertions for non‑quoted parts. If either of those assumptions doesn’t hold, we should revisit the keying strategy.
90-91: AnimatePresence wrapper and key usage are consistent; just ensure key array stays in syncWrapping the mapped
motion.divs in<AnimatePresence mode="popLayout">is appropriate, and usingkey={partKeys[partIndex]}cleanly applies the precomputed stable keys.Two small follow‑ups:
- Because
partKeysis derived fromparts, it should always have the same length asparts. If upstream ever mutatespartsin place (same reference),partKeys[partIndex]could becomeundefined. This ties back to the immutability assumption noted in the key-generation block.mode="popLayout"relies on the framer‑motion version supporting this prop/value; worth quickly confirming your installed version to avoid runtime warnings.If you’d like, I can sketch an alternative where
partKeysis recomputed every render (droppinguseMemo) but still backed by the same refs, which would make it robust even ifpartsis mutated in place.Also applies to: 94-94, 108-109
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/waves/CreateDropStormParts.tsx(4 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version
**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed sincemainvianpm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) vianpm run lint
Use<Link>from Next.js for internal navigation instead of<a>tags or HTML anchors
Use<Image>fromnext/imageinstead of HTML<img>elements
Files:
components/waves/CreateDropStormParts.tsx
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always addreadonlybefore props in React components
Files:
components/waves/CreateDropStormParts.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All code must pass TypeScript type checking vianpm run type-check(tsc --noEmit)
Use'use cache'directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16
Files:
components/waves/CreateDropStormParts.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
Applied to files:
components/waves/CreateDropStormParts.tsx
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Include all required imports and ensure proper naming of key components
Applied to files:
components/waves/CreateDropStormParts.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Use TypeScript and React functional components with hooks
Applied to files:
components/waves/CreateDropStormParts.tsx
🪛 GitHub Check: SonarCloud Code Analysis
components/waves/CreateDropStormParts.tsx
[warning] 42-42: 'If' statement should not be the only statement in 'else' block
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (1)
components/waves/CreateDropStormParts.tsx (1)
7-9: Imports and Next.js usage look correct
Linkfromnext/link, the React default import,AuthContext, andCreateDropStormPartare wired correctly and align with the Next.js/React setup. No issues here.Also applies to: 13-13
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/waves/CreateDropStormParts.tsx (1)
34-55: Refactor nestediftoelse ifand verify key stability for mid-list removals.The SonarCloud warning about nested
ifinelsecan be addressed by flattening toelse if. Additionally, the index-based ID reuse may cause key instability when parts are removed from the middle—subsequent parts would inherit incorrect keys, potentially causing unexpected remounts or animation glitches.Apply this diff to address the SonarCloud hint:
parts.forEach((part, index) => { if (part.quoted_drop) { const quotedKey = `quoted-${part.quoted_drop.drop_id}-${part.quoted_drop.drop_part_id}`; keys.push(quotedKey); - } else { - if (index < partIdsRef.current.length) { - keys.push(partIdsRef.current[index]); - } else { - const newId = `part-${partIdCounterRef.current++}`; - partIdsRef.current[index] = newId; - keys.push(newId); - } + } else if (index < partIdsRef.current.length) { + keys.push(partIdsRef.current[index]); + } else { + const newId = `part-${partIdCounterRef.current++}`; + partIdsRef.current[index] = newId; + keys.push(newId); } });Please verify that parts are typically only added/removed from the end, or consider whether a
WeakMap-based approach (mapping part objects to stable IDs) would better handle mid-list mutations.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
AGENTS.md(2 hunks)components/waves/CreateDropStormParts.tsx(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- AGENTS.md
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version
**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed sincemainvianpm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) vianpm run lint
Use<Link>from Next.js for internal navigation instead of<a>tags or HTML anchors
Use<Image>fromnext/imageinstead of HTML<img>elements
Files:
components/waves/CreateDropStormParts.tsx
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always addreadonlybefore props in React components
Files:
components/waves/CreateDropStormParts.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All code must pass TypeScript type checking vianpm run type-check(tsc --noEmit)
Use'use cache'directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16
Files:
components/waves/CreateDropStormParts.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
Applied to files:
components/waves/CreateDropStormParts.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Use TypeScript and React functional components with hooks
Applied to files:
components/waves/CreateDropStormParts.tsx
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Include all required imports and ensure proper naming of key components
Applied to files:
components/waves/CreateDropStormParts.tsx
🧬 Code graph analysis (1)
components/waves/CreateDropStormParts.tsx (2)
components/auth/Auth.tsx (1)
AuthContext(83-93)helpers/Helpers.ts (1)
cicToType(485-503)
🪛 GitHub Check: SonarCloud Code Analysis
components/waves/CreateDropStormParts.tsx
[warning] 42-42: 'If' statement should not be the only statement in 'else' block
🔇 Additional comments (3)
components/waves/CreateDropStormParts.tsx (3)
7-9: LGTM!The switch to named imports (
FC,memo,useContext,useMemo,useRef) and direct hook usage aligns well with React 19.2 conventions and removes unnecessary namespace references.Also applies to: 22-22, 28-28
90-109: LGTM!The wrapper div with spacing classes and the switch to precomputed
partKeysis a cleaner approach than the previous content-based key. TheAnimatePresenceconfiguration is preserved correctly.
117-117: LGTM!Consistent use of the named
memoimport.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
components/waves/CreateDropContent.tsx (1)
877-879: Eliminate duplicated storm-mode logic.The logic at lines 877-879 duplicates the same computation from
createCurrentDrop(lines 612-614). This violates the DRY principle and increases maintenance burden.Extract this logic into a helper function or use the prop directly if appropriate:
+const hasExistingParts = (drop: CreateDropConfig | null): boolean => + (drop?.parts.length ?? 0) > 0;Then reference it in both locations:
- const isStormMode = (drop?.parts.length ?? 0) > 0; - const hasCurrentContent = !!(getMarkdown?.trim().length || files.length); + const hasParts = hasExistingParts(drop); + const hasContent = !!(getMarkdown?.trim().length || files.length); - if (isStormMode && hasCurrentContent) { + if (hasParts && hasContent) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/waves/CreateDropContent.tsx(2 hunks)components/waves/CreateDropStormParts.tsx(4 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version
**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed sincemainvianpm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) vianpm run lint
Use<Link>from Next.js for internal navigation instead of<a>tags or HTML anchors
Use<Image>fromnext/imageinstead of HTML<img>elements
Files:
components/waves/CreateDropStormParts.tsxcomponents/waves/CreateDropContent.tsx
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always addreadonlybefore props in React components
Files:
components/waves/CreateDropStormParts.tsxcomponents/waves/CreateDropContent.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All code must pass TypeScript type checking vianpm run type-check(tsc --noEmit)
Use'use cache'directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16
Files:
components/waves/CreateDropStormParts.tsxcomponents/waves/CreateDropContent.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
Applied to files:
components/waves/CreateDropStormParts.tsx
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Include all required imports and ensure proper naming of key components
Applied to files:
components/waves/CreateDropStormParts.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Use TypeScript and React functional components with hooks
Applied to files:
components/waves/CreateDropStormParts.tsx
🧬 Code graph analysis (1)
components/waves/CreateDropStormParts.tsx (2)
components/auth/Auth.tsx (1)
AuthContext(83-93)helpers/Helpers.ts (1)
cicToType(485-503)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (1)
components/waves/CreateDropStormParts.tsx (1)
7-9: LGTM: Import modernization aligns with React 19.2 conventions.The changes to use named imports (
FC,memo,useContext) instead of the React namespace align with the project's modernization goals and coding guidelines. This makes the code more explicit and compatible with React 19.2 conventions.Based on learnings, this aligns with the guidance to modernize code for React 19.2, React Compiler, and Next.js 16 conventions.
Also applies to: 13-13, 22-22, 28-28, 115-115
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/waves/CreateDropStormParts.tsx (1)
42-66: Ref mutation moved out of render phase - good fix!The previous review correctly identified that mutating
partIdCounterRef.currentinsideuseMemoviolates React's rendering contract. Moving the mutation touseEffectis the right approach.However, the index-based ID mapping (
newMap.has(index)) may cause key instability if parts are removed from the middle of the array. For example:
- Parts: [A, B, C] with IDs at indices {0: "part-0", 1: "part-1", 2: "part-2"}
- Remove B: [A, C] → index 1 now maps to "part-1" but refers to part C
- Part C's key changes from "part-2" to "part-1"
This could cause unexpected re-mounts. Consider tracking IDs by a stable part identity (e.g., content hash or a generated ID stored on the part object itself) rather than by array index.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/waves/CreateDropContent.tsx(2 hunks)components/waves/CreateDropStormParts.tsx(4 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version
**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed sincemainvianpm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) vianpm run lint
Use<Link>from Next.js for internal navigation instead of<a>tags or HTML anchors
Use<Image>fromnext/imageinstead of HTML<img>elements
Files:
components/waves/CreateDropStormParts.tsxcomponents/waves/CreateDropContent.tsx
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always addreadonlybefore props in React components
Files:
components/waves/CreateDropStormParts.tsxcomponents/waves/CreateDropContent.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All code must pass TypeScript type checking vianpm run type-check(tsc --noEmit)
Use'use cache'directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16
Files:
components/waves/CreateDropStormParts.tsxcomponents/waves/CreateDropContent.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
Applied to files:
components/waves/CreateDropStormParts.tsxcomponents/waves/CreateDropContent.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Use TypeScript and React functional components with hooks
Applied to files:
components/waves/CreateDropStormParts.tsx
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Include all required imports and ensure proper naming of key components
Applied to files:
components/waves/CreateDropStormParts.tsx
🧬 Code graph analysis (1)
components/waves/CreateDropStormParts.tsx (2)
components/auth/Auth.tsx (1)
AuthContext(83-93)helpers/Helpers.ts (1)
cicToType(485-503)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (5)
components/waves/CreateDropContent.tsx (2)
612-632: LGTM! The variable shadowing issue has been resolved.The renaming from
isStormModetohasPartsInDropaddresses the previous review concern about shadowing the component prop. The two-flag approach (hasPartsInDropandhasCurrentContent) clearly expresses intent and the conditional logic for part construction is sound.
876-883: Verify intended UX: submit button finalizes content instead of submitting.When the user has existing parts and new content, clicking submit will finalize the current content into a new part but won't actually submit the drop. The user must click submit again to send.
This may be intentional for storm mode workflow, but consider whether users might expect a single submit action. If this is the desired behavior, a UI indicator or toast message could help clarify that content was added to the storm rather than submitted.
components/waves/CreateDropStormParts.tsx (3)
7-17: LGTM! Import style aligns with React 19 conventions.Direct named imports from
reactinstead of namespace imports is the recommended approach per the project's modernization guidelines.
68-75: LGTM! Key computation is now side-effect free.The
useMemohook correctly only reads from state (partIdsMap) without any mutations, which is safe for React's concurrent rendering model.
110-128: LGTM! Stable keys improve animation behavior.Using computed
partKeysfor the motion.div key ensures stable identity across renders. The wrapper div around AnimatePresence maintains proper layout structure.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
__tests__/components/notifications/NotificationsContext.test.tsx (1)
71-86: Consider grouping this test for better organization.This test is at the same level as the
describeblocks rather than nested within one. For consistency and better test organization, consider moving it inside the"NotificationsContext"describe block.instrumentation-client.ts (1)
93-134: Network TypeError normalization is solid; consider tiny regex tweak for SonarThe new block that:
- Detects
TypeErrornetwork failures (load failed/failed to fetch/network),- Derives a best-effort URL from the message, fetch breadcrumbs, or
event.request.url,- Rewrites the message, downgrades level to
"warning", and tags/fingerprints as a"network"error,is coherent and should significantly reduce noisy network exceptions while keeping them observable.
Sonar’s warning about
String.matchcan be resolved with a minimal change if you want a clean report:- const urlMatch = error.message.match(/\(([^)]+)\)/); + const urlMatch = /\(([^)]+)\)/.exec(error.message);Functionally this is equivalent but satisfies the rule.
config/sentryProbes.ts (1)
19-67: Tunnel/monitoring abort filtering works; consider light refactors for types & complexityThe logic here correctly targets noisy aborted/ECONNRESET/socket‑hang‑up errors originating from monitoring/tunnel routes (via URL and stack frame checks) and returns
nullonly in those narrow cases, which matches how it is used in the server/edgebeforeSendhooks.If you’d like to address the Sonar feedback and tighten things up:
- Simplify the return type to avoid
any | nullSince callers already treat the result as “Sentry event or
null”, the union withanydoesn’t buy much and is what Sonar is complaining about. Two options:
Minimal change (keeps current behavior, silences the union rule):
export function filterTunnelRouteErrors(event: any, hint?: any): any { // keep returning either an event object or null at runtime }(Callers still explicitly check
filtered === null.)Or, better, replace
anywith the appropriate Sentry event/hint types from the Sentry TS API so the signature reflectsEvent | nullinstead ofany. Please confirm the exact type names/paths for@sentry/nextjsin your version before changing this.
- Reduce cognitive complexity by extracting predicates
You can make
filterTunnelRouteErrorsmuch flatter and easier to scan by pushing the nested checks into small helpers, e.g.:function isMonitoringAbortByMessage(event: any, value: any, message: string): boolean { /* current first block */ } function isMonitoringAbortByHint(event: any, message: string, errorType: string, hint?: any): boolean { /* current second block */ } export function filterTunnelRouteErrors(event: any, hint?: any): any { const value = event.exception?.values?.[0]; const message = value?.value || ""; const errorType = value?.type || ""; if (isMonitoringAbortByMessage(event, value, message)) return null; if (isMonitoringAbortByHint(event, message, errorType, hint)) return null; return event; }This should bring the Cognitive Complexity of the main function below Sonar’s threshold without changing behavior.
Please re-run your static analysis (
SonarCloud,npm run lint, andnpm run type-check) after any signature or control-flow changes here to ensure the updated types align with@sentry/nextjs’sbeforeSendcontract and no new issues are introduced.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
__tests__/components/notifications/NotificationsContext.test.tsx(2 hunks)__tests__/components/waves/CreateDropStormParts.test.tsx(3 hunks)config/sentryProbes.ts(1 hunks)instrumentation-client.ts(3 hunks)sentry.edge.config.ts(2 hunks)sentry.server.config.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version
**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed sincemainvianpm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) vianpm run lint
Use<Link>from Next.js for internal navigation instead of<a>tags or HTML anchors
Use<Image>fromnext/imageinstead of HTML<img>elements
Files:
config/sentryProbes.tsinstrumentation-client.tssentry.server.config.tssentry.edge.config.ts__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
{.env*,*.env,**/config/**}
📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)
Configure Task Master behavior via environment variables: ANTHROPIC_API_KEY (required), MODEL, MAX_TOKENS, TEMPERATURE, DEBUG, LOG_LEVEL, DEFAULT_SUBTASKS, DEFAULT_PRIORITY, PROJECT_NAME, PROJECT_VERSION, PERPLEXITY_API_KEY, and PERPLEXITY_MODEL
Files:
config/sentryProbes.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All code must pass TypeScript type checking vianpm run type-check(tsc --noEmit)
Use'use cache'directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16
Files:
config/sentryProbes.tsinstrumentation-client.tssentry.server.config.tssentry.edge.config.ts__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always addreadonlybefore props in React components
Files:
__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
**/__tests__/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Tests should live in
__tests__/directory or be namedComponentName.test.tsx
Files:
__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to {middleware,proxy}.ts : Request boundary logic using `middleware.ts` should be renamed to `proxy.ts` with exported `proxy` function (Node runtime); legacy `middleware.ts` is only for edge-only cases
Applied to files:
config/sentryProbes.tssentry.server.config.tssentry.edge.config.ts
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: Applies to app/api/**/*.{ts,tsx,js,jsx} : Catch `UrlGuardError` explicitly if returning a tailored response; otherwise let it bubble so the caller can surface the correct status code.
Applied to files:
config/sentryProbes.ts
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: Applies to app/api/**/*.{ts,tsx,js,jsx} : When needing custom headers or timeouts for external requests, pass them via `@/lib/security/urlGuard` helper options rather than re-implementing your own wrapper.
Applied to files:
sentry.server.config.tssentry.edge.config.ts
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed
Applied to files:
__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
📚 Learning: 2025-11-25T08:37:36.725Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:36.725Z
Learning: Applies to __tests__/**/__tests__/**/*.{ts,tsx,js,jsx} : Organize test files in `__tests__` directory mirroring source folder structure (components, contexts, hooks, utils) to keep structure familiar
Applied to files:
__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
📚 Learning: 2025-11-25T08:37:36.725Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:36.725Z
Learning: Applies to __tests__/**/__tests__/**/*.{ts,tsx,js,jsx} : Use the Arrange – Act – Assert pattern for test structure, keeping assertions focused on behaviour, not implementation details
Applied to files:
__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
📚 Learning: 2025-11-25T08:37:36.725Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:36.725Z
Learning: Applies to __tests__/**/__tests__/**/*.{ts,tsx,js,jsx} : Give each test a clear, descriptive name that conveys the scenario and expected outcome
Applied to files:
__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to **/__tests__/**/*.{ts,tsx,js,jsx} : Tests should live in `__tests__/` directory or be named `ComponentName.test.tsx`
Applied to files:
__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
📚 Learning: 2025-11-25T08:37:36.725Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:36.725Z
Learning: Use testing-library/react and testing-library/user-event for React component tests
Applied to files:
__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Use TypeScript and React functional components with hooks
Applied to files:
__tests__/components/notifications/NotificationsContext.test.tsx__tests__/components/waves/CreateDropStormParts.test.tsx
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Include all required imports and ensure proper naming of key components
Applied to files:
__tests__/components/waves/CreateDropStormParts.test.tsx
🧬 Code graph analysis (1)
sentry.server.config.ts (1)
config/sentryProbes.ts (2)
filterTunnelRouteErrors(19-67)tagSecurityProbes(69-85)
🪛 GitHub Check: SonarCloud Code Analysis
config/sentryProbes.ts
[warning] 19-19: 'any' overrides all other types in this union type.
[failure] 19-19: Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
instrumentation-client.ts
[warning] 101-101: Use the "RegExp.exec()" method instead.
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (8)
__tests__/components/waves/CreateDropStormParts.test.tsx (1)
11-16: LGTM!The framer-motion mock correctly simplifies AnimatePresence and motion.div for testing purposes, rendering children without animation complexity.
__tests__/components/notifications/NotificationsContext.test.tsx (3)
1-6: LGTM! Imports are appropriate for test requirements.The
Reactimport is necessary for the type annotations (React.FCandReact.ReactNode) used in the wrapper component, and all testing utilities are correctly imported.
27-45: LGTM! Excellent refactoring to centralized mocks.The centralized
jest.mock()declarations for Capacitor plugins improve test maintainability and make the mock setup clear and reusable. All methods are properly mocked with appropriate resolved values.
88-133: LGTM! Test structure and async handling are correct.The test properly uses
waitForfor async assertions, extracts and invokes the notification callback, and verifies the navigation behavior. The hardcoded 100ms timeout on line 124 is followed bywaitFor, which mitigates potential flakiness concerns.instrumentation-client.ts (2)
16-25: Centralized noise/reference/filename filters look goodMoving these magic strings into top-level
noisyPatterns,referenceErrors, andfilenameExceptionsimproves readability and reuse; the usage below is straightforward and correct.
52-79: Message / stack-frame based suppression is safe and targetedUsing
errorTypeplusnoisyPatterns/referenceErrorsto short‑circuit benign client errors, and then filtering by stack frame filenames/paths, is a reasonable way to drop known-noise (e.g., inpage.js) without impacting unrelated events. No functional issues stand out here.sentry.server.config.ts (1)
6-9: Server beforeSend filter‑then‑tag pipeline is correct and consistentImporting
filterTunnelRouteErrorsand routingbeforeSend(event, hint)throughfilter → drop‑if‑null → tagSecurityProbes(filtered)cleanly centralizes monitoring/tunnel suppression while preserving existing probe tagging. This aligns with the edge config and keeps Sentry DSN/PII settings unchanged.Also applies to: 32-38
sentry.edge.config.ts (1)
8-11: Edge beforeSend now mirrors server-side filtering/taggingUsing
beforeSend(event, hint)to first callfilterTunnelRouteErrorsand only thentagSecurityProbesgives edge routes the same monitoring/tunnel suppression semantics as the server config, which should make Sentry behavior easier to reason about across environments.Also applies to: 32-38
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
config/sentryProbes.ts (1)
21-105: Harden stacktrace handling to ensurefilterTunnelRouteErrorsnever throwsThe two-path suppression logic is reasonable, but
checkFirstErrorPathassumesvalue.stacktrace.framesis always an array; if it’s ever a non‑array truthy value,isMonitoringRoutewill receive it andstacktrace.somewill throw.You can guard the frames extraction to keep this path safe:
const url = event.request?.url || ""; - const stacktrace = value?.stacktrace?.frames || []; - - return isMonitoringRoute(url, stacktrace); + const frames = Array.isArray(value?.stacktrace?.frames) + ? value.stacktrace.frames + : []; + + return isMonitoringRoute(url, frames);This keeps the behavior for well‑formed events while preventing instrumentation failures on unexpected shapes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
__tests__/components/waves/CreateDropStormParts.test.tsx(2 hunks)config/sentryProbes.ts(2 hunks)instrumentation-client.ts(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- tests/components/waves/CreateDropStormParts.test.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version
**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed sincemainvianpm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) vianpm run lint
Use<Link>from Next.js for internal navigation instead of<a>tags or HTML anchors
Use<Image>fromnext/imageinstead of HTML<img>elements
Files:
instrumentation-client.tsconfig/sentryProbes.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All code must pass TypeScript type checking vianpm run type-check(tsc --noEmit)
Use'use cache'directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16
Files:
instrumentation-client.tsconfig/sentryProbes.ts
{.env*,*.env,**/config/**}
📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)
Configure Task Master behavior via environment variables: ANTHROPIC_API_KEY (required), MODEL, MAX_TOKENS, TEMPERATURE, DEBUG, LOG_LEVEL, DEFAULT_SUBTASKS, DEFAULT_PRIORITY, PROJECT_NAME, PROJECT_VERSION, PERPLEXITY_API_KEY, and PERPLEXITY_MODEL
Files:
config/sentryProbes.ts
🧠 Learnings (2)
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to {middleware,proxy}.ts : Request boundary logic using `middleware.ts` should be renamed to `proxy.ts` with exported `proxy` function (Node runtime); legacy `middleware.ts` is only for edge-only cases
Applied to files:
config/sentryProbes.ts
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use NextJS features that match the current version
Applied to files:
config/sentryProbes.ts
🧬 Code graph analysis (1)
instrumentation-client.ts (1)
utils/error-sanitizer.ts (1)
isIndexedDBError(67-110)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (2)
instrumentation-client.ts (1)
16-86: Centralized noise/reference/filename filtering looks solidThe extraction of noisy/reference/filename-based suppression into
shouldFilterEventis clear and defensive (good use of optional chaining and narrow checks); no issues from a correctness or robustness standpoint.config/sentryProbes.ts (1)
1-14: Typed Sentry imports and extended probe patterns look goodImporting
Event/EventHintfrom@sentry/nextjsand updatingtagSecurityProbesto accept a typedEventimproves clarity and type safety. The added probe URL patterns (/manager/html,/admin/login.jsp) integrate cleanly with the existing lower‑cased URL check; no issues found.Also applies to: 130-146
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
instrumentation-client.ts (1)
115-153: Consider slightly wideningisNetworkErrorto catchNetworkError‑only messagesThe tightened heuristic avoids incidental
"network"matches, which is good, but it can now miss browser messages that only containNetworkError(e.g."NetworkError when attempting to fetch resource.") and neither"failed to fetch"nor"load failed".You can keep the strictness while covering these common cases:
function isNetworkError(errorMessage: string): boolean { const normalized = errorMessage.toLowerCase(); return ( - normalized.includes("failed to fetch") || - normalized.includes("load failed") || - /\bnetwork\b/.test(normalized) + normalized.includes("failed to fetch") || + normalized.includes("load failed") || + normalized.includes("networkerror") || + normalized.includes("network error") || + normalized.includes("network request failed") || + /\bnetwork\b/.test(normalized) ); }This preserves the word‑boundary safeguard while ensuring Firefox‑style
NetworkErrormessages are still normalized throughhandleNetworkError.Please verify against a couple of real Sentry payloads (Chrome/Safari/Firefox) that the messages you expect are still being classified as network errors and that you are not reintroducing the earlier false‑positive issue.
🧹 Nitpick comments (2)
config/sentryProbes.ts (1)
21-37: MakeisConnectionErrorcase‑insensitive to better match Node error messages
isConnectionErrorcurrently does a case‑sensitiveincludes, which may miss variants like"Aborted"or"socket hang up"with different casing.You can normalize once and keep the pattern list readable:
const CONNECTION_ERROR_PATTERNS = [ "aborted", "ECONNRESET", "socket hang up", ]; function isConnectionError(message: string): boolean { - return CONNECTION_ERROR_PATTERNS.some((pattern) => - message.includes(pattern) - ); + const normalized = message.toLowerCase(); + return CONNECTION_ERROR_PATTERNS.some((pattern) => + normalized.includes(pattern.toLowerCase()) + ); }This should make the first suppression path more robust across environments without broadening it beyond the specific connection errors you already target.
After this change, re‑run
npm run type-checkand whatever tests cover tunnel error suppression to confirm that expected/monitoringconnection resets are still being dropped and no unrelated errors are silently filtered.sentry.edge.config.ts (1)
8-11: EdgebeforeSendcorrectly composes tunnel filtering and probe tagging; consider typinghintWiring
beforeSendasfilterTunnelRouteErrors(event, hint)followed bytagSecurityProbes(filtered)is a clean separation of responsibilities and ensures tunnel/monitoring noise is suppressed before security probe tagging runs.For a bit more type safety and self‑documentation, you could type the
hintparameter explicitly:- beforeSend(event: Sentry.ErrorEvent, hint) { + beforeSend(event: Sentry.ErrorEvent, hint: Sentry.EventHint) {This keeps usage aligned with Sentry’s expected
beforeSendsignature and with theEventHintusage inconfig/sentryProbes.ts.Please confirm that
Sentry.EventHintis available in your version of@sentry/nextjs(or alternatively importEventHintas a type from the package) and thatnpm run type-checkcontinues to pass with this annotation.Also applies to: 32-38
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
config/sentryProbes.ts(2 hunks)instrumentation-client.ts(2 hunks)sentry.edge.config.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version
**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed sincemainvianpm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) vianpm run lint
Use<Link>from Next.js for internal navigation instead of<a>tags or HTML anchors
Use<Image>fromnext/imageinstead of HTML<img>elements
Files:
sentry.edge.config.tsconfig/sentryProbes.tsinstrumentation-client.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All code must pass TypeScript type checking vianpm run type-check(tsc --noEmit)
Use'use cache'directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16
Files:
sentry.edge.config.tsconfig/sentryProbes.tsinstrumentation-client.ts
{.env*,*.env,**/config/**}
📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)
Configure Task Master behavior via environment variables: ANTHROPIC_API_KEY (required), MODEL, MAX_TOKENS, TEMPERATURE, DEBUG, LOG_LEVEL, DEFAULT_SUBTASKS, DEFAULT_PRIORITY, PROJECT_NAME, PROJECT_VERSION, PERPLEXITY_API_KEY, and PERPLEXITY_MODEL
Files:
config/sentryProbes.ts
🧠 Learnings (3)
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to {middleware,proxy}.ts : Request boundary logic using `middleware.ts` should be renamed to `proxy.ts` with exported `proxy` function (Node runtime); legacy `middleware.ts` is only for edge-only cases
Applied to files:
sentry.edge.config.tsconfig/sentryProbes.ts
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: Applies to app/api/**/*.{ts,tsx,js,jsx} : When needing custom headers or timeouts for external requests, pass them via `@/lib/security/urlGuard` helper options rather than re-implementing your own wrapper.
Applied to files:
sentry.edge.config.ts
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use NextJS features that match the current version
Applied to files:
config/sentryProbes.ts
🧬 Code graph analysis (2)
sentry.edge.config.ts (1)
config/sentryProbes.ts (2)
filterTunnelRouteErrors(107-128)tagSecurityProbes(130-146)
instrumentation-client.ts (1)
utils/error-sanitizer.ts (1)
isIndexedDBError(67-110)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (3)
instrumentation-client.ts (2)
16-85: Client-side noise filtering helpers look robust and defensiveThe new
noisyPatterns/referenceErrors/filenameExceptionsplusshouldFilterEventpipeline is structured cleanly, uses optional chaining throughout, and should avoidbeforeSendthrowing even for message-only or frame-less events. This is a good centralization of client filtering logic.Please ensure
npm run lintandnpm run type-checkboth pass for this file after these structural changes, and that your Sentry tests (if any) cover a couple of representative noisy events.
171-185:beforeSendis now safely guarded and composes the specialized handlers correctlyUsing
hint?.originalException ?? hint?.syntheticExceptionavoids the earlier potential crash whenhintis undefined, and the flowshouldFilterEvent → handleIndexedDBError → handleNetworkErroris straightforward and side‑effect‑only (always returningeventornull), which is appropriate for Sentry hooks.Please run
npm run type-checkto ensure theEventHinttyping from@sentry/nextjsstill aligns with howhintis used here, especially in cases where Sentry may omitoriginalExceptionand only providesyntheticException.config/sentryProbes.ts (1)
70-128: Tunnel route filtering logic and typing look soundThe two‑path structure in
filterTunnelRouteErrors(checkFirstErrorPathfor generic connection errors on monitoring routes andcheckSecondErrorPathfor"aborted"with an HTTP server stack) is clear, guarded against missingrequest/stacktrace, and the generic signaturefilterTunnelRouteErrors<T extends Event>(event: T)preserves the concrete event type when used (e.g.ErrorEvent).
isFrameWithPathsplus theunknown[]stacktrace handling also defensively avoid assuming Sentry’s frame shape.Please ensure
npm run lintandnpm run type-checkboth pass with these new type imports from@sentry/nextjs, and that your Sentry integration tests cover at least one event per suppression path so future refactors don’t accidentally regress this behavior.
|



Summary by CodeRabbit
Documentation
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.