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

🐛 Fix edge case resulting in duplicate emails for some recipients #18941

Merged
merged 9 commits into from
Nov 10, 2023

Conversation

9larsons
Copy link
Contributor

@9larsons 9larsons commented Nov 10, 2023

refs https://ghost.slack.com/archives/CTH5NDJMS/p1699359241142969

It's possible for ObjectIDs to have only numeric characters. We were previously letting the type be inferred, which created a very rare but possible edge case where the last recipient of an email batch had a numeric ObjectID, resulting in a numeric comparison against alphanumeric ObjectIDs in the database.

  • updated the filter to add ''s around the lastId parameter
  • updated tests to check for the type of the id filter parameter value
  • can't fully test for numeric object IDs using what we have because javascript cannot handle numerics of that size; may be able to look at using fixture data loaded directly into the db

@9larsons 9larsons requested a review from cmraible November 10, 2023 01:11
@9larsons 9larsons enabled auto-merge (squash) November 10, 2023 01:23
@9larsons 9larsons disabled auto-merge November 10, 2023 01:23
@9larsons 9larsons enabled auto-merge (squash) November 10, 2023 01:24
@9larsons 9larsons merged commit 342b551 into main Nov 10, 2023
17 checks passed
@9larsons 9larsons deleted the test-email-duplicates branch November 10, 2023 01:24
9larsons added a commit that referenced this pull request Nov 10, 2023
…8941)

refs https://ghost.slack.com/archives/CTH5NDJMS/p1699359241142969

It's possible for `ObjectIDs` to have only numeric characters. We were
previously letting the type be inferred, which created a very rare but
possible edge case where the last recipient of an email batch had a
numeric ObjectID, resulting in a numeric comparison against alphanumeric
`ObjectIDs` in the database.
- updated the filter to add `'`'s around the `lastId` parameter
- updated tests to check for the type of the id filter parameter value
- can't fully test for numeric object IDs using what we have because
javascript cannot handle numerics of that size; may be able to look at
using fixture data loaded directly into the db
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.

2 participants