-
Notifications
You must be signed in to change notification settings - Fork 90
feat: add events processing and retry headers #2066
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
feat: add events processing and retry headers #2066
Conversation
📝 WalkthroughWalkthroughThis PR makes several updates across the analytics-js-plugins package. Size limits in configuration files have been increased slightly for several CDN and NPM entries. Test cases and source files have been refactored to consolidate multiple retry and timing parameters into a single object (of type Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Client/Test
participant Queue as Queue System
participant Processor as processQueueCb
participant Logger as logErrorOnFailure
Caller->>Queue: Enqueue processing request
Queue->>Queue: Consolidate retry/timing info into QueueProcessCallbackInfo
Queue->>Processor: Call processQueueCb({retryAttemptNumber, maxRetryAttempts, willBeRetried, timeSinceFirstAttempt, timeSinceLastAttempt, reclaimed})
Processor-->>Queue: Return processing result
alt Processing failure
Queue->>Logger: logErrorOnFailure({retryAttemptNumber, maxRetryAttempts, willBeRetried, timeSinceFirstAttempt, timeSinceLastAttempt, reclaimed})
end
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2066 +/- ##
===========================================
+ Coverage 61.42% 61.49% +0.07%
===========================================
Files 478 478
Lines 16407 16433 +26
Branches 3231 3237 +6
===========================================
+ Hits 10078 10106 +28
+ Misses 5140 5138 -2
Partials 1189 1189 ☔ View full report in Codecov by Sentry. |
size-limit report 📦
|
|
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.
Amazing and long awaited! 🙌
PR Description
I've added retry headers and also the missing "sent at" header for all the requests to the data plane.
Retried-After
- Time in seconds since the previous attempt to send the event(s)Retry-Attempt
- The retry attempt numberRetried-After-First
- Time in seconds since the very first attempt to send the event(s)Reclaimed
- Boolean to indicate if the events were reclaimed from the storageLinear task (optional)
https://linear.app/rudderstack/issue/SDK-2996/js-sdk-implementation-retry-headers
Cross Browser Tests
Please confirm you have tested for the following browsers:
Sanity Suite
Security
Summary by CodeRabbit
These improvements aim to boost reliability and maintain smoother analytics operations without altering end-user functionality.