Skip to content

refactor(core): use safeParse for consent cookie validation#3019

Closed
parthshahp wants to merge 1 commit into
canaryfrom
zod-consent-consumers
Closed

refactor(core): use safeParse for consent cookie validation#3019
parthshahp wants to merge 1 commit into
canaryfrom
zod-consent-consumers

Conversation

@parthshahp
Copy link
Copy Markdown
Contributor

Summary

  • Replace try/catch around ConsentCookieSchema.parse with .safeParse() in core/lib/consent-manager/cookies/client.ts and server.ts
  • Cookies are graceful-failure territory; .safeParse() expresses that intent more directly than wrapping a throwing parse in try/catch
  • No behavior change: both still return null when the cookie is missing or fails validation

Test plan

  • pnpm exec tsc --noEmit lib/consent-manager/cookies/client.ts lib/consent-manager/cookies/server.ts passes
  • pnpm exec eslint lib/consent-manager/cookies/client.ts lib/consent-manager/cookies/server.ts --max-warnings 0 passes
  • Manual: verify consent cookie still parses correctly on client and server

@parthshahp parthshahp requested a review from a team as a code owner May 19, 2026 22:02
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

⚠️ No Changeset found

Latest commit: 15585d6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

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

Project Deployment Actions Updated (UTC)
catalyst Ready Ready Preview, Comment May 19, 2026 10:03pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from 7b38d98 (2026-05-19).

No bundle size changes detected.

@github-actions
Copy link
Copy Markdown
Contributor

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 90 93 92 95

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 77 87 71 79
Accessibility 95 92 95 98
Best Practices 100 100 100 100
SEO 88 100 88 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 3.7 s 4.1 s 4.2 s 5.6 s
CLS 0 0 0.037 0
FCP 1.2 s 1.1 s 1.2 s 1.2 s
TBT 20 ms 0 ms 0 ms 0 ms
Max Potential FID 60 ms 40 ms 50 ms 50 ms
Time to Interactive 3.7 s 4.1 s 4.5 s 5.6 s

Full Unlighthouse report →

@parthshahp parthshahp closed this May 21, 2026
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