Conversation
* 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
@trycompai/emailtemplate to render per‑org sections with a shared subject helper.hasAccess+onboardingCompleted) to avoid sending to inactive addresses; batch size unchanged (25).Bug Fixes
signedByagainstmember.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.