fix(sourcemaps): don't attempt to treat remote URL as a local file path #1850
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.
When a sourceMappingURL is a remote URL (e.g. static storage in an S3 bucket),
sentry-cli sourcemaps inject
was treating it like a normal file path, attempting to "normalize" it with the source path, and producing a bogus url such aspath/to/source/dir/https://some-static-host.example.com/path/to/foo.js.map
, which of course doesn't exist, and thus the sourcemap isn't found and doesn't have the debug id injected - even if it's sitting right there in the local directory, next to its corresponding bundled source file.With this change, the sourcemap discovery step does not attempt to use the discovered sourcemap URL if it is a remote URL. Instead, it falls back to guessing the sourcemap location based on the source filename and its location.
I also changed a couple trycmd tests to remove the
+
before the timezone offset,as it causes the tests to fail when the local timezone is west of UTC.
Fixes #1846.