-
Notifications
You must be signed in to change notification settings - Fork 251
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
remove js payload limit #1823
Merged
remove js payload limit #1823
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
10f0707
remove js payload limit
djskinner e57249c
remove js payload limit
djskinner fa453ab
remove js payload limit
djskinner df3f6b5
add json-payload unit tests
djskinner aa5aa7e
dry up test suite
djskinner 805cd29
remove js payload limit
djskinner 051d36b
remove js payload limit
djskinner 2e4daae
remove js payload limit
djskinner 32481fa
remove js payload limit
djskinner 6d6b459
Update CHANGELOG.md
djskinner 1c8d135
add e2e coverage
djskinner 7310991
Merge branch 'next' into plat-8731
djskinner 3238dae
Merge branch 'next' into plat-8731
djskinner 0240d64
add e2e coverage
djskinner 700053d
Merge branch 'plat-8731' of github.com:bugsnag/bugsnag-js into plat-8731
djskinner 6812fb7
add e2e coverage
djskinner 0defa0b
Merge branch 'next' into plat-8731
djskinner 8e6b15c
Test if 400 status has any influence
Cawllec 98e3eb1
Use options only response code for failing scenario
Cawllec 08ea261
Use the post response instead of options
Cawllec 01479ea
Log feedback inplementation
Cawllec e1767a7
Use actual steps
Cawllec e1797bb
Return the event instead of err
Cawllec 945a5a6
Return the full err
Cawllec c3203fc
Remove feedback from log and rely on signle response only
Cawllec fae0eda
Attempt cross-platform xhr response
Cawllec a694dc6
Add basic node log implementation and extra logs to ie10
Cawllec e8d94f3
Update node to maze-runner v7
Cawllec cd74970
Update to ensure errors are logged correctly
Cawllec 7e88ff0
Temporarily disable delivery test on node and on ie10
Cawllec 37d53ef
Update to Node V7 and add express oversized scenario
Cawllec e0a77dd
Ensure logs uri is passed through to containers and use http lib in o…
Cawllec e7c5056
Remove problematic HTTP code
Cawllec f0556b8
Remove potentially problematic big-data generation
Cawllec 168bd62
Crop even more out
Cawllec 24a0e26
Fix incorrect URL
Cawllec a5aeabd
Ensure the correct version of url is present
Cawllec 50caa80
Ensure the correct version of url is present
Cawllec 140aef4
Use correct parse method
Cawllec f445c2f
Merge pull request #1866 from bugsnag/plat-8731-testing
djskinner 9bfbdbe
Merge branch 'next' into plat-8731
djskinner 82f6719
Merge branch 'plat-8731' of github.com:bugsnag/bugsnag-js into plat-8731
djskinner 879587a
use remote logging to assert event oversized log message
djskinner b1a23c8
use remote logging to assert event oversized log message
djskinner af22e4c
enhance node delivery test for future persistence functionality
djskinner b9ed23a
revert e2e tests for oversized delivery on electron
djskinner 22557f5
Merge branch 'next' into plat-8731
094c21a
update CHANGELOG.md
aef0a36
Merge branch 'next' into plat-8731
c455ae4
revert to running Safari 16 tests on browser stack
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 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 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 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 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,102 @@ | ||
import jsonPayload from '../json-payload' | ||
|
||
function makeBigObject () { | ||
var big: Record<string, string> = {} | ||
var i = 0 | ||
while (JSON.stringify(big).length < 2 * 10e5) { | ||
big['entry' + i] = 'long repetitive string'.repeat(1000) | ||
i++ | ||
} | ||
return big | ||
} | ||
|
||
describe('jsonPayload.event', () => { | ||
it('safe stringifies the payload and redacts values from certain paths of the supplied keys', () => { | ||
expect(jsonPayload.event({ | ||
api_key: 'd145b8e5afb56516423bc4d605e45442', | ||
events: [ | ||
{ | ||
errorMessage: 'Failed load tickets', | ||
errorClass: 'CheckoutError', | ||
user: { | ||
name: 'Jim Bug', | ||
email: 'jim@bugsnag.com' | ||
}, | ||
request: { | ||
api_key: '245b39ebd3cd3992e85bffc81c045924' | ||
} | ||
} | ||
] | ||
}, ['api_key'])).toBe('{"api_key":"d145b8e5afb56516423bc4d605e45442","events":[{"errorMessage":"Failed load tickets","errorClass":"CheckoutError","user":{"name":"Jim Bug","email":"jim@bugsnag.com"},"request":{"api_key":"[REDACTED]"}}]}') | ||
}) | ||
|
||
it('strips the metaData of the first event if the payload is too large', () => { | ||
const payload = { | ||
api_key: 'd145b8e5afb56516423bc4d605e45442', | ||
events: [ | ||
{ | ||
errorMessage: 'Failed load tickets', | ||
errorClass: 'CheckoutError', | ||
user: { | ||
name: 'Jim Bug', | ||
email: 'jim@bugsnag.com' | ||
}, | ||
request: { | ||
api_key: '245b39ebd3cd3992e85bffc81c045924' | ||
}, | ||
_metadata: {} | ||
} | ||
] | ||
} | ||
|
||
payload.events[0]._metadata = { 'big thing': makeBigObject() } | ||
|
||
expect(jsonPayload.event(payload)).toBe('{"api_key":"d145b8e5afb56516423bc4d605e45442","events":[{"errorMessage":"Failed load tickets","errorClass":"CheckoutError","user":{"name":"Jim Bug","email":"jim@bugsnag.com"},"request":{"api_key":"245b39ebd3cd3992e85bffc81c045924"},"_metadata":{"notifier":"WARNING!\\nSerialized payload was 2.003435MB (limit = 1MB)\\nmetadata was removed"}}]}') | ||
}) | ||
|
||
it('does not attempt to strip any other data paths from the payload to reduce the size', () => { | ||
const payload = { | ||
api_key: 'd145b8e5afb56516423bc4d605e45442', | ||
events: [ | ||
{ | ||
errorMessage: 'Failed load tickets', | ||
errorClass: 'CheckoutError', | ||
user: { | ||
name: 'Jim Bug', | ||
email: 'jim@bugsnag.com' | ||
}, | ||
_metadata: {} | ||
}, | ||
{ | ||
errorMessage: 'Request failed', | ||
errorClass: 'APIError', | ||
_metadata: {} | ||
} | ||
] | ||
} | ||
payload.events[1]._metadata = { 'big thing': makeBigObject() } | ||
|
||
expect(jsonPayload.event(payload).length).toBeGreaterThan(10e5) | ||
}) | ||
}) | ||
|
||
describe('jsonPayload.session', () => { | ||
it('safe stringifies the payload', () => { | ||
expect(jsonPayload.session({ | ||
api_key: 'd145b8e5afb56516423bc4d605e45442', | ||
events: [ | ||
{ | ||
errorMessage: 'Failed load tickets', | ||
errorClass: 'CheckoutError', | ||
user: { | ||
name: 'Jim Bug', | ||
email: 'jim@bugsnag.com' | ||
}, | ||
request: { | ||
api_key: '245b39ebd3cd3992e85bffc81c045924' | ||
} | ||
} | ||
] | ||
}, ['api_key'])).toBe('{"api_key":"d145b8e5afb56516423bc4d605e45442","events":[{"errorMessage":"Failed load tickets","errorClass":"CheckoutError","user":{"name":"Jim Bug","email":"jim@bugsnag.com"},"request":{"api_key":"245b39ebd3cd3992e85bffc81c045924"}}]}') | ||
}) | ||
}) |
This file contains 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 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 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 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 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 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 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change can be summarised as: don't throw here so each delivery mechanism attempts the send. For delivery mechanisms that support retries we explicitly make it not retryable if the payload was above the threshold (regardless of 400 status code or not)