Skip to content

fix: resolve 13 findings from March 23 triage#30

Merged
vayungodara merged 3 commits into
mainfrom
fix/triage-2026-03-23-clean
Mar 23, 2026
Merged

fix: resolve 13 findings from March 23 triage#30
vayungodara merged 3 commits into
mainfrom
fix/triage-2026-03-23-clean

Conversation

@vayungodara

Copy link
Copy Markdown
Owner

Summary

Resolves 13 findings from 3 automated email sources on March 23, 2026:

Security (2 fixes)

  • Open redirect removedx-forwarded-host header no longer used in auth callback; redirect validated against origin with // protocol-relative guard
  • Timing-safe cron auth — new shared lib/cronAuth.js using crypto.timingSafeEqual(); all 4 cron routes updated

Performance & Data Integrity (3 fixes)

  • FocusContext memoized — context value wrapped in useMemo, formatTime in useCallback
  • N+1 notifications batched — single .insert() replaces N individual calls in streak-breaks cron
  • Orphaned session duration cappedMath.min(now, expectedEnd) instead of always started_at + duration

Design (8 CSS quick wins in globals.css)

  • Deleted noise texture overlay (AI-design tell)
  • Desaturated background gradients (light: 0.04/0.03/0.02, dark: 0.08/0.05/0.03)
  • Varied gradient angles (150deg, 90deg, radial — breaks uniform 135deg)
  • Tightened border radii (6/8/12/16px)
  • Softened dark mode borders (0.04 opacity)
  • Reduced button glow intensity
  • Desaturated accent to #6366F1
  • Neutralized backgrounds (#FAFAFA/#F5F5F5 — violet tint removed)

Review fixes

  • Activity log batch insert now logs errors (was silently swallowed)
  • DB create_notification function type whitelist updated (9 → 19 types)

Files changed (10)

File Change
app/auth/callback/route.js Remove x-forwarded-host, add redirect validation
lib/cronAuth.js (new) Shared timingSafeEqual cron auth utility
app/api/cron/send-reminders/route.js Use cronAuth
app/api/cron/check-streak-risk/route.js Use cronAuth
app/api/cron/check-streak-breaks/route.js Use cronAuth + batch notifications + error handling
app/api/cron/cleanup/route.js Use cronAuth + cap orphaned duration
lib/FocusContext.js useMemo + useCallback
app/globals.css 8 design token changes
supabase/notifications.sql Expand type whitelist

Test plan

  • Google OAuth login → redirects to /dashboard
  • Cron routes reject bad secrets (401)
  • Focus timer re-renders only on state changes
  • Visual: calmer gradients, no noise, tighter radii
  • Dark mode: softer borders, neutral backgrounds

🤖 Generated with Claude Code

vayungodara and others added 2 commits March 23, 2026 18:06
Security: remove open redirect via x-forwarded-host in auth callback,
add crypto.timingSafeEqual for all 4 cron routes via shared cronAuth.js.
Performance: memoize FocusContext value (useMemo), batch N+1 notification
inserts in streak-breaks cron, cap orphaned session duration correctly.
Design: remove noise texture overlay, desaturate bg gradients + accent,
vary gradient angles, tighten border-radius, soften dark borders,
reduce button glow, neutralize background colors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ion type whitelist

Activity log batch insert in streak-breaks cron now logs errors instead
of silently swallowing them. DB create_notification function whitelist
updated to include all 19 notification types from NOTIFICATION_TYPES.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lockin Ready Ready Preview, Comment Mar 23, 2026 5:15pm

Root cause: e2e job ran next dev on a cold CI runner, which routinely
exceeded the 120s webServer timeout. The build artifact from
build-and-lint was never shared to the e2e job.

Fix: add npx next build step in e2e job, switch Playwright webServer
to next start in CI (2s startup vs 2min). Locally still uses next dev.
Also adds a unit test job running npx vitest run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vayungodara vayungodara merged commit 1f49b31 into main Mar 23, 2026
5 of 6 checks passed
@vayungodara vayungodara deleted the fix/triage-2026-03-23-clean branch March 23, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant