Conversation
…lback ip_blacklist for prod env
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughHelm submodule reference updated to a new commit hash. PrismaAdapter.js enhanced with chunking support for large Prisma Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant processWheres as processWheres()
participant Chunking as Chunking Logic
participant RelHandler as _filterByRelatedIdsThroughFk()
participant Prisma as Prisma Client
participant DB as Database
Client->>processWheres: Pass where clause
alt Large in/OR detected
processWheres->>Chunking: Split filter (> 12000 items)
loop For each chunk
Chunking->>Prisma: count(chunk)
Prisma->>DB: Execute count query
DB-->>Prisma: Return count
Chunking->>Prisma: findMany(chunk)
Prisma->>DB: Execute find query
DB-->>Prisma: Return results
end
Chunking->>Chunking: Merge & deduplicate on id
Chunking-->>processWheres: Combined results
else Relationship filter detected
processWheres->>RelHandler: Resolve FK field name
RelHandler->>RelHandler: Build scalar FK filter
RelHandler->>Prisma: Query with FK condition
Prisma->>DB: Execute FK-based query
DB-->>Prisma: Return filtered results
Prisma-->>RelHandler: Results
RelHandler-->>processWheres: Filtered items
end
processWheres-->>Client: Processed where clause results
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1f5c2dad8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const parts = await Promise.all(chunkedFilters.map(chunkFilter => this.model.findMany(chunkFilter))) | ||
| const byId = new Map() | ||
| for (const part of parts) { | ||
| for (const item of part) { | ||
| if (item && item.id !== undefined) byId.set(item.id, item) |
There was a problem hiding this comment.
Preserve global sort/pagination when merging chunked queries
Running findMany once per chunk and then unioning results by id changes query semantics whenever the original filter includes orderBy, skip, or take (which is how list pagination is normally applied): each chunk gets paginated independently, then all chunk pages are merged without a final global sort/page cut. In practice, a request like first: 10 can return up to 10 * chunks rows and in a different order than the single-query result.
Useful? React with 👍 / 👎.
| const counts = await Promise.all(chunkedFilters.map(chunkFilter => this.model.count(chunkFilter))) | ||
| count = counts.reduce((acc, value) => acc + value, 0) |
There was a problem hiding this comment.
Avoid double-counting when summing chunked meta counts
Meta count is computed as a plain sum of count() over each chunk, but chunk partitions are not guaranteed to be disjoint (especially when splitting a large OR, where one row can satisfy predicates in multiple chunks). In those cases the same row is counted multiple times, so meta.count can be inflated compared to the original single-query semantics.
Useful? React with 👍 / 👎.
|



Summary by CodeRabbit
Performance Improvements
Bug Fixes
Infrastructure