Skip to content

fix(resume): polyfill canvas DOM globals for PDF parsing on Vercel#93

Merged
RikepilB merged 1 commit into
mainfrom
fix/prod-pdf-dommatrix-and-email-pacing
Jun 11, 2026
Merged

fix(resume): polyfill canvas DOM globals for PDF parsing on Vercel#93
RikepilB merged 1 commit into
mainfrom
fix/prod-pdf-dommatrix-and-email-pacing

Conversation

@RikepilB

Copy link
Copy Markdown
Owner

Summary

  • Production PDF parsing failed with ReferenceError: DOMMatrix is not defined (found via Vercel runtime logs after a prod smoke submission). pdfjs expects browser canvas globals Node lacks; @napi-rs/canvas is now a real dependency and DOMMatrix/ImageData/Path2D are installed on globalThis before pdf-parse loads.
  • Inline admin email fan-out now paces consecutive sends by 300ms — instant Resend rejections still tripped the requests-per-second cap (observed 429 in prod EmailLog).

Test plan

  • lint / typecheck / vitest (196) / build
  • dispatch tests updated for the paced fan-out
  • After deploy: submit a PDF application on prod and confirm parsingStatus COMPLETED

🤖 Generated with Claude Code

Production PDF parsing failed with "ReferenceError: DOMMatrix is not
defined" (pdfjs expects browser canvas globals that Node lacks). Add
@napi-rs/canvas as a real dependency and install DOMMatrix/ImageData/
Path2D on globalThis before pdf-parse loads. Local parsing was
unaffected, which masked the bug until the prod smoke test.

Also pace inline admin email fan-out with a 300ms gap between sends:
sequential-but-instant rejections still tripped Resend's
requests-per-second cap (observed 429 in prod EmailLog).

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
scoutlane Ready Ready Preview, Comment Jun 11, 2026 8:59pm

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9bb03e1f-8a4e-4046-a368-2d7656c2d597

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/prod-pdf-dommatrix-and-email-pacing

Comment @coderabbitai help to get the list of available commands and usage tips.

@RikepilB RikepilB merged commit 0486b22 into main Jun 11, 2026
4 checks passed
@RikepilB RikepilB deleted the fix/prod-pdf-dommatrix-and-email-pacing branch June 11, 2026 21:07
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