Skip to content

Clear stale send_at when unscheduling an email - #154

Open
pcbeingused33 wants to merge 1 commit into
mailersend:mainfrom
pcbeingused33:fix/c7945-clear-send-at
Open

pcbeingused33 wants to merge 1 commit into
mailersend:mainfrom
pcbeingused33:fix/c7945-clear-send-at

Conversation

@pcbeingused33

Copy link
Copy Markdown

Fixes #111

bulkSend now serializes each email through the shared serializer, which sets send_at when sendAt is present, but it never clears the derived timestamp. When an Email that was already sent with a schedule is reused after setSendAt(null), the previous send_at is still sent. This change recomputes the timestamp on every serialization, as suggested in the issue, so send_at is omitted once the schedule is cleared.

The existing bulk-send test now also clears the schedule on the first email and sends the same two emails again. It checks that the first email no longer carries send_at and that the second keeps its own timestamp. The new assertion fails on main and passes with the fix.

This change was prepared with assistance from OpenAI Codex.

@mailerlite-kritika

Copy link
Copy Markdown

Re-runViewConfidence Score: 5/5

[Low risk] No findings.

Summary

Recomputes send_at on every serialization so cleared schedules are omitted

  • Reused Email objects with setSendAt(null) no longer send a stale send_at in send or bulkSend.
  • The bulk-send test now covers clearing the schedule on one email while the other keeps its own.

What's good

  • Small, targeted fix that matches the issue's suggestion.
  • The test clears the schedule on one email and checks that the other keeps its timestamp.
Review context · 0/5 commands
  • Risk: The change recomputes the derived send_at stamp on every serialization, so clearing sendAt drops the stale value from both send and bulkSend. It moves no dependency, and the added test asserts the cleared email omits send_at while the other keeps its own timestamp; the risk stays low because the edit is confined to one serialization path.
  • Commands run: none

Reviews (1) · Last reviewed commit: "fix: clear stale send_at when unscheduli..." · claude-sonnet-5-5

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.

emails.bulkSend not sending sendAt correctly

1 participant