Skip to content

refactor(email): single source for send-rule decision and skip logging - #1131

Open
tarekooooooo wants to merge 3 commits into
richshaw:mainfrom
tarekooooooo:refactor/load-due-row-rules-only
Open

tarekooooooo wants to merge 3 commits into
richshaw:mainfrom
tarekooooooo:refactor/load-due-row-rules-only

Conversation

@tarekooooooo

Copy link
Copy Markdown
Contributor

Closes #1129

Signed-off-by: tarekooooooo <tarekai042@gmail.com>
Signed-off-by: tarekooooooo <tarekai042@gmail.com>
Signed-off-by: tarekooooooo <tarekai042@gmail.com>
@richshaw

Copy link
Copy Markdown
Owner

Thanks for this. The change is correct and matches #1129.

One thing to fix before merge: CI fails on formatting in src/jobs/slot-changes.ts. With one fewer argument, Prettier wants the loadDueRow call on fewer lines. Running pnpm format will fix it:

const due = await loadDueRow(db, payload.commitmentId, slotChangeDueRules, {
  notFound: 'commitment not found for slot change',
  notDue: 'slot-change email no longer due; skipping',
});

Because CI stopped at that step, it didn't get to typecheck or the tests. I ran them locally on your latest commit, and lint, typecheck, knip, pnpm test and pnpm test:db all pass, including the reminder and slot-change skip tests.

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.

loadDueRow takes the send rules and their AND as two parameters, so the logged skip reasons can drift from the decision

2 participants