-
Notifications
You must be signed in to change notification settings - Fork 53
Improvements to site thumbnail generation #1081
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
Conversation
| const finishedLoading = new Promise< void >( ( resolve ) => { | ||
| window.webContents.on( 'did-finish-load', () => resolve() ); | ||
| } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
window.loadURL returns a promise that resolves when the did-finish-load event has fired, so I took the opportunity to simplify this logic.
| window.webContents.on( 'did-finish-load', () => resolve() ); | ||
| } ); | ||
| const responseStatusCodePromise = new Promise< void >( ( resolve, reject ) => { | ||
| newSession.webRequest.onCompleted( ( details ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a URL filter (docs) did not work well in my testing. Likely because of potential redirects.
| .catch( Sentry.captureException ) | ||
| .catch( async ( error ) => { | ||
| Sentry.captureException( error ); | ||
| await fs.promises.unlink( outPath ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's intentional for the thumbnail to look this way when there's no image. My point was that deleting the thumbnail when the homepage returns an errant HTTP status is new behavior, so I wanted to clarify what the UI will look like in those cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying that, makes sense.
wojtekn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well on Windows now. MacOS still works fine.
| .catch( Sentry.captureException ) | ||
| .catch( async ( error ) => { | ||
| Sentry.captureException( error ); | ||
| await fs.promises.unlink( outPath ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is expected.
* Throw error when thumbnail page responds with error status * Tweaks * Only increase timeout on Windows * Promise
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |

Related issues
Proposed Changes
waitForCapture.QUESTION: I'm open to suggestions for which behavior to implement when the site home page returns an error. I think generating a thumbnail makes for weird behavior, but maybe it's better to leave the old thumbnail in place, I'm not sure…
Testing Instructions
No preview availablePre-merge Checklist