This repository was archived by the owner on Jan 12, 2021. It is now read-only.
Fix --upload-sources stream/buffer logic#43
Merged
bengourley merged 4 commits intomasterfrom May 23, 2019
Merged
Conversation
The Object.assign() call only creates a new top-level reference. The nested options.sources key needs to be replaced, otherwise each upload modifies the same object.
|
Thanks for getting on this so quickly! @bengourley |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
During the refactor for #40, the wrong variable name was referenced in
getSendableSource()which meant that the--upload-sourceslogic ceased to work, introducing #42.While tracking this down, I also noticed that
--upload-sourceswas not compatible with relative paths in the source map.Also while tracking this down I noticed that the error information included in the API response was not surfaced to the user, so I updated the output there.
To test these fixes, using a similar setup at the OP in #42:
Make sure you have
bugsnag-sourcemapscloned locally (checkoutmaster) and reference it like so:You should see the following error:
Now check out this branch (
bengourley/upload-sources-fix) and repeat – you should see a successful upload (if you used a valid api key) or an API error (invalid API key, uploading source maps for an existing version etc.), showing that the library sent a reasonable request.or
You can also use the example TypeScript project to test out the fix for
--upload-sourcesin conjunction with--directorymode:"inlineSources": false(or comment out that line) intsconfig.jsonnpm run build– this will now build without including source content in the mapnpm run upload-source-maps– this won't include sourcesnpm start– sends an errornpm run upload-source-maps -- --overwrite --upload-sourcesre-upload source maps but tell it to include the sourcesnpm start– sends another errormasterit won't)