Skip to content

[comp] Production Deploy#2595

Merged
Marfuen merged 2 commits intoreleasefrom
main
Apr 18, 2026
Merged

[comp] Production Deploy#2595
Marfuen merged 2 commits intoreleasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 18, 2026

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.


Summary by cubic

Fixes daily policy digest emails going to users who already signed and reduces email noise by rolling up pending policies across orgs into a single message. Also skips abandoned orgs to protect deliverability.

  • New Features

    • Roll up pending policies across a user’s orgs into one email; per‑org unsubscribe drops only that org. Updated @trycompai/email template to render per‑org sections with a shared subject helper.
    • Skip abandoned orgs (no sessions in 90 days + hasAccess + onboardingCompleted) to avoid sending to inactive addresses; batch size unchanged (25).
  • Bug Fixes

    • Compare signedBy against member.id (not user id) when computing pending policies, preventing false‑positive digests for members who already signed.

Written for commit 7269f59. Summary will update on new commits.

github-actions bot and others added 2 commits April 17, 2026 20:39
* fix(digest): correct signedBy check, rollup per user, skip dead orgs

The helper compared policy.signedBy[] against member.user.id, but signedBy
stores member ids (written by the portal accept action and read by every
other consumer). Users who had signed their policies were still receiving
daily digest emails — the comparison never matched. Switched to member.id
with an inline regression test covering the reported owner+employee case.

Also roll up pending policies across orgs by user.id so a person with
memberships in multiple orgs receives one email with per-org sections
instead of one email per org. Per-org unsubscribe is still honored: a
user opted out of policy notifications in org A only drops that org from
the rollup and still gets an email about org B.

Finally, match weekly-task-reminder's dead-org filter at the DB query —
hasAccess, onboardingCompleted, and at least one non-deactivated member
with a session updated in the last 90 days — so we stop sending to
abandoned orgs.

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

* fix(digest): guard array[0] access for noUncheckedIndexedAccess

DTS build failed because noUncheckedIndexedAccess types array[0] as
possibly undefined, even right after a length check. Destructure and
narrow with a truthy guard so strict TS accepts the template and the
shared subject helper.

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

---------

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 18, 2026

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

Project Deployment Actions Updated (UTC)
app (staging) Building Building Apr 18, 2026 4:30pm
comp-framework-editor Ready Ready Preview, Comment Apr 18, 2026 4:30pm
portal (staging) Building Building Apr 18, 2026 4:30pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant