-
Notifications
You must be signed in to change notification settings - Fork 473
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
fix(notifications): extension activation hangs if fetch fails #6052
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
3e4a5d6
to
903c23c
Compare
Problem: If notifications fail to fetch, it will retry multiple times with 30 second waits. Activation is awaiting on this though, so it may take forever to finish. Solution: don't await on notification activation Also, update logging statements.
903c23c
to
4ea6d98
Compare
- Simplify when to focus the notifications panel for emergency notifications. - Try to limit race conditions when dismissing notifications.
8485691
to
540ce54
Compare
getLogger('notifications').debug('Activated in-IDE notifications polling module') | ||
logger.debug('Activated in-IDE notifications polling module') | ||
} catch (err) { | ||
logger.error('Failed to activate in-IDE notifications module.') |
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.
.... %O', err)`
or err.message
@@ -75,7 +75,7 @@ async function activateAmazonQNode(context: vscode.ExtensionContext) { | |||
...authState, | |||
}) | |||
|
|||
await activateNotifications(context, authState, getAuthState) | |||
void activateNotifications(context, authState, getAuthState) |
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.
if possible it's helpful to make activateNotications
non-async, so that it clearly signals that it does its own logging and .catch()
of async functions itself.
return withRetries( | ||
async () => { | ||
try { | ||
return await fetcher.getNewETagContent(versionTag) | ||
} catch (err) { | ||
logger.error('Failed to fetch at endpoint: %s, err: %s', endpoint, err) | ||
throw err |
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.
withRetries
should do useful logging of failure by default. We have so much nesting of these wrapper functions, we might as well do something with it...
Will follow up with your comments @justinmk3 |
Problem
If notifications fail to fetch, it will retry multiple times with 30 second waits. Activation is awaiting on this though, so it may take forever to finish.
Solution
don't await on notification activation
Also, update logging statements.
License: I confirm that my contribution is made under the terms of the Apache 2.0 license.