Skip to content

fix: apply audit "this week" items (data safety, auth gating, CI gates) - #39

Merged
Kameleon21 merged 1 commit into
Masterfrom
fix/audit-this-week
Sep 13, 2026
Merged

Kameleon21 merged 1 commit into
Masterfrom
fix/audit-this-week

Conversation

@Kameleon21

@Kameleon21 Kameleon21 commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Items 7-15 from the "this week" list in the 2026-09-12 repo audit.

Backend

  • Bookmark toggle can no longer destroy tracked applications. It only deletes rows still at saved with no notes; otherwise it returns tracked: true and the list card shows a "Manage in dashboard" hint.
  • Status transitions are no longer dead ends. rejected and accepted can be undone, saved -> interviewing is allowed. The dashboard dropdown only renders legal transitions and disables items during a mutation.
  • jobNotificationDeliveries.by_userId index, used by deleteAccount (was a full table scan).
  • deleteOldJobs cron uses the by_status index, runs in bounded batches of 100 with self-reschedule, deletes delivery rows for removed jobs, and deletes expired outdated jobs before marking new ones.
  • User emails refuse to send without NEXT_PUBLIC_SITE_URL instead of emitting "NEXT_PUBLIC_SITE_URL is not configured." as the unsubscribe link.
  • Resend testMode defaults to true unless RESEND_TEST_MODE is explicitly false.
  • Re-subscribing keeps the existing unsubscribeToken, so links already in inboxes stay valid.

Frontend

  • Post Job is gated on auth. Anonymous users get the sign-in modal instead of a form that fails on submit.

Config / CI

  • Security headers on every route: HSTS, X-Frame-Options: DENY, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, CSP frame-ancestors 'none'. A full CSP is deferred until the Clerk/Convex/Vercel allowlist is tested.
  • Real dependency gate. bun pm scan || echo (never failed, no scanner configured) replaced with bun run audit:deps = bun audit --audit-level=high ignoring three transitive advisories with no patched release in range (image-size via fumadocs-core, js-cookie via @clerk/shared).
  • bun audit fix: 61 advisories resolved, including the critical Clerk middleware route-protection bypass (@clerk/nextjs 6.37.1 -> 6.39.3). Lockfile only.
  • One CI workflow. pr-checks.yml folded into ci.yml: quality (lint, tsc, tests, codecov), build, security audit, dependency review without continue-on-error. Dropped the fake Node 18/20 matrix, Supabase secrets, develop branch, and PR comment jobs. Added bun package cache. Actions bumped to checkout v5, setup-bun v2, codecov v5, dependency-review v4.

Prod config

Prod Convex had no RESEND_TEST_MODE. With the new safe default that would have put prod email into test mode, so RESEND_TEST_MODE=false was set on prod on 2026-09-13 before merge. Verified with convex env get --prod.

Verification

  • bun run lint clean
  • bunx tsc --noEmit clean
  • bun run test:ci 96/96 passing (3 new tests), coverage above thresholds
  • bun run build green
  • bun run audit:deps no vulnerabilities at high+

Backend
- toggleBookmark no longer deletes tracked applications that have status
  progress or notes; JobCard shows a "manage in dashboard" hint instead
- Status transitions: rejected/accepted can be undone, saved -> interviewing
  allowed; dashboard dropdown only offers legal transitions and disables
  items while a mutation is in flight
- jobNotificationDeliveries.by_userId index; deleteAccount uses it
- deleteOldJobs uses by_status index, bounded batches with self-reschedule,
  deletes delivery rows for removed jobs, deletes expired outdated jobs
  before marking new ones
- User notification emails are skipped when NEXT_PUBLIC_SITE_URL is unset
  instead of sending broken unsubscribe links
- Resend testMode defaults to true unless RESEND_TEST_MODE is explicitly false
- Re-subscribing keeps the existing unsubscribeToken

Frontend
- Post Job opens the auth modal for anonymous users instead of the form

Config / CI
- Security headers: HSTS, X-Frame-Options, X-Content-Type-Options,
  Referrer-Policy, Permissions-Policy, CSP frame-ancestors 'none'
- Replace the never-failing `bun pm scan` with `bun run audit:deps`
  (bun audit at high+, three unpatched transitive advisories ignored)
- bun audit fix: 61 advisories resolved incl. Clerk middleware bypass
  (@clerk/nextjs 6.37.1 -> 6.39.3)
- Collapse pr-checks.yml into ci.yml: one quality job, build, security,
  dependency review; drop fake Node matrix, Supabase secrets, comment jobs;
  add bun cache; bump checkout v5, setup-bun v2, codecov v5,
  dependency-review v4
@vercel

vercel Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
firstdevjob Ready Ready Preview Sep 13, 2026 8:22am UTC

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@Kameleon21 Kameleon21 self-assigned this Sep 13, 2026
@Kameleon21
Kameleon21 merged commit 702d051 into Master Sep 13, 2026
6 checks passed
@Kameleon21
Kameleon21 deleted the fix/audit-this-week branch September 13, 2026 08:25

This branch was successfully deployed

1 active deployment
Preview — c89022ba Deployed Sep 13, 2026 by vercel[bot]
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