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 ability to get stack trace for error messages in the UI #4184

Merged
merged 4 commits into from Jan 29, 2024

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Jan 29, 2024

This allows users to get the stack trace for various error messages in the user interface without having to go to their browser devtools

Tested in Safari-alike (GNOME Web), Firefox, and Chrome in both dev mode and production build

example screenshot
image

inspired by code here https://stackoverflow.com/questions/75400967/get-stack-trace-as-a-string-when-using-source-map

@cmdcolin
Copy link
Collaborator Author

notably i posted an email address of jbrowse2dev@gmail.com for this also. we are wired into this email for office hours requests, so I thought it might work for bug reports also

@cmdcolin
Copy link
Collaborator Author

I also considered automatically getting the jbrowse version in this dialog but we do not, in general, have the jbrowse version available since no model object is available. we could a) add model objects to the error message or b) add a hacky reference to global JBrowseSession for the general case that most jbrowse-web instaces have

@cmdcolin
Copy link
Collaborator Author

motivated by the 'persistent problem' that we have to request users go into their devtools to get the source trace, which is hard to instruct users how to do. this hopefully can make it a bit easier

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

Attention: 103 lines in your changes are missing coverage. Please review.

Comparison is base (f84291c) 63.07% compared to head (b97f4dc) 62.88%.
Report is 3 commits behind head on main.

Files Patch % Lines
packages/core/ui/ErrorMessageStackTraceDialog.tsx 0.00% 71 Missing ⚠️
...ckSelectorWidget/components/tree/HamburgerMenu.tsx 41.66% 6 Missing and 1 partial ⚠️
.../SequenceFeatureDetails/SequenceFeatureDetails.tsx 0.00% 6 Missing ⚠️
packages/core/ReExports/modules.tsx 0.00% 5 Missing ⚠️
packages/core/ui/ErrorMessage.tsx 58.33% 4 Missing and 1 partial ⚠️
packages/embedded-core/src/ui/ViewTitle.tsx 20.00% 3 Missing and 1 partial ⚠️
...BaseFeatureWidget/SequenceFeatureDetails/index.tsx 85.71% 1 Missing ⚠️
...ges/embedded-core/src/ui/EmbeddedViewContainer.tsx 0.00% 1 Missing ⚠️
...earPileupDisplay/SharedLinearPileupDisplayMixin.ts 80.00% 1 Missing ⚠️
...lugins/alignments/src/LinearPileupDisplay/model.ts 66.66% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4184      +/-   ##
==========================================
- Coverage   63.07%   62.88%   -0.19%     
==========================================
  Files        1068     1070       +2     
  Lines       31085    31172      +87     
  Branches     7419     7445      +26     
==========================================
- Hits        19608    19604       -4     
- Misses      11305    11397      +92     
+ Partials      172      171       -1     

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

@cmdcolin cmdcolin merged commit 6f7d995 into main Jan 29, 2024
10 checks passed
@cmdcolin cmdcolin deleted the error_message_stack_trace_dialog branch January 29, 2024 22:02
@garrettjstevens
Copy link
Collaborator

This is nice! One additional possible feature, it could use URL params to automatically put the stack trace in the issue body or email body.

@cmdcolin
Copy link
Collaborator Author

great idea...added here d6d63ca

@cmdcolin cmdcolin added the enhancement New feature or request label Feb 5, 2024
@cmdcolin
Copy link
Collaborator Author

testing

300597947-6bf8056c-18cd-4033-9321-37e942a650f6

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.

None yet

2 participants