-
Notifications
You must be signed in to change notification settings - Fork 16
cleanup: first batch of fixes for no-floating-promises eslint rule
#2787
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
Changes from all commits
7248fb0
95b84f1
88ff4e3
c7c9b1a
a5ea615
afb40d7
284c318
b4f16ac
664c870
a688414
f0cf193
c56f456
ec3db79
56e0b57
1104d6a
e087ac9
bc6bbbe
a542834
c482a6f
adab236
bec22bb
1ab8cd4
b1dcaf3
343d808
2677c07
9349731
6f82447
a566c59
9d1ac00
e5aea2e
680ad11
27ae87d
b4a9844
f0f0e34
79a8577
6426765
4f920f1
4b18d79
bf77e83
d0bcae6
fd392d4
03c1b02
bf29f4f
6a32a6b
247eeff
ab385ff
ae41d29
ee1f1ae
514e893
98fcdd7
a4fdeeb
1705699
7d9ff25
835535b
7797a74
4454f5a
3a95dce
49896c4
44897ce
a004fd6
e07e21d
9b7f22e
4578b27
7faf124
0a520d1
fb4fc5c
05d8770
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,9 +179,7 @@ export async function openLatestSchemasCommand(topic: KafkaTopic) { | |
| title: message, | ||
| }, | ||
| async () => { | ||
| const promises = highestVersionedSchemas.map((schema) => { | ||
| openReadOnlySchemaDocument(schema); | ||
| }); | ||
|
Comment on lines
-182
to
-184
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one was a little strange, until I realized we had no |
||
| const promises = highestVersionedSchemas.map((schema) => openReadOnlySchemaDocument(schema)); | ||
shouples marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| await Promise.all(promises); | ||
| }, | ||
| ); | ||
|
|
@@ -263,7 +261,7 @@ export async function deleteSchemaVersionCommand(schema: Schema) { | |
| const found = schemaGroup && schemaGroup.find((s) => s.id === schema.id) !== undefined; | ||
|
|
||
| if (!found) { | ||
| showErrorNotificationWithButtons("Schema not found in registry.", { | ||
| void showErrorNotificationWithButtons("Schema not found in registry.", { | ||
| "Refresh Schemas": () => vscode.commands.executeCommand("confluent.schemas.refresh"), | ||
| ...DEFAULT_ERROR_NOTIFICATION_BUTTONS, | ||
| }); | ||
|
|
@@ -285,7 +283,7 @@ export async function deleteSchemaVersionCommand(schema: Schema) { | |
| } | ||
| } | ||
|
|
||
| showErrorNotificationWithButtons("Schema not found in registry.", { | ||
| void showErrorNotificationWithButtons("Schema not found in registry.", { | ||
| "Refresh Schemas": () => vscode.commands.executeCommand("confluent.schemas.refresh"), | ||
| ...DEFAULT_ERROR_NOTIFICATION_BUTTONS, | ||
| }); | ||
|
|
@@ -358,7 +356,7 @@ export async function deleteSchemaVersionCommand(schema: Schema) { | |
| } catch (e) { | ||
| success = false; | ||
| logError(e, "Error deleting schema version", { extra: { error: {} } }); | ||
| showErrorNotificationWithButtons( | ||
| void showErrorNotificationWithButtons( | ||
| `Error deleting schema version ${schema.version}: ${e instanceof Error ? e.message : String(e)}`, | ||
| ); | ||
| } | ||
|
|
@@ -396,7 +394,7 @@ export async function deleteSchemaSubjectCommand(subject: Subject) { | |
| schemaGroup = await loader.getSchemasForSubject(subject.environmentId, subject.name); | ||
|
|
||
| if (!Array.isArray(schemaGroup) || schemaGroup.length === 0) { | ||
| showErrorNotificationWithButtons("Schema subject not found in registry.", { | ||
| void showErrorNotificationWithButtons("Schema subject not found in registry.", { | ||
| "Refresh Schemas": () => vscode.commands.executeCommand("confluent.schemas.refresh"), | ||
| ...DEFAULT_ERROR_NOTIFICATION_BUTTONS, | ||
| }); | ||
|
|
@@ -414,7 +412,7 @@ export async function deleteSchemaSubjectCommand(subject: Subject) { | |
| }); | ||
| } | ||
| } | ||
| showErrorNotificationWithButtons("Schema subject not found in registry.", { | ||
| void showErrorNotificationWithButtons("Schema subject not found in registry.", { | ||
| "Refresh Schemas": () => vscode.commands.executeCommand("confluent.schemas.refresh"), | ||
| ...DEFAULT_ERROR_NOTIFICATION_BUTTONS, | ||
| }); | ||
|
|
@@ -480,7 +478,7 @@ export async function deleteSchemaSubjectCommand(subject: Subject) { | |
| } catch (e) { | ||
| success = false; | ||
| logError(e, "Error deleting schema subject", { extra: { error: {} } }); | ||
| showErrorNotificationWithButtons( | ||
| void showErrorNotificationWithButtons( | ||
| `Error deleting schema subject ${subject.name}: ${e instanceof Error ? e.message : String(e)}`, | ||
| ); | ||
| } finally { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,17 +219,19 @@ async function _activateExtension( | |
| ]; | ||
| logger.info("View providers initialized"); | ||
| // explicitly "reset" the Topics & Schemas views so no resources linger during reactivation/update | ||
| topicViewProvider.reset(); | ||
| schemasViewProvider.reset(); | ||
|
Comment on lines
-222
to
-223
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jlrobins do you think we should expand this behavior to the rest of the views, or remove this entirely? I don't know if this is even necessary anymore since we still wipe workspace state on activation, but the only area this might cause issues is during extension version updates where the Topics and Schemas views may reset in the middle of use (from one extension version to another). I don't think we've tested that path for the Flink-related views though.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, good question, but at least not needing answering here in for this branch. I think that it'd be safer to include to do for all views (but not needed in this branch). |
||
| await Promise.all([topicViewProvider.reset(), schemasViewProvider.reset()]); | ||
|
|
||
| // Register refresh commands for our refreshable resource view providers. | ||
| const refreshCommands: vscode.Disposable[] = []; | ||
| for (const instance of getRefreshableViewProviders()) { | ||
| refreshCommands.push( | ||
| registerCommandWithLogging(`confluent.${instance.kind}.refresh`, (): boolean => { | ||
| instance.refresh(true); | ||
| return true; | ||
| }), | ||
| registerCommandWithLogging( | ||
| `confluent.${instance.kind}.refresh`, | ||
| async (): Promise<boolean> => { | ||
| await instance.refresh(true); | ||
| return true; | ||
| }, | ||
| ), | ||
|
Comment on lines
226
to
+234
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. View-level refreshing still working as expected ✅ |
||
| ); | ||
| } | ||
|
|
||
|
|
@@ -486,7 +488,7 @@ async function setupFeatureFlags(): Promise<void> { | |
|
|
||
| const disabledMessage: string | undefined = await checkForExtensionDisabledReason(); | ||
| if (disabledMessage) { | ||
| showExtensionDisabledNotification(disabledMessage); | ||
| void showExtensionDisabledNotification(disabledMessage); | ||
| throw new Error(disabledMessage); | ||
| } | ||
| } | ||
|
|
@@ -553,7 +555,10 @@ async function setupAuthProvider(): Promise<vscode.Disposable[]> { | |
| userInfo: undefined, | ||
| session: cloudSession, | ||
| }); | ||
| (await getLaunchDarklyClient())?.identify({ key: cloudSession.account.id }); | ||
| const launchDarklyClient = await getLaunchDarklyClient(); | ||
| if (launchDarklyClient) { | ||
| await launchDarklyClient.identify({ key: cloudSession.account.id }); | ||
| } | ||
| } | ||
|
|
||
| logger.info("Confluent Cloud auth provider registered"); | ||
|
|
@@ -587,7 +592,7 @@ export function deactivate() { | |
| const msg = "Error disposing telemetry logger during extension deactivation"; | ||
| logError(new Error(msg, { cause: e }), msg, { extra: {} }); | ||
| } | ||
| closeSentryClient(); | ||
| void closeSentryClient(); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not trying to await or catch errors during disposal, cc @noeldevelops |
||
|
|
||
| disposeLaunchDarklyClient(); | ||
| disableCCloudStatusPolling(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.