Skip to content

Conversation

@danieljackins
Copy link
Contributor

@danieljackins danieljackins commented Apr 15, 2025

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.

  • I've included a changeset (psst. run yarn changeset. Read about changesets here).

@changeset-bot
Copy link

changeset-bot bot commented Apr 15, 2025

🦋 Changeset detected

Latest commit: d458034

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@segment/analytics-next Minor

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
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.04%. Comparing base (aa86141) to head (d458034).
Report is 1 commits behind head on master.

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     
Flag Coverage Δ
browser 92.21% <100.00%> (+0.04%) ⬆️
core 89.86% <ø> (ø)
node 87.93% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

silesky
silesky previously approved these changes Apr 15, 2025
let analytics: Analytics
let segment: Plugin
beforeEach(async () => {
jest.useRealTimers()
Copy link
Contributor

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()`

@danieljackins danieljackins merged commit 37df4c9 into master Apr 22, 2025
8 checks passed
@danieljackins danieljackins deleted the retry-queue branch April 22, 2025 16:16
@github-actions github-actions bot mentioned this pull request Apr 22, 2025
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.

3 participants