Repository navigation
fix: move document complete email to a job - #2835
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Moves document completion email delivery out of the seal-document workflow and into a dedicated background job, so webhook delivery isn’t blocked by email sending failures.
Changes:
- Removes inline “document completed” email sending from
internal.seal-documentand replaces it with ajobs.triggerJob(...). - Introduces a new email job definition + handler:
send.document.completed.emails. - Registers the new job in the central jobs client so it can be triggered/processed.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/lib/jobs/definitions/internal/seal-document.handler.ts | Stops sending completion emails inline; triggers the new completion-email job after sealing + webhook. |
| packages/lib/jobs/definitions/emails/send-document-completed-emails.ts | Adds the new job definition (trigger name + Zod schema) for completion emails. |
| packages/lib/jobs/definitions/emails/send-document-completed-emails.handler.ts | Implements the job handler that loads the envelope and sends completed emails + audit logs. |
| packages/lib/jobs/client.ts | Registers the new job definition with the job client. |
Comments suppressed due to low confidence (1)
packages/lib/jobs/definitions/emails/send-document-completed-emails.handler.ts:27
iois accepted inrunbut never used, which will trigger Biome’snoUnusedVariableswarning. Other email jobs also wrap the actual send operations inio.runTask(...)for observability; consider either removingiofrom the signature or using it to wrap the mail-sending work (and/or per-recipient sends) to keep behavior consistent and avoid the unused parameter warning.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| await jobs.triggerJob({ | ||
| name: 'send.document.completed.emails', | ||
| payload: { | ||
| envelopeId, | ||
| requestMetadata, | ||
| }, | ||
| }); |
Description
Move the document completion email sending logic into it's own job. This allows us to send webhooks in the event that our email service is down.