"Save as Gist" is grayed out in Viewer after first click
FAQ
- [X] Yes, my issue is not about variability or throttling.
- [X] Yes, my issue is not about a specific accessibility audit (file with axe-core instead).
URL
https://www.google.co.in/webhp?tab=rw
What happened?
Forked from https://bugs.chromium.org/p/chromium/issues/detail?id=1237815
(1) Launch Chrome and navigate to the url:https://www.google.co.in/webhp?tab=rw (2) Right Click and select inspect from the menu (3) Navigate to light house and select Device type mobile and then generate report (4) Click on open in Viewer option from menu new tab page will open now again click on Save as Gist option from menu. (5) If not logged in, simply close the OAuth window, and look at the "Save as Gist" menu item again. It's disabled. If you were logged into GitHub, same issue.
What did you expect?
I should be able to click "Save as Gist" a second time.
What have you tried?
No response
How were you running Lighthouse?
Chrome DevTools
Lighthouse Version
10.1
Chrome Version
111.0.5563.146
Node Version
No response
OS
No response
Relevant log output
No response
If you were logged into GitHub, same issue.
this is intentional, so it's clear you aren't going to be able to save it twice.
If not logged in, simply close the OAuth window, and look at the "Save as Gist" menu item again. It's disabled
this is not intentional, and looks like the same thing would happen if there was any error saving it.
It's from these lines: https://github.com/GoogleChrome/lighthouse/blob/1e6c0acb637fbb3d23829c79e4146fb232d7989d/viewer/app/src/viewer-ui-features.js#L66-L69
This won't happen if there's no gist saving available at all (like in a standalone report), but that option should be display: noned in that situation anyways.
In theory an error thrown from the gist save method should not hit those lines, but errors from gist creation are currently unconditionally absorbed by the error/toast thing:
https://github.com/GoogleChrome/lighthouse/blob/1e6c0acb637fbb3d23829c79e4146fb232d7989d/viewer/app/src/lighthouse-report-viewer.js#L370-L379
Right now _onSaveJson returns the gist id if successful. An easy solution would be to add that to the saveGistCallback signature and saveAsGist will be able to check that it's not undefined before disabling the menu option. Error message still isn't terribly helpful, though.
Can I work on this issue? If no one is working on this.
@connorjclark Note: The "Save as gist" functionality on Preview appears to be resolved; however, it still needs to be tested with a successful login scenario. Currently, Preview is displaying a "Firebase: Error (auth/unauthorized-domain)" message. Preview