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

explicitly mark failed payloads >1MB as not retryable #65

Merged
merged 6 commits into from
Oct 19, 2023
Merged

Conversation

djskinner
Copy link
Contributor

@djskinner djskinner commented Sep 29, 2022

Goal

  • To prevent unexpected behaviour causing the retry of oversized payloads

Design

  • Add an explicit check on the payload size. If > ~1MB then set err.isRetryable = false.
  • Manual testing showed that the 400 response received from the pipeline for oversized payloads does not get treated as a retryable error. This additional check makes doubly sure regardless of the HTTP response code but it is not expected to occur in normal operation.

Testing

  • Manual testing
  • Unit testing


delivery({ _config: config, _logger: { error: log, info: () => {} } }, fetch).sendEvent(payload, (err) => {
expect(didLog).toBe(true)
expect(enqueueSpy).not.toHaveBeenCalled()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tests are going to fail here until https://github.com/bugsnag/bugsnag-js/pull/1823/files#diff-b6197bd8422edfa11579021015a96f02f31bc20634ad051b821c01e4ce178afdL18 lands in the version of @bugsnag/core used by bugsnag exp

@djskinner djskinner changed the base branch from v46-next to v47/next February 22, 2023 15:11
@djskinner djskinner marked this pull request as ready for review February 23, 2023 09:43
@djskinner djskinner changed the base branch from v47/next to v49/next October 2, 2023 12:10
@tomlongridge
Copy link
Contributor

@yousif-bugsnag - this is now ready for review as the dependency in bugsnag-js is all there.

Copy link
Contributor

@yousif-bugsnag yousif-bugsnag left a comment

Choose a reason for hiding this comment

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

LGTM

@djskinner djskinner merged commit dc25073 into v49/next Oct 19, 2023
3 checks passed
@djskinner djskinner deleted the plat-8731 branch October 19, 2023 09:59
@gingerbenw gingerbenw mentioned this pull request Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants