-
Notifications
You must be signed in to change notification settings - Fork 155
Check attempts before dispatching to segment #1276
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
Conversation
🦋 Changeset detectedLatest commit: d458034 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1276 +/- ##
==========================================
+ Coverage 84.02% 84.04% +0.02%
==========================================
Files 224 224
Lines 5921 5924 +3
Branches 1351 1352 +1
==========================================
+ Hits 4975 4979 +4
+ Misses 946 945 -1
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| let analytics: Analytics | ||
| let segment: Plugin | ||
| beforeEach(async () => { | ||
| jest.useRealTimers() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally just just make this at afterEach -- and beforeEach can just have 'jest.useFakeTimers()`
This PR changes the retry behavior for Segment.io by checking the number of attempts before it attempts to send the event to Segment, which was causing an extra retry.
Tested locally by verifying that a cancelled event was not retried when retryQueue was disabled, and 4 total attempts were made when retryQueue was enabled.
yarn changeset. Read about changesets here).