refactor: implementations and tests#5
Merged
Conversation
Retries transient HTTP errors (408, 429, 500, 502, 503, 504) and network failures with configurable attempts and base delay. Respects Retry-After header on 429 responses. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace node:test + node:assert with vitest 4.1.7 - Add @vitest/coverage-v8 for coverage reporting - Add happy-dom + @testing-library/react for React component tests - Add tests for retry logic, debug mode, alias opt-out, trackPageView, localStorage fallback, send failures, malformed config, and all React hooks (TelemetryProvider, useTelemetry, useTrackPageView) - Coverage: 56% → 76% statements, 63% → 88% functions - Add coverage/ to .gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e flags Tests sendBeacon dispatch path, sendBeacon fallback to fetch, deriveApexDomain edge cases (localhost, IP, single-part, multi-part), and cookie Secure flag behavior on https vs http. Coverage: 76% → 80% statements, 70% → 77% branches, 88% → 90% functions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract shared retry helpers (RETRYABLE_STATUS_CODES, sleep, getRetryDelay) to core.ts and reuse in both NodeTransport and BrowserTransport. Add retries/retryDelay config to WebClientConfig. Network errors now re-throw after exhausting retries so dispatch can log them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SvenAlHamad
approved these changes
Jun 3, 2026
|
🎉 This PR is included in version 3.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Refactor existing telemetry implementations and add tests + vitest testing.