Skip to content

fix: skip recordDigestSent when RESEND_API_KEY absent (closes #2415)#2432

Open
Rudrasamadhiya wants to merge 1 commit into
Umbrella-io:mainfrom
Rudrasamadhiya:fix/issue-2415-weekly-digest-skip
Open

fix: skip recordDigestSent when RESEND_API_KEY absent (closes #2415)#2432
Rudrasamadhiya wants to merge 1 commit into
Umbrella-io:mainfrom
Rudrasamadhiya:fix/issue-2415-weekly-digest-skip

Conversation

@Rudrasamadhiya

Copy link
Copy Markdown
Contributor

When RESEND_API_KEY is absent, sendEmail previously returned { ok: true } which caused recordDigestSent to be called, advancing last_digest_sent_at even though no email was actually sent. On the next cron run, these users would be silently skipped until the next weekly window.

This PR adds a skipped flag to the sendEmail return type so the cron handler can detect when the email step was a no-op and skip the timestamp update accordingly.

Changes

…a-io#2415)

Updated the return type to include 'skipped' status and modified the logic to return a skipped status when no API key is provided.
@github-actions github-actions Bot added type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts) gssoc26 GSSoC 2026 contribution labels Jun 14, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Umbrella-io — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Priyanshu-byte-coder Priyanshu-byte-coder added the gssoc:approved GSSoC: PR approved for scoring label Jun 16, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with the current main branch. Please rebase or merge main into your branch to resolve the conflicts, then push the updated branch. Once conflicts are resolved, this PR will be merged.

git fetch origin main
git merge origin/main
# resolve conflicts
git push

@Priyanshu-byte-coder

Copy link
Copy Markdown
Member

This PR has merge conflicts with main. Please rebase or resolve conflicts and push again.

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

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Weekly digest cron treats missing RESEND_API_KEY as a successful send, consuming the 6-day cooldown with no email sent

2 participants