v0.6.79: rate limits, tables checkboxes, drizzle config changes, billing txes#4596
Conversation
…its (#4591) * fix(rate-limit): close rate-limit bypass and tighten public route limits * fix(rate-limit): address PR review — drop success field from 429 body, fall back to per-IP when JWT auth lacks userId
* fix(tables): eliminate checkbox flicker on rapid cell toggle * fix(tables): symmetric guarded onSettled across row write mutations * fix(tables): merge only mutated keys in onSuccess to preserve concurrent optimistic patches
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Closes IP "unknown" bypasses and reduces abuse vectors. Chat OTP and chat SSO endpoints now always apply IP-based limits (including when the client IP resolves to Performance/throughput adjustments. Lowers Postgres connection pool Client data consistency tweak. Table row update/batch update mutations add a shared Reviewed by Cursor Bugbot for commit b5dba82. Configure here. |
* improvement(billing): move calc subscription overage out of tx * fix double billing risk * address comments * address comments * share timeout const
Greptile SummaryThis PR bundles four targeted improvements: a rate-limit bypass fix (unknown IPs now share a bucket instead of skipping the check), a checkbox-flicker fix in the tables query layer, DB connection-pool reductions, and two query-optimisation changes to reduce egress.
Confidence Score: 4/5Safe to merge; changes are well-scoped with test coverage for the new rate-limit helpers and the checkbox-flicker fix follows established React Query patterns. The rate-limit additions are broadly correct and the unknown-IP bypass closure is a genuine security improvement. The two style-level findings (jsonb_agg ordering, Retry-After precision) are non-blocking. No data-loss, auth bypass, or query-correctness bugs were identified. apps/sim/lib/copilot/vfs/workspace-vfs.ts (new JSONB subquery), apps/sim/lib/core/rate-limiter/route-helpers.ts (new public API), apps/sim/hooks/queries/tables.ts (concurrent-mutation logic) Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant RouteHelper as enforceIpRateLimit / enforceUserOrIpRateLimit
participant RateLimiter as RateLimiter.checkRateLimitDirect
participant Storage as Redis/Storage
participant Handler as Route Handler
Client->>RouteHelper: HTTP request
RouteHelper->>RateLimiter: checkRateLimitDirect(key, config)
RateLimiter->>Storage: consumeTokens(key, 1, config)
alt Storage error
Storage-->>RateLimiter: throws
RateLimiter-->>RouteHelper: "{allowed: true} (fail-open)"
RouteHelper-->>Handler: null (proceed)
else Token available
Storage-->>RateLimiter: "{allowed: true, resetAt, ...}"
RateLimiter-->>RouteHelper: "{allowed: true}"
RouteHelper-->>Handler: null (proceed)
Handler-->>Client: 200 OK
else Bucket empty
Storage-->>RateLimiter: "{allowed: false, resetAt, retryAfterMs}"
RateLimiter-->>RouteHelper: "{allowed: false, resetAt}"
RouteHelper-->>Client: 429 + Retry-After header
end
Reviews (1): Last reviewed commit: "improvement(billing): move overage calcu..." | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.