fix(access): add document_read and document_upload rate-limit buckets#297
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Note parsing misses en-dashes
- Restored proper Unicode en-dashes (·, –, …) in clinical note parsing regexes, detail-prefix checks, and related display strings that had been corrupted to mojibake.
- ✅ Fixed: Sentinel skips mobile table content
- Moved the below-content sentinel to after InlineTableCard (with lg:col-span-2) so mobile collapse logic detects unscrolled table content below the support action row.
You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit c7f2d68. Configure here.
| return title; | ||
| } | ||
| const dashIndex = text.search(/\s[-–]\s/); | ||
| const dashIndex = text.search(/\s[-ΓÇô]\s/); |
There was a problem hiding this comment.
Note parsing misses en-dashes
Medium Severity
A character encoding issue caused special characters (en-dashes, em-dashes, middle dots, ellipses) to render as mojibake (–, —, ·, …). This impacts clinical note parsing logic, lithium timing heuristics, and visible text in context strips, evidence summaries, and source details.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c7f2d68. Configure here.
| data-testid="answer-support-below-sentinel" | ||
| className="h-0 w-0" | ||
| aria-hidden="true" | ||
| /> |
There was a problem hiding this comment.
Sentinel skips mobile table content
Medium Severity
The below-content sentinel is positioned before the InlineTableCard, which causes useCollapseWhenContentBelow to misjudge available scrollable content. As a result, the Clinical notes/Evidence support row remains expanded even when a large table is still off-screen, particularly on mobile, potentially overlapping with fixed UI elements.
Reviewed by Cursor Bugbot for commit c7f2d68. Configure here.


Summary
Dedicated access-hardening for document read and upload API routes (split from the closed auto-hide PR #284).
document_readbucket (180/min authenticated, 45/min anonymous) viaenforceDocumentReadRateLimit()on document list/detail/search/signed-url and image signed-url routes.document_uploadbucket (12/min authenticated) on/api/uploadbefore storage or database work.allowRateLimitInMemoryFallbackOnUnavailable()onapi-rate-limit.tsfor production-safe fallback parity with other public routes.cursor/fix-all-db-issues-5f13.Verification (local)
npx vitest run tests/private-access-routes.test.ts -t "rate limits anonymous document read bursts|rate limits authenticated uploads before" --testTimeout 60000— passedmain/release/**; this PR targetscursor/fix-all-db-issues-5f13.Clinical governance preflight