Conversation
Implements a robust backoff and retry system for Segment API uploads: - BatchUploadManager: Manages batched event uploads with retries - UploadStateMachine: Handles upload states (pending, uploading, success, error) - Flexible backoff configuration with exponential backoff - Proper error handling for permanent vs temporary failures - Config validation for backoff settings This provides the core infrastructure for reliable event delivery with configurable retry behavior. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes 14 issues identified in code review across critical bugs, spec non-compliance, code smells, and simplification opportunities. Critical fixes: - Rename WAITING state to RATE_LIMITED per spec (with migration) - Add metadata validation on app restart to handle corrupt timestamps - Fix premature batch metadata creation (only create on first failure) - Restore logger production default (disabled in production) Code quality: - Remove all console.log debug statements (21 total) - Restore keepalive flag for fetch requests - Add error logging to previously silent catch blocks - Downgrade operational logs from warn to info level - Add clarifying comment for rate limit double-negative logic Minor improvements: - Simplify upload gate logic and retry count logic - Remove unnecessary type casting - Clean up code structure Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Author
|
Closing this PR in favor of smaller, more reviewable PRs:
The split PRs contain the exact same changes as this PR, just organized for better reviewability. Research shows PRs under 400 lines get 70-90% defect detection, while PRs over 1000 lines get skimmed. All 14 code review fixes have been applied across the new PRs. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.