Skip to content
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

fix: logging pointless error when offline #866

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

pauldambra
Copy link
Member

When testing #864 I noticed that the rate limiter can't cope with an empty body which is what you get when the network is offline

Well, not any more!

Comment on lines +23 to +28
const text = xmlHttpRequest.responseText
if (!text || !text.length) {
return
}

const response: CaptureResponse = JSON.parse(text)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the actual fix (ignoring the noise from refactoring logger into its own file to make it easier to mock the smallest area in the test)

@github-actions
Copy link

github-actions bot commented Oct 30, 2023

Size Change: -16 B (0%)

Total Size: 712 kB

Filename Size Change
dist/array.full.js 171 kB +8 B (0%)
dist/array.js 112 kB +2 B (0%)
dist/es.js 112 kB +2 B (0%)
dist/exception-autocapture.js 12 kB -30 B (0%)
dist/module.js 112 kB +2 B (0%)
ℹ️ View Unchanged
Filename Size
dist/recorder-v2.js 95 kB
dist/recorder.js 58.3 kB
dist/surveys.js 39.6 kB

compressed-size-action

@pauldambra
Copy link
Member Author

Screenshot 2023-10-30 at 09 31 27

clarity on impact on bundle size from splitting utils continues to increase

@pauldambra pauldambra added the bump patch Bump patch version when this PR gets merged label Oct 30, 2023
@pauldambra pauldambra merged commit 3f254cd into master Oct 30, 2023
11 checks passed
@pauldambra pauldambra deleted the fix/logging-pointless-errors branch October 30, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Bump patch version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants