chore: add trace viewer file upload error handling#10243
Merged
mxschmitt merged 2 commits intoNov 11, 2021
Conversation
Member
|
Looks like #10127 can have a simpler fix. What exact scenario are we fixing here? |
370c7e0 to
c09143f
Compare
mxschmitt
commented
Nov 11, 2021
mxschmitt
commented
Nov 11, 2021
| try { | ||
| await traceModel.load(url, progress); | ||
| } catch (error) { | ||
| if (fetchFromInbuiltTraceViewerServer && error instanceof Error && error.message === 'HTTP error Not Found') |
Contributor
Author
There was a problem hiding this comment.
since local file URLs also get loaded over HTTP, check if its done via the internal trace viewer web-server and rewrite it that the local file could not be found (instead of showing the http error).
c09143f to
31cb34f
Compare
| // Don't re-use blob file URLs on page load (results in Fetch error) | ||
| if (newTraceURL && !newTraceURL.startsWith('blob:')) | ||
| setTraceURL(newTraceURL); | ||
| }, [setTraceURL]); |
Member
There was a problem hiding this comment.
What does it mean useEffect around setTraceURL, wouldn't it run only once?
Contributor
Author
There was a problem hiding this comment.
Yes, as the comment says its about if you open trace viewer with a blob URL. Usually old tab, forced reload etc.
31cb34f to
f7f122e
Compare
f7f122e to
eea5888
Compare
pavelfeldman
approved these changes
Nov 11, 2021
5eb02a6 to
bd7bc47
Compare
bd7bc47 to
37f9ccc
Compare
pavelfeldman
pushed a commit
that referenced
this pull request
Nov 20, 2021
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This fixes:
npx playwright show-trace non-existing.zipFixes #10127