Skip to content

fix: type-check engagement event detection#426

Merged
KMKoushik merged 2 commits into
mainfrom
codex/fix-engagement-typecheck
Jul 13, 2026
Merged

fix: type-check engagement event detection#426
KMKoushik merged 2 commits into
mainfrom
codex/fix-engagement-typecheck

Conversation

@KMKoushik

@KMKoushik KMKoushik commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the narrowed array includes call with explicit enum comparisons
  • restore successful web TypeScript validation after fix: deduplicate dashboard engagement usage #425
  • add a reusable typecheck script for the web app
  • run TypeScript validation in the Web Tests GitHub Actions workflow

Root cause

The engagement status array was inferred as accepting only OPENED | CLICKED, while mailStatus can contain any parsed SES status. Unit tests and ESLint do not run the TypeScript compiler, so the mismatch surfaced during the production Next.js build.

Verification

  • cd apps/web && ./node_modules/.bin/tsc --noEmit --pretty false
  • cd apps/web && ./node_modules/.bin/eslint src/server/service/ses-hook-parser.ts --max-warnings 0
  • cd apps/web && ./node_modules/.bin/vitest run -c vitest.unit.config.ts src/server/service/ses-hook-parser.unit.test.ts — 2 passed
  • GitHub Actions Web Tests — passed, including the new Type check step and all existing test suites
  • git diff --check

No database migration required.

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
unsend-marketing Ready Ready Preview, Comment Jul 13, 2026 4:13am

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Updated SES engagement detection to compare mailStatus directly with EmailStatus.OPENED or EmailStatus.CLICKED. Added a no-emit web TypeScript typecheck script and inserted it into the web test workflow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main fix: correcting engagement event detection to satisfy type checking.

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.

❤️ Share

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploying usesend with  Cloudflare Pages  Cloudflare Pages

Latest commit: 255a718
Status: ✅  Deploy successful!
Preview URL: https://e4906868.usesend.pages.dev
Branch Preview URL: https://codex-fix-engagement-typeche.usesend.pages.dev

View logs

@KMKoushik
KMKoushik merged commit 89cba7f into main Jul 13, 2026
6 checks passed
@KMKoushik
KMKoushik deleted the codex/fix-engagement-typecheck branch July 13, 2026 05:16
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