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

Add retry method to share link dialog in case of error #4276

Merged
merged 5 commits into from
Mar 8, 2024

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Mar 8, 2024

example screenshot of new error box with the refresh icon

image

changes the text "Show stack trace" to the "Report" icon, and optionally displays a refresh icon if a "onReset" callback is passed to ErrorMessage

fixes #4274

cmdcolin added 3 commits March 8, 2024 08:49
Add typecheck to allow ErrorMessageStackTraceDialog to accept unknown

let mapUri =
new RegExp(/\/\/# sourceMappingURL=(.*)/).exec(currentScriptContent)?.[1] ||
''
mapUri = new URL(mapUri, uri).href + uriQuery

const map = await (await fetch(mapUri)).json()

const map = new SourceMapConsumer(await myfetchjson(mapUri))
Copy link
Collaborator Author

@cmdcolin cmdcolin Mar 8, 2024

Choose a reason for hiding this comment

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

this is a bonus optimization. if the stack trace goes through 20 stack frames of mobx-state-tree function calls, then it was reparsing the stack trace 20 times which added up to 5 seconds of waiting for the stack trace. this parses it just once

@cmdcolin cmdcolin requested a review from carolinebridge March 8, 2024 16:17
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 62.57%. Comparing base (67d5877) to head (3e6519a).
Report is 2 commits behind head on main.

Files Patch % Lines
packages/core/ui/ErrorMessageStackTraceDialog.tsx 0.00% 18 Missing ⚠️
packages/core/ui/ErrorMessage.tsx 66.66% 2 Missing and 1 partial ⚠️
...roducts/jbrowse-web/src/components/ShareDialog.tsx 75.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4276      +/-   ##
==========================================
- Coverage   62.60%   62.57%   -0.03%     
==========================================
  Files        1087     1087              
  Lines       31404    31416      +12     
  Branches     7497     7499       +2     
==========================================
  Hits        19659    19659              
- Misses      11572    11581       +9     
- Partials      173      176       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@carolinebridge
Copy link
Contributor

Bit jarring how the ui "disappears" when you view the stack trace, I think I'd like to see the stack trace inline with the rest of the modal. At a minimum, provide the user the retry button so they don't have to close + reopen.

image

-- also, when there's a failure to fetch copy to clipboard copies nothing, but provides a success message. Maybe disable it until there's something ready to copy?

image

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Mar 8, 2024

Bit jarring how the ui "disappears" when you view the stack trace, I think I'd like to see the stack trace inline with the rest of the modal. At a minimum, provide the user the retry button so they don't have to close + reopen.

not sure i understand, do you have a screen recording? note that chunk loading errors are a particular case of this that may be tricky to add retry functionality for #3523

@carolinebridge
Copy link
Contributor

not sure i understand, do you have a screen recording? note that chunk loading errors are a particular case of this that may be tricky to add retry functionality for #3523

You can see it in the screenshot -- the button options to bookmark, copy, close disappear

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Mar 8, 2024

gotcha. possibly adding another "ErrorBoundary" could catch it but i'm not sure where. the error boundary you are seeing in that screenshot is likely this one

<ErrorBoundary FallbackComponent={DialogError}>
<ThemeProvider
theme={createTheme(theme, {
components: {
MuiInputBase: {
styleOverrides: {
input: {
// xref https://github.com/GMOD/jbrowse-components/pull/3666
boxSizing: 'content-box!important' as 'content-box',
},
},
},
},
})}
>
{children}
</ThemeProvider>
</ErrorBoundary>

@cmdcolin cmdcolin merged commit 19e93e9 into main Mar 8, 2024
10 checks passed
@cmdcolin cmdcolin deleted the retry_sharelink branch March 8, 2024 18:16
@cmdcolin cmdcolin added the enhancement New feature or request label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: add a "retry" to requests that timeout
2 participants