Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parseInactiveRecipients does not handle empty results correctly #168

Open
TKDBB84 opened this issue Jan 23, 2025 · 0 comments
Open

parseInactiveRecipients does not handle empty results correctly #168

TKDBB84 opened this issue Jan 23, 2025 · 0 comments

Comments

@TKDBB84
Copy link

TKDBB84 commented Jan 23, 2025

Occasionally the server returns a message with no emails included. This is a separate issue, however the parseInactiveRecipients function incorrectly returns a '.' instead of an empty array in this case. When an email that isn't valid is attempted to be sent the postmark server sometimes returns:

{
  ...
  code: 406,
  message: "You tried to send to recipient(s) that have been marked as inactive. Found inactive addresses: . Inactive recipients are ones that have generated a hard bounce, a spam complaint, or a manual suppression."
  ...
}

passing the message through parseInactiveRecipients results incorrectly in: [ '.' ]. When the expected result should be [].

Minimal Replication:

> const { Errors: postmarkErrors } = require('postmark')
> postmarkErrors.InactiveRecipientsError.parseInactiveRecipients('You tried to send to recipient(s) that have been marked as inactive. Found inactive addresses: . Inactive recipients are ones that have generated a hard bounce, a spam complaint, or a manual suppression.')

< [ '.' ]
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

No branches or pull requests

1 participant