fix: reject unsafe in-memory cache bounds - #1779
Conversation
|
Warning Review limit reached
Next review available in: 24 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (20)
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 |
📊 Benchmark Results✅ All benchmarks passed
Updated: 2026-08-08T08:07:11.300Z · Commit: 752fcb1 |
Outcome
InMemoryCacheStorenow rejects unsafemaxEntriesandcleanupIntervalMsvalues before allocating a cleanup timer or accepting entries. Capacity must be a positive safe integer, and cleanup intervals must be positive integer delays no greater than 2,147,483,647 milliseconds.Invalid values produce the stable
cache-core/invalid-configurationProblem with the offending option and value. Existing valid cleanup and LRU behavior remains unchanged.Fixes #1707
Reviewer context
@croco/cache-coreand documented.@croco/cache-corereceives a minor changeset; generated Problem registry metadata requires a patch changeset for@croco/problems-core.Verification
pnpm --filter @croco/cache-core test— 107 passedpnpm --filter @croco/cache-core typecheck— passedpnpm --filter @croco/cache-core lint— passed with 0 warnings/errorspnpm --filter @croco/cache-core... build— passedpnpm docs:api:check— 116 build tasks and 4,529 pages passed; generated API docs matchpnpm check— 24/25 passed, 1 not applicablepnpm public-api:check,problem-registry:check,docs:api-triggers:check, andpackage-manifests:check— passedpnpm changeset-required:check -- --base origin/trunk --head HEAD— passedReview gates
null,NaN, both infinities, fractions, values above each maximum, both valid boundaries, no timer allocation on invalid input, and unchanged periodic cleanup behavior.maxEntries: nulldefaulting gap was found, fixed with undefined-only defaulting, and covered for both options; re-review found no remaining actionable findings.Residual risk
JavaScript consumers that previously relied on timer clamping or invalid capacities now fail at construction and must supply values within the documented bounds.