-
Notifications
You must be signed in to change notification settings - Fork 155
Improve HTTP response handling and retry behavior #1342
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
Open
MichaelGHSeg
wants to merge
48
commits into
master
Choose a base branch
from
response-status-updates
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 17 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
790c355
First response status changes for browser batch mode
MichaelGHSeg 7ad65bb
Improving tests for batch dispatcher
MichaelGHSeg e92f798
More fetch dispatcher tests
MichaelGHSeg c860e62
Prospective change for updating 429 for Oauth endpoint - can be scale…
MichaelGHSeg 0944201
Fixing browser oversize on retry issue, node response changes plus tests
MichaelGHSeg b32bf2a
Fixing timeouts and batching behavior
MichaelGHSeg ebd7f53
Updates for OAuth Token, fixing LIBRARIES-2977 and using updated Retr…
MichaelGHSeg 31e275d
Always send X-Retry-Count and Authorization headers
MichaelGHSeg 53bc05d
Add Retry-After cap and fix 413 handling
MichaelGHSeg 7952be8
Fix node publisher to always send X-Retry-Count header
MichaelGHSeg ab34a07
Standardize backoff timing: 100ms min, 60s max
MichaelGHSeg de855e9
Increase default maxRetries to 1000
MichaelGHSeg 937b970
Fix test failures from maxRetries increase to 1000
MichaelGHSeg 2272886
Fix batched-dispatcher to flush remaining events after batch splits
MichaelGHSeg 39495a0
Fix batched-dispatcher concurrency and flush issues
MichaelGHSeg 369f01b
Cap Retry-After retries, fix maxRetries default, fix tests
MichaelGHSeg f0f8dc6
Fix CI test failures from backoff and header changes
MichaelGHSeg 8533626
Guard against negative Retry-After and clockSkew values, add safety c…
MichaelGHSeg a08e4cb
Remove unused Jest manual mock for analytics-page-tools
MichaelGHSeg a12de67
Add config-driven status code helpers and wire httpConfig through dis…
MichaelGHSeg 76b26d7
Wire exponential backoff and duration caps into batched dispatcher
MichaelGHSeg d99dfd8
Implement unified HTTP response handling per SDD (node + browser)
MichaelGHSeg 51a12e5
Refine HTTP response handling: sleep-and-retry for 429, doc fixes
MichaelGHSeg f8f44c0
Address PR review: SDD comment and test name fixes
MichaelGHSeg 087a8a4
Readjusting token min refresh time
MichaelGHSeg 7ff2791
Addressing PR comments
MichaelGHSeg 0406258
Fix test failures: X-Retry-Count default and 511 without auth
MichaelGHSeg 5a99827
Merge branch 'master' of ssh://github.com/segmentio/analytics-next in…
MichaelGHSeg ed23808
Wire error event listener in e2e-cli for failure reporting
MichaelGHSeg c514bc2
Wire error event listener in browser e2e-cli for failure reporting
MichaelGHSeg 9f094b3
Fix browser e2e-cli: replace fixed delay with fetch-based activity mo…
MichaelGHSeg 913eb2c
Fix browser SDK retry behavior for e2e testing
MichaelGHSeg 890ae95
Remove redundant HTTP patch step from browser e2e workflow
MichaelGHSeg a4ff990
Addressing PR comments
MichaelGHSeg 5e675e2
Consolidate backoff parameters: 500ms base, 60s max, 10 retries
MichaelGHSeg 3068e19
Fixing status code override handling
MichaelGHSeg e6b7c21
Support httpConfig from CDN settings with deep-merge
MichaelGHSeg 8ead560
Enable retry and retry-settings test suites for browser
MichaelGHSeg 822e663
Move httpConfig deep-merge into resolveHttpConfig, respect retryQueue
MichaelGHSeg 330f2ab
Increase OAuth test timeout for new backoff parameters
MichaelGHSeg 439ee12
Merge branch 'master' into response-status-updates
MichaelGHSeg 91491b1
Omit X-Retry-Count header on first attempt, send only on retries
MichaelGHSeg ea499e8
fix: Enable retry suite for Node e2e-cli
MichaelGHSeg 154373e
fix: Use local SDK in Node e2e-cli instead of published npm package
MichaelGHSeg 0acf0f4
fix: Trim browser bundle size and increase flaky test timeout
MichaelGHSeg 5661fff
Addressing PR comments
MichaelGHSeg 7652157
Fixing spelling
MichaelGHSeg 25271b3
fix: address Copilot review — correct totalAttempts counting and drop…
MichaelGHSeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/browser/src/core/__mocks__/analytics-page-tools.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| export type PageContext = Record<string, unknown> | ||
| export type BufferedPageContext = PageContext | ||
|
|
||
| export const BufferedPageContextDiscriminant = 'buffered' as const | ||
|
|
||
| export function getDefaultPageContext(): PageContext { | ||
| return {} | ||
| } | ||
|
|
||
| export function getDefaultBufferedPageContext(): BufferedPageContext { | ||
| return {} | ||
| } | ||
|
|
||
| export function createPageContext(ctx: Partial<PageContext> = {}): PageContext { | ||
| return { ...ctx } | ||
| } | ||
|
|
||
| export function createBufferedPageContext( | ||
| ctx: Partial<BufferedPageContext> = {} | ||
| ): BufferedPageContext { | ||
| return { ...ctx } | ||
| } | ||
|
|
||
| export function isBufferedPageContext( | ||
| _ctx: unknown | ||
| ): _ctx is BufferedPageContext { | ||
| return false | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.