Round 14: admin throttling, real Gemini cascade walk, CSP report-only, FK indexes#81
Conversation
A Linux-only npm install pruned the optional @next/swc-win32-x64-msvc entry from the root lockfile and the version-bump commit carried that removal; a later local build re-added it. Keep the platform-complete lockfile so Windows contributors get identical installs. https://claude.ai/code/session_01RaziyjCxHgKcqvTqss7bXS
… IP) KNOWN_ISSUES 0b follow-up: admin routes are session+is_admin gated, but a stolen admin cookie allowed unthrottled scripting of promo creation and tier/role mutations. Route-wiring test suite extended to pin all ten throttled routes. https://claude.ai/code/session_01RaziyjCxHgKcqvTqss7bXS
The module header always documented that the chat path walks GEMINI_VISION_MODELS with the scan path's skip semantics, but callGemini only ever called the first id — reintroducing the single-hardcoded-id outage mode the cascade exists to prevent (the May-2026 zero-quota incident class). The walk skips on 404 (model retired) and 429 (per-model quota gone), throws immediately on anything else, splits the time budget per model, and reports the model that actually answered in modelUsed (it previously always claimed [0]). The old source pin in analyze-fallback.test.ts asserted the [0] shortcut verbatim — replaced with pins on the for-of walk + skip branch; 4 new behavioural tests cover 429-skip, 404-skip, 5xx fail-fast, and all-skipped → CF safety net. https://claude.ai/code/session_01RaziyjCxHgKcqvTqss7bXS
Screen readers announced raw emoji names ('broccoli') with no step
context. Each button now carries the localized step title as
aria-label plus aria-pressed state.
https://claude.ai/code/session_01RaziyjCxHgKcqvTqss7bXS
The long-deferred CSP follow-up, staged safely: the policy's value at this stage is the ORIGIN allowlist (only self + the Cloudflare Insights beacon may load scripts or connect; img allows data:/blob: for scan thumbnails; frame-ancestors none mirrors X-Frame-Options). script/style keep 'unsafe-inline' until a nonce strategy lands — Next.js emits inline RSC bootstrap scripts and critical CSS. Report-only never blocks; violations surface as console errors, which the Playwright suites already assert against — the e2e run against the branch preview doubles as the violation scan. Flip to enforcing by dropping '-Report-Only' after a quiet window. https://claude.ai/code/session_01RaziyjCxHgKcqvTqss7bXS
frontend/ carried two middleware files: src/middleware.ts (imports locales from lib/i18n-config — the single source of truth) and a root middleware.ts duplicating the same config with a hardcoded locale list. Next.js only honours one; the redundant copy invited drift (add a locale to i18n-config, wonder why routing ignores it). Production build verified — middleware still compiles at 42.1 kB. https://claude.ai/code/session_01RaziyjCxHgKcqvTqss7bXS
KNOWN_ISSUES 'Ongoing Follow-ups #4': sessions, code_redemptions, food_scans and chat_messages all reference users.id with no secondary index, so every 'rows for user X' query full-scans. Four CREATE INDEX IF NOT EXISTS statements — additive, idempotent, no data movement — plus matching index() definitions in the Drizzle schema so a future drizzle-kit generate doesn't diff-fight the database. NOTE for the merger (ITERATION_PROCESS §7): this environment has no Cloudflare credentials, so the migration is NOT yet applied to remote D1. Run after merge: cd frontend && npx wrangler d1 migrations apply eatinorder-db --remote The app is fully functional before the apply — indexes only change query plans. https://claude.ai/code/session_01RaziyjCxHgKcqvTqss7bXS
…tle closed, CSP report-only live) https://claude.ai/code/session_01RaziyjCxHgKcqvTqss7bXS
|
Warning Review limit reached
More reviews will be available in 47 minutes and 35 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (16)
✨ Finishing Touches🧪 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 |
Round 14 — backlog burn-down (security, resilience, schema, a11y)
Continues Round 13 (PR #80). Six changes, each its own commit:
callGeminionly ever calledGEMINI_VISION_MODELS[0]— the exact single-hardcoded-id outage mode the cascade exists to prevent. Now skips on 404/429 (per-model conditions), fails fast on 5xx, splits the timeout budget per model, and reports the answering model inmodelUsed. The old test pin asserted the[0]shortcut verbatim; replaced with cascade-walk pins + 4 behavioural tests.data:/blob:images;frame-ancestors 'none').'unsafe-inline'stays for script/style until the nonce work lands. Report-only never blocks; violations surface as console errors — which the Playwright suites assert against, so the preview e2e run below doubles as the violation scan.middleware.tsremoved —src/middleware.ts(which imports the shared locale config) is the survivor. Production build verified, middleware still compiles (42.1 kB).sessions/code_redemptions/food_scans/chat_messages.user_id(KNOWN_ISSUES follow-up feat: Add comprehensive product strategy research documentation #4), with matching Drizzleindex()definitions.cd frontend && npx wrangler d1 migrations apply eatinorder-db --remote. Safe to delay —IF NOT EXISTS, additive, app behavior unchanged until applied.aria-label+aria-pressed.Validation
npm run check:all: 193/193 unit (+8), i18n parity, type-check — greennext build+pages:build(exact CF command) — green locallyMerge with Merge, not Squash (ITERATION_PROCESS §4).
https://claude.ai/code/session_01RaziyjCxHgKcqvTqss7bXS
Generated by Claude Code