From cb8849c355d48bc1ab24a5b6e2398a01d2375961 Mon Sep 17 00:00:00 2001 From: Will Martin Date: Fri, 2 Feb 2024 15:13:37 -0500 Subject: [PATCH] Add eslint rule no-floating-promises (#7789) * add eslint rule no-floating-promises * add eslint-disable comment to offending lines --- .eslintrc.json | 1 + .../services/browser-policy.service.ts | 2 + .../account-switcher.component.ts | 4 ++ .../account-switching/account.component.ts | 2 + .../current-account.component.ts | 2 + .../src/auth/popup/environment.component.ts | 2 + apps/browser/src/auth/popup/hint.component.ts | 2 + apps/browser/src/auth/popup/home.component.ts | 4 ++ apps/browser/src/auth/popup/lock.component.ts | 4 ++ .../login-decryption-options.component.ts | 2 + .../browser/src/auth/popup/login.component.ts | 4 ++ apps/browser/src/auth/popup/sso.component.ts | 4 ++ .../popup/two-factor-options.component.ts | 4 ++ .../src/auth/popup/two-factor.component.ts | 14 ++++++ .../popup/update-temp-password.component.ts | 2 + .../auth/popup/utils/auth-popout-window.ts | 2 + .../background/context-menus.background.ts | 4 ++ .../background/notification.background.ts | 28 ++++++++++++ .../background/overlay.background.spec.ts | 12 +++++ .../autofill/background/overlay.background.ts | 12 +++++ .../background/tabs.background.spec.ts | 2 + .../autofill/background/tabs.background.ts | 2 + .../browser/context-menu-clicked-handler.ts | 4 ++ .../generate-password-to-clipboard-command.ts | 2 + .../src/autofill/content/autofill-init.ts | 4 ++ .../src/autofill/content/autofiller.ts | 4 ++ .../content/content-message-handler.ts | 6 +++ .../autofill/content/context-menu-handler.ts | 2 + .../src/autofill/content/notification-bar.ts | 4 ++ .../trigger-autofill-script-injection.ts | 2 + apps/browser/src/autofill/notification/bar.ts | 2 + .../popup/settings/autofill.component.ts | 12 +++++ .../autofill-overlay-content.service.spec.ts | 16 +++++++ .../autofill-overlay-content.service.ts | 24 ++++++++++ .../services/autofill.service.spec.ts | 4 ++ .../src/autofill/services/autofill.service.ts | 12 +++++ .../collect-autofill-content.service.ts | 8 ++++ .../insert-autofill-content.service.spec.ts | 2 + .../src/background/commands.background.ts | 6 +++ .../browser/src/background/idle.background.ts | 6 +++ .../browser/src/background/main.background.ts | 20 +++++++++ .../background/nativeMessaging.background.ts | 14 ++++++ .../src/background/runtime.background.ts | 10 +++++ .../src/platform/alarms/on-alarm-listener.ts | 2 + .../src/platform/alarms/register-alarms.ts | 2 + apps/browser/src/platform/background.ts | 4 ++ .../state-service.factory.ts | 2 + .../src/platform/browser/browser-api.spec.ts | 14 ++++++ .../src/platform/browser/browser-api.ts | 4 ++ .../browser-session.decorator.ts | 2 + .../session-syncer.spec.ts | 14 ++++++ .../session-sync-observable/session-syncer.ts | 2 + .../platform/listeners/on-command-listener.ts | 2 + .../platform/listeners/on-install-listener.ts | 2 + .../src/platform/listeners/update-badge.ts | 8 ++++ .../popup/browser-popup-utils.spec.ts | 2 + .../services/browser-file-download.service.ts | 2 + .../browser-platform-utils.service.ts | 4 ++ .../state/background-derived-state.ts | 6 +++ ...derived-state-service-interactions.spec.ts | 6 +++ apps/browser/src/popup/app.component.ts | 16 +++++++ .../src/popup/components/pop-out.component.ts | 2 + apps/browser/src/popup/main.ts | 2 + .../src/popup/services/services.module.ts | 2 + .../settings/excluded-domains.component.ts | 4 ++ .../src/popup/settings/folders.component.ts | 4 ++ .../settings/help-and-feedback.component.ts | 6 +++ .../src/popup/settings/settings.component.ts | 16 +++++++ .../vault-timeout/vault-timeout.service.ts | 6 +++ .../file-popout-callout.component.ts | 2 + .../popup/generator/generator.component.ts | 2 + .../popup/send/send-add-edit.component.ts | 4 ++ .../popup/send/send-groupings.component.ts | 20 +++++++++ .../tools/popup/send/send-type.component.ts | 16 +++++++ .../tools/popup/settings/export.component.ts | 2 + .../import/import-browser.component.ts | 2 + .../browser-fido2-user-interface.service.ts | 12 +++++ .../src/vault/fido2/content/content-script.ts | 6 +++ .../fido2/content/messaging/messenger.spec.ts | 12 +++++ .../src/vault/fido2/content/page-script.ts | 2 + .../trigger-fido2-content-script-injection.ts | 2 + .../components/action-buttons.component.ts | 6 +++ .../fido2/fido2-use-browser-link.component.ts | 2 + .../popup/components/fido2/fido2.component.ts | 4 ++ .../components/vault/add-edit.component.ts | 16 +++++++ .../components/vault/current-tab.component.ts | 14 ++++++ .../popup/components/vault/share.component.ts | 4 ++ .../vault/vault-filter.component.ts | 26 +++++++++++ .../components/vault/vault-items.component.ts | 18 ++++++++ .../popup/components/vault/view.component.ts | 20 +++++++++ .../settings/folder-add-edit.component.ts | 4 ++ .../src/vault/services/fido2.service.ts | 2 + apps/cli/src/bw.ts | 2 + apps/cli/src/commands/get.command.ts | 2 + .../services/lowdb-storage.service.ts | 8 ++++ apps/cli/src/tools/export.command.ts | 2 + apps/cli/src/tools/import.command.ts | 2 + .../src/commands/bw-credential-create.ts | 2 + .../src/commands/bw-credential-retrieval.ts | 2 + .../src/commands/bw-credential-update.ts | 2 + .../src/commands/bw-generate-password.ts | 2 + .../src/commands/bw-handshake.ts | 2 + .../src/commands/bw-status.ts | 2 + .../src/app/accounts/settings.component.ts | 4 ++ apps/desktop/src/app/app.component.ts | 44 +++++++++++++++++++ .../src/app/components/avatar.component.ts | 4 ++ apps/desktop/src/app/main.ts | 2 + apps/desktop/src/app/services/init.service.ts | 2 + .../src/app/tools/generator.component.spec.ts | 2 + .../src/app/tools/send/add-edit.component.ts | 2 + .../src/app/tools/send/send.component.ts | 8 ++++ .../auth/accessibility-cookie.component.ts | 2 + apps/desktop/src/auth/lock.component.spec.ts | 20 +++++++++ apps/desktop/src/auth/lock.component.ts | 4 ++ .../auth/login/login-approval.component.ts | 2 + .../desktop/src/auth/login/login.component.ts | 2 + apps/desktop/src/auth/register.component.ts | 2 + apps/desktop/src/auth/sso.component.ts | 4 ++ apps/desktop/src/auth/two-factor.component.ts | 4 ++ apps/desktop/src/main.ts | 6 +++ apps/desktop/src/main/menu/menu.about.ts | 2 + apps/desktop/src/main/menu/menu.account.ts | 4 ++ apps/desktop/src/main/menu/menu.first.ts | 2 + apps/desktop/src/main/menu/menu.help.ts | 14 ++++++ apps/desktop/src/main/messaging.main.ts | 14 ++++++ .../desktop/src/main/native-messaging.main.ts | 32 ++++++++++++++ apps/desktop/src/main/tray.main.ts | 10 +++++ apps/desktop/src/main/updater.main.ts | 6 +++ apps/desktop/src/main/window.main.ts | 6 +++ .../main/biometric/biometrics.service.spec.ts | 10 +++++ .../main/biometric/biometrics.service.ts | 2 + .../services/electron-crypto.service.ts | 10 +++++ .../electron-platform-utils.service.ts | 4 ++ .../electron-main-messaging.service.ts | 2 + .../native-message-handler.service.ts | 2 + .../src/services/native-messaging.service.ts | 12 +++++ apps/desktop/src/utils.ts | 2 + .../src/vault/app/vault/add-edit.component.ts | 2 + .../filters/organization-filter.component.ts | 2 + .../vault/app/vault/vault-items.component.ts | 2 + .../src/vault/app/vault/vault.component.ts | 22 ++++++++++ .../common/base.people.component.ts | 6 +++ .../organizations/manage/groups.component.ts | 2 + .../organizations/members/people.component.ts | 10 +++++ .../policies/policies.component.ts | 4 ++ .../settings/account.component.ts | 2 + .../access-selector.component.spec.ts | 2 + .../accept-family-sponsorship.component.ts | 6 +++ ...families-for-enterprise-setup.component.ts | 6 +++ .../settings/sponsored-families.component.ts | 2 + apps/web/src/app/app.component.ts | 34 ++++++++++++++ .../app/auth/accept-organization.component.ts | 8 ++++ .../accept/accept-emergency.component.ts | 2 + .../services/emergency-access.service.ts | 2 + apps/web/src/app/auth/lock.component.ts | 2 + .../web/src/app/auth/login/login.component.ts | 12 +++++ .../src/app/auth/recover-delete.component.ts | 2 + .../app/auth/recover-two-factor.component.ts | 2 + .../account/change-avatar.component.ts | 4 ++ .../settings/change-password.component.ts | 2 + .../emergency-access.component.ts | 8 ++++ .../view/emergency-access-view.component.ts | 2 + .../settings/two-factor-setup.component.ts | 2 + apps/web/src/app/auth/sso.component.ts | 4 ++ .../trial-initiation.component.spec.ts | 4 ++ .../trial-initiation.component.ts | 4 ++ apps/web/src/app/auth/two-factor.component.ts | 4 ++ .../app/auth/verify-email-token.component.ts | 4 ++ .../auth/verify-recover-delete.component.ts | 4 ++ .../billing-history-view.component.ts | 2 + .../billing/individual/premium.component.ts | 4 ++ .../individual/user-subscription.component.ts | 10 +++++ .../organization-plans.component.ts | 2 + ...ganization-subscription-cloud.component.ts | 12 +++++ ...ization-subscription-selfhost.component.ts | 4 ++ .../shared/adjust-storage.component.ts | 2 + .../shared/payment-method.component.ts | 8 ++++ .../app/billing/shared/payment.component.ts | 2 + .../src/app/common/base.accept.component.ts | 2 + .../src/app/settings/settings.component.ts | 2 + ...exposed-passwords-report.component.spec.ts | 2 + ...active-two-factor-report.component.spec.ts | 2 + .../reused-passwords-report.component.spec.ts | 2 + ...nsecured-websites-report.component.spec.ts | 2 + .../weak-passwords-report.component.spec.ts | 2 + apps/web/src/app/tools/send/send.component.ts | 2 + .../tools/vault-export/export.component.ts | 2 + .../vault-items/vault-cipher-row.component.ts | 2 + .../vault-collection-row.component.ts | 2 + .../individual-vault/add-edit.component.ts | 8 ++++ .../routed-vault-filter-bridge.service.ts | 2 + .../services/vault-filter.service.spec.ts | 12 +++++ .../vault/individual-vault/vault.component.ts | 20 +++++++++ .../vault-filter/vault-filter.component.ts | 2 + .../vault-header/vault-header.component.ts | 4 ++ .../app/vault/org-vault/vault.component.ts | 20 +++++++++ .../vault/settings/purge-vault.component.ts | 6 +++ apps/web/src/connectors/captcha.ts | 6 +++ apps/web/src/connectors/webauthn-fallback.ts | 2 + apps/web/src/main.ts | 2 + .../providers/clients/clients.component.ts | 2 + .../providers/manage/events.component.ts | 2 + .../providers/manage/people.component.ts | 6 +++ .../providers/setup/setup.component.ts | 8 ++++ .../overview/overview.component.ts | 4 ++ .../dialog/project-dialog.component.ts | 2 + .../project/project-people.component.ts | 4 ++ .../projects/project/project.component.ts | 2 + .../secrets/dialog/secret-dialog.component.ts | 2 + .../service-account-dialog.component.ts | 2 + .../service-account-people.component.ts | 4 ++ .../service-account.component.ts | 2 + .../shared/secrets-list.component.ts | 2 + bitwarden_license/bit-web/src/main.ts | 2 + ...base-login-decryption-options.component.ts | 8 ++++ .../base-login-via-webauthn.component.ts | 4 ++ .../environment-selector.component.ts | 10 +++++ .../src/auth/components/hint.component.ts | 2 + .../src/auth/components/lock.component.ts | 4 ++ .../login-via-auth-request.component.ts | 24 ++++++++++ .../src/auth/components/login.component.ts | 16 +++++++ .../src/auth/components/register.component.ts | 4 ++ .../components/remove-password.component.ts | 4 ++ .../auth/components/set-password.component.ts | 6 +++ .../src/auth/components/sso.component.ts | 6 +++ .../auth/components/two-factor.component.ts | 12 +++++ .../components/update-password.component.ts | 6 +++ .../update-temp-password.component.ts | 4 ++ .../modal/dynamic-modal.component.ts | 2 + .../services/theming/theming.service.ts | 2 + .../export-scope-callout.component.ts | 2 + .../export/components/export.component.ts | 2 + .../components/generator.component.ts | 4 ++ libs/angular/src/tools/send/send.component.ts | 10 +++++ .../add-edit-custom-fields.component.ts | 2 + .../vault/components/add-edit.component.ts | 16 +++++++ .../view-custom-fields.component.ts | 2 + .../src/vault/components/view.component.ts | 18 ++++++++ .../user-verification-form-input.component.ts | 4 ++ libs/common/spec/fake-account-service.ts | 10 +++++ libs/common/spec/fake-storage.service.ts | 8 ++++ .../org-domain-api.service.spec.ts | 30 +++++++++++++ .../org-domain.service.spec.ts | 16 +++++++ .../organization/organization.service.spec.ts | 2 + .../src/auth/services/account.service.spec.ts | 2 + .../auth/services/anonymous-hub.service.ts | 4 ++ .../auth/services/key-connector.service.ts | 2 + .../src/platform/services/crypto.service.ts | 12 +++++ .../default-active-user-state.spec.ts | 4 ++ .../default-global-state.spec.ts | 4 ++ .../default-single-user-state.spec.ts | 4 ++ .../state/implementations/util.spec.ts | 6 +++ .../services/account/avatar-update.service.ts | 4 ++ .../services/event/event-upload.service.ts | 4 ++ .../src/services/notifications.service.ts | 6 +++ .../vault-timeout/vault-timeout.service.ts | 2 + libs/common/src/state-migrations/migrate.ts | 1 + .../migrations/4-remove-ever-been-unlocked.ts | 2 + .../migrations/5-add-key-type-to-org-keys.ts | 4 ++ .../tools/send/services/send.service.spec.ts | 4 ++ .../src/vault/services/cipher.service.spec.ts | 14 ++++++ .../vault/services/folder/folder.service.ts | 2 + .../src/vault/services/sync/sync.service.ts | 2 + .../src/button/button.component.spec.ts | 2 + .../dialog-title-container.directive.ts | 2 + .../src/menu/menu.component.spec.ts | 2 + .../radio-button.component.spec.ts | 2 + .../radio-group.component.spec.ts | 2 + .../src/tabs/tab-group/tab-group.component.ts | 2 + .../toggle-group.component.spec.ts | 2 + .../src/toggle-group/toggle.component.spec.ts | 2 + .../src/components/import.component.ts | 2 + .../lastpass-direct-import.service.ts | 2 + 273 files changed, 1602 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index c79ba1bcb1..dd57ca69d5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -39,6 +39,7 @@ { "accessibility": "no-public" } ], "@typescript-eslint/no-explicit-any": "off", // TODO: This should be re-enabled + "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }], "@typescript-eslint/no-this-alias": ["error", { "allowedNames": ["self"] }], "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], diff --git a/apps/browser/src/admin-console/services/browser-policy.service.ts b/apps/browser/src/admin-console/services/browser-policy.service.ts index 0fc924fc24..7b649a7a40 100644 --- a/apps/browser/src/admin-console/services/browser-policy.service.ts +++ b/apps/browser/src/admin-console/services/browser-policy.service.ts @@ -36,6 +36,8 @@ export class BrowserPolicyService extends PolicyService { ]), tap(([activated, autofillEnabled]) => { if (activated === undefined) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setActivateAutoFillOnPageLoadFromPolicy(!autofillEnabled); } }), diff --git a/apps/browser/src/auth/popup/account-switching/account-switcher.component.ts b/apps/browser/src/auth/popup/account-switching/account-switcher.component.ts index 3b75f09c3c..77d9741056 100644 --- a/apps/browser/src/auth/popup/account-switching/account-switcher.component.ts +++ b/apps/browser/src/auth/popup/account-switching/account-switcher.component.ts @@ -64,6 +64,8 @@ export class AccountSwitcherComponent implements OnInit, OnDestroy { async lock(userId?: string) { this.loading = true; await this.vaultTimeoutService.lock(userId ? userId : null); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["lock"]); } @@ -103,6 +105,8 @@ export class AccountSwitcherComponent implements OnInit, OnDestroy { this.messagingService.send("logout"); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["home"]); } diff --git a/apps/browser/src/auth/popup/account-switching/account.component.ts b/apps/browser/src/auth/popup/account-switching/account.component.ts index ccc7141691..3fe83f2414 100644 --- a/apps/browser/src/auth/popup/account-switching/account.component.ts +++ b/apps/browser/src/auth/popup/account-switching/account.component.ts @@ -35,6 +35,8 @@ export class AccountComponent { await this.accountSwitcherService.selectAccount(id); if (id === this.specialAccountAddId) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["home"]); } else { this.location.back(); diff --git a/apps/browser/src/auth/popup/account-switching/current-account.component.ts b/apps/browser/src/auth/popup/account-switching/current-account.component.ts index df6cb32250..06612b8d33 100644 --- a/apps/browser/src/auth/popup/account-switching/current-account.component.ts +++ b/apps/browser/src/auth/popup/account-switching/current-account.component.ts @@ -24,6 +24,8 @@ export class CurrentAccountComponent { if (this.route.snapshot.data.state.includes("account-switcher")) { this.location.back(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/account-switcher"]); } } diff --git a/apps/browser/src/auth/popup/environment.component.ts b/apps/browser/src/auth/popup/environment.component.ts index 6246aaf5db..ed348e563b 100644 --- a/apps/browser/src/auth/popup/environment.component.ts +++ b/apps/browser/src/auth/popup/environment.component.ts @@ -44,6 +44,8 @@ export class EnvironmentComponent extends BaseEnvironmentComponent implements On saved() { super.saved(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([""]); } } diff --git a/apps/browser/src/auth/popup/hint.component.ts b/apps/browser/src/auth/popup/hint.component.ts index 6de2c35301..a1f79cd457 100644 --- a/apps/browser/src/auth/popup/hint.component.ts +++ b/apps/browser/src/auth/popup/hint.component.ts @@ -25,6 +25,8 @@ export class HintComponent extends BaseHintComponent { super(router, i18nService, apiService, platformUtilsService, logService, loginService); super.onSuccessfulSubmit = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute]); }; } diff --git a/apps/browser/src/auth/popup/home.component.ts b/apps/browser/src/auth/popup/home.component.ts index b0b64f658e..b5598f13f7 100644 --- a/apps/browser/src/auth/popup/home.component.ts +++ b/apps/browser/src/auth/popup/home.component.ts @@ -61,6 +61,8 @@ export class HomeComponent implements OnInit, OnDestroy { .pipe(takeUntil(this.destroyed$)) .subscribe(() => { this.setFormValues(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["environment"]); }); } @@ -87,6 +89,8 @@ export class HomeComponent implements OnInit, OnDestroy { this.loginService.setEmail(this.formGroup.value.email); this.loginService.setRememberEmail(this.formGroup.value.rememberEmail); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["login"], { queryParams: { email: this.formGroup.value.email } }); } diff --git a/apps/browser/src/auth/popup/lock.component.ts b/apps/browser/src/auth/popup/lock.component.ts index 18b07a1974..7ba5c09845 100644 --- a/apps/browser/src/auth/popup/lock.component.ts +++ b/apps/browser/src/auth/popup/lock.component.ts @@ -87,8 +87,12 @@ export class LockComponent extends BaseLockComponent { super.onSuccessfulSubmit = async () => { const previousUrl = this.routerService.getPreviousUrl(); if (previousUrl) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigateByUrl(previousUrl); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute]); } }; diff --git a/apps/browser/src/auth/popup/login-decryption-options/login-decryption-options.component.ts b/apps/browser/src/auth/popup/login-decryption-options/login-decryption-options.component.ts index 60ac8579c9..6231b02774 100644 --- a/apps/browser/src/auth/popup/login-decryption-options/login-decryption-options.component.ts +++ b/apps/browser/src/auth/popup/login-decryption-options/login-decryption-options.component.ts @@ -31,6 +31,8 @@ export class LoginDecryptionOptionsComponent extends BaseLoginDecryptionOptionsC // doneLoggingOut already has a message handler that will navigate us if (command === "switchAccountFinish") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } } diff --git a/apps/browser/src/auth/popup/login.component.ts b/apps/browser/src/auth/popup/login.component.ts index 0d191c3bc4..2054033433 100644 --- a/apps/browser/src/auth/popup/login.component.ts +++ b/apps/browser/src/auth/popup/login.component.ts @@ -75,11 +75,15 @@ export class LoginComponent extends BaseLoginComponent { if (this.showPasswordless) { this.formGroup.controls.email.setValue(this.loginService.getEmail()); this.formGroup.controls.rememberEmail.setValue(this.loginService.getRememberEmail()); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.validateEmail(); } } settings() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["environment"]); } diff --git a/apps/browser/src/auth/popup/sso.component.ts b/apps/browser/src/auth/popup/sso.component.ts index d3007a0f74..e7fceab36e 100644 --- a/apps/browser/src/auth/popup/sso.component.ts +++ b/apps/browser/src/auth/popup/sso.component.ts @@ -60,6 +60,8 @@ export class SsoComponent extends BaseSsoComponent { this.clientId = "browser"; super.onSuccessfulLogin = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises syncService.fullSync(true); // If the vault is unlocked then this will clear keys from memory, which we don't want to do @@ -71,6 +73,8 @@ export class SsoComponent extends BaseSsoComponent { }; super.onSuccessfulLoginTde = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises syncService.fullSync(true); }; diff --git a/apps/browser/src/auth/popup/two-factor-options.component.ts b/apps/browser/src/auth/popup/two-factor-options.component.ts index 905b5f9f83..d3d7b7f33a 100644 --- a/apps/browser/src/auth/popup/two-factor-options.component.ts +++ b/apps/browser/src/auth/popup/two-factor-options.component.ts @@ -39,8 +39,12 @@ export class TwoFactorOptionsComponent extends BaseTwoFactorOptionsComponent { // Persist SSO flag back to the 2FA comp if it exists // in order for successful login logic to work properly for // SSO + 2FA in browser extension + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["2fa"], { queryParams: { sso: true } }); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["2fa"]); } } diff --git a/apps/browser/src/auth/popup/two-factor.component.ts b/apps/browser/src/auth/popup/two-factor.component.ts index fde6f4ffc9..d6d276e30e 100644 --- a/apps/browser/src/auth/popup/two-factor.component.ts +++ b/apps/browser/src/auth/popup/two-factor.component.ts @@ -70,10 +70,14 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { configService, ); super.onSuccessfulLogin = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises syncService.fullSync(true); }; super.onSuccessfulLoginTde = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises syncService.fullSync(true); }; @@ -92,6 +96,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { this.selectedProviderType = TwoFactorProviderType.WebAuthn; this.token = this.route.snapshot.paramMap.get("webAuthnResponse"); super.onSuccessfulLogin = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.syncService.fullSync(true); this.messagingService.send("reloadPopup"); window.close(); @@ -122,6 +128,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { type: "warning", }); if (confirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.openCurrentPagePopout(window); } } @@ -133,6 +141,8 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { // This is not awaited so we don't pause the application while the sync is happening. // This call is executed by the service that lives in the background script so it will continue // the sync even if this tab closes. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.syncService.fullSync(true); // Force sidebars (FF && Opera) to reload while exempting current window @@ -162,8 +172,12 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { if (sso) { // We must persist this so when the user returns to the 2FA comp, the // proper onSuccessfulLogin logic is executed. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["2fa-options"], { queryParams: { sso: true } }); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["2fa-options"]); } } diff --git a/apps/browser/src/auth/popup/update-temp-password.component.ts b/apps/browser/src/auth/popup/update-temp-password.component.ts index 946b6a8518..465bc3f703 100644 --- a/apps/browser/src/auth/popup/update-temp-password.component.ts +++ b/apps/browser/src/auth/popup/update-temp-password.component.ts @@ -21,6 +21,8 @@ export class UpdateTempPasswordComponent extends BaseUpdateTempPasswordComponent // doneLoggingOut already has a message handler that will navigate us if (command === "switchAccountFinish") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } } diff --git a/apps/browser/src/auth/popup/utils/auth-popout-window.ts b/apps/browser/src/auth/popup/utils/auth-popout-window.ts index d01f9ad25e..b3807cf713 100644 --- a/apps/browser/src/auth/popup/utils/auth-popout-window.ts +++ b/apps/browser/src/auth/popup/utils/auth-popout-window.ts @@ -21,6 +21,8 @@ async function openUnlockPopout(senderTab: chrome.tabs.Tab, skipNotification = f const existingPopoutWindowTabs = await BrowserApi.tabsQuery({ windowType: "popup" }); existingPopoutWindowTabs.forEach((tab) => { if (extensionUnlockUrls.has(tab.url)) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.removeWindow(tab.windowId); } }); diff --git a/apps/browser/src/autofill/background/context-menus.background.ts b/apps/browser/src/autofill/background/context-menus.background.ts index af43c2500d..aa7873a16c 100644 --- a/apps/browser/src/autofill/background/context-menus.background.ts +++ b/apps/browser/src/autofill/background/context-menus.background.ts @@ -25,9 +25,13 @@ export default class ContextMenusBackground { sender: chrome.runtime.MessageSender, ) => { if (msg.command === "unlockCompleted" && msg.data.target === "contextmenus.background") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.contextMenuClickedHandler .cipherAction(msg.data.commandToRetry.msg.data, msg.data.commandToRetry.sender.tab) .then(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessageData(sender.tab, "closeNotificationBar"); }); } diff --git a/apps/browser/src/autofill/background/notification.background.ts b/apps/browser/src/autofill/background/notification.background.ts index 9644fd0927..cccc0abfb4 100644 --- a/apps/browser/src/autofill/background/notification.background.ts +++ b/apps/browser/src/autofill/background/notification.background.ts @@ -53,6 +53,8 @@ export default class NotificationBackground { BrowserApi.messageListener( "notification.background", (msg: any, sender: chrome.runtime.MessageSender) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.processMessage(msg, sender); }, ); @@ -156,6 +158,8 @@ export default class NotificationBackground { private cleanupNotificationQueue() { for (let i = this.notificationQueue.length - 1; i >= 0; i--) { if (this.notificationQueue[i].expires < new Date()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessageData(this.notificationQueue[i].tab, "closeNotificationBar"); this.notificationQueue.splice(i, 1); } @@ -173,6 +177,8 @@ export default class NotificationBackground { (message) => message.tab.id === tab.id && message.domain === tabDomain, ); if (queueMessage) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendNotificationQueueMessage(tab, queueMessage); } } @@ -251,6 +257,8 @@ export default class NotificationBackground { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.pushAddLoginToQueue(loginDomain, loginInfo, tab, true); return; } @@ -264,6 +272,8 @@ export default class NotificationBackground { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.pushAddLoginToQueue(loginDomain, loginInfo, tab); } else if ( usernameMatches.length === 1 && @@ -274,6 +284,8 @@ export default class NotificationBackground { if (disabledChangePassword) { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.pushChangePasswordToQueue(usernameMatches[0].id, loginDomain, loginInfo.password, tab); } } @@ -307,6 +319,8 @@ export default class NotificationBackground { } if ((await this.authService.getAuthStatus()) < AuthenticationStatus.Unlocked) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.pushChangePasswordToQueue(null, loginDomain, changeData.newPassword, tab, true); return; } @@ -324,6 +338,8 @@ export default class NotificationBackground { id = ciphers[0].id; } if (id != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.pushChangePasswordToQueue(id, loginDomain, changeData.newPassword, tab); } } @@ -350,6 +366,8 @@ export default class NotificationBackground { const loginDomain = Utils.getDomain(tab.url); if (loginDomain) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.pushUnlockVaultToQueue(loginDomain, tab); } } @@ -369,6 +387,8 @@ export default class NotificationBackground { const loginDomain = Utils.getDomain(tab.url); if (loginDomain) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.pushRequestFilelessImportToQueue(loginDomain, tab, importType); } } @@ -448,6 +468,8 @@ export default class NotificationBackground { } this.notificationQueue.splice(i, 1); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessageData(tab, "closeNotificationBar"); if (queueMessage.type === NotificationQueueMessageType.ChangePassword) { @@ -481,6 +503,8 @@ export default class NotificationBackground { const cipher = await this.cipherService.encrypt(newCipher); await this.cipherService.createWithServer(cipher); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessageData(tab, "addedCipher"); } } @@ -496,6 +520,8 @@ export default class NotificationBackground { if (edit) { await this.editItem(cipherView, tab); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessage(tab, "editedCipher"); return; } @@ -548,6 +574,8 @@ export default class NotificationBackground { } this.notificationQueue.splice(i, 1); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessageData(tab, "closeNotificationBar"); const hostname = Utils.getHostname(tab.url); diff --git a/apps/browser/src/autofill/background/overlay.background.spec.ts b/apps/browser/src/autofill/background/overlay.background.spec.ts index b04acaebc6..e0bb7439c2 100644 --- a/apps/browser/src/autofill/background/overlay.background.spec.ts +++ b/apps/browser/src/autofill/background/overlay.background.spec.ts @@ -52,11 +52,15 @@ describe("OverlayBackground", () => { const initOverlayElementPorts = (options = { initList: true, initButton: true }) => { const { initList, initButton } = options; if (initButton) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises overlayBackground["handlePortOnConnect"](createPortSpyMock(AutofillOverlayPort.Button)); buttonPortSpy = overlayBackground["overlayButtonPort"]; } if (initList) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises overlayBackground["handlePortOnConnect"](createPortSpyMock(AutofillOverlayPort.List)); listPortSpy = overlayBackground["overlayListPort"]; } @@ -75,6 +79,8 @@ describe("OverlayBackground", () => { i18nService, platformUtilsService, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises overlayBackground.init(); }); @@ -698,8 +704,12 @@ describe("OverlayBackground", () => { describe("updateAutofillOverlayPosition message handler", () => { beforeEach(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises overlayBackground["handlePortOnConnect"](createPortSpyMock(AutofillOverlayPort.List)); listPortSpy = overlayBackground["overlayListPort"]; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises overlayBackground["handlePortOnConnect"](createPortSpyMock(AutofillOverlayPort.Button)); buttonPortSpy = overlayBackground["overlayButtonPort"]; }); @@ -977,6 +987,8 @@ describe("OverlayBackground", () => { it("skips setting up the overlay port if the port connection is not for an overlay element", () => { const port = createPortSpyMock("not-an-overlay-element"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises overlayBackground["handlePortOnConnect"](port); expect(port.onMessage.addListener).not.toHaveBeenCalled(); diff --git a/apps/browser/src/autofill/background/overlay.background.ts b/apps/browser/src/autofill/background/overlay.background.ts index 0d4fbc2e60..a51b641175 100644 --- a/apps/browser/src/autofill/background/overlay.background.ts +++ b/apps/browser/src/autofill/background/overlay.background.ts @@ -279,6 +279,8 @@ class OverlayBackground implements OverlayBackgroundInterface { * @param forceCloseOverlay - Identifies whether the overlay should be force closed */ private closeOverlay({ sender }: chrome.runtime.Port, forceCloseOverlay = false) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessageData(sender.tab, "closeAutofillOverlay", { forceCloseOverlay }); } @@ -514,10 +516,14 @@ class OverlayBackground implements OverlayBackgroundInterface { */ private handleOverlayButtonClicked(port: chrome.runtime.Port) { if (this.userAuthStatus !== AuthenticationStatus.Unlocked) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.unlockVault(port); return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.openOverlay(false, true); } @@ -624,6 +630,8 @@ class OverlayBackground implements OverlayBackgroundInterface { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessageData(sender.tab, "redirectOverlayFocusOut", { direction }); } @@ -634,6 +642,8 @@ class OverlayBackground implements OverlayBackgroundInterface { * @param sender - The sender of the port message */ private getNewVaultItemDetails({ sender }: chrome.runtime.Port) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessage(sender.tab, { command: "addNewVaultItemFromOverlay" }); } @@ -704,6 +714,8 @@ class OverlayBackground implements OverlayBackgroundInterface { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises Promise.resolve(messageResponse).then((response) => sendResponse(response)); return true; }; diff --git a/apps/browser/src/autofill/background/tabs.background.spec.ts b/apps/browser/src/autofill/background/tabs.background.spec.ts index 304d43bd14..eb9906ebff 100644 --- a/apps/browser/src/autofill/background/tabs.background.spec.ts +++ b/apps/browser/src/autofill/background/tabs.background.spec.ts @@ -39,6 +39,8 @@ describe("TabsBackground", () => { "handleWindowOnFocusChanged", ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises tabsBackground.init(); expect(chrome.windows.onFocusChanged.addListener).toHaveBeenCalledWith( diff --git a/apps/browser/src/autofill/background/tabs.background.ts b/apps/browser/src/autofill/background/tabs.background.ts index 8b4cb356a7..53c801ff7b 100644 --- a/apps/browser/src/autofill/background/tabs.background.ts +++ b/apps/browser/src/autofill/background/tabs.background.ts @@ -20,6 +20,8 @@ export default class TabsBackground { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateCurrentTabData(); this.setupTabEventListeners(); } diff --git a/apps/browser/src/autofill/browser/context-menu-clicked-handler.ts b/apps/browser/src/autofill/browser/context-menu-clicked-handler.ts index 0de2009bbe..e164755092 100644 --- a/apps/browser/src/autofill/browser/context-menu-clicked-handler.ts +++ b/apps/browser/src/autofill/browser/context-menu-clicked-handler.ts @@ -232,6 +232,8 @@ export class ContextMenuClickedHandler { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setLastActive(new Date().getTime()); switch (info.parentMenuItemId) { case AUTOFILL_ID: @@ -277,6 +279,8 @@ export class ContextMenuClickedHandler { }); } else { this.copyToClipboard({ text: cipher.login.password, tab: tab }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, cipher.id); } diff --git a/apps/browser/src/autofill/clipboard/generate-password-to-clipboard-command.ts b/apps/browser/src/autofill/clipboard/generate-password-to-clipboard-command.ts index 5094f6701a..7813acd179 100644 --- a/apps/browser/src/autofill/clipboard/generate-password-to-clipboard-command.ts +++ b/apps/browser/src/autofill/clipboard/generate-password-to-clipboard-command.ts @@ -16,6 +16,8 @@ export class GeneratePasswordToClipboardCommand { const [options] = await this.passwordGenerationService.getOptions(); const password = await this.passwordGenerationService.generatePassword(options); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises copyToClipboard(tab, password); const clearClipboard = await this.stateService.getClearClipboard(); diff --git a/apps/browser/src/autofill/content/autofill-init.ts b/apps/browser/src/autofill/content/autofill-init.ts index 5a2ec3dd39..985ccf75ed 100644 --- a/apps/browser/src/autofill/content/autofill-init.ts +++ b/apps/browser/src/autofill/content/autofill-init.ts @@ -78,6 +78,8 @@ class AutofillInit implements AutofillInitInterface { return pageDetails; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage({ command: "collectPageDetailsResponse", tab: message.tab, @@ -258,6 +260,8 @@ class AutofillInit implements AutofillInitInterface { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises Promise.resolve(messageResponse).then((response) => sendResponse(response)); return true; }; diff --git a/apps/browser/src/autofill/content/autofiller.ts b/apps/browser/src/autofill/content/autofiller.ts index c3a2f7f579..b9dd335c31 100644 --- a/apps/browser/src/autofill/content/autofiller.ts +++ b/apps/browser/src/autofill/content/autofiller.ts @@ -22,6 +22,8 @@ function loadAutofiller() { }; setupExtensionEventListeners(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises triggerUserFillOnLoad(); async function triggerUserFillOnLoad() { @@ -55,6 +57,8 @@ function loadAutofiller() { sender: "autofiller", }; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage(msg); } } diff --git a/apps/browser/src/autofill/content/content-message-handler.ts b/apps/browser/src/autofill/content/content-message-handler.ts index a7252adbe8..caa2883ef8 100644 --- a/apps/browser/src/autofill/content/content-message-handler.ts +++ b/apps/browser/src/autofill/content/content-message-handler.ts @@ -37,11 +37,15 @@ class ContentMessageHandler implements ContentMessageHandlerInterface { if (command === "authResult") { const { lastpass, code, state } = data; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage({ command, code, state, lastpass, referrer }); } if (command === "webAuthnResult") { const { remember } = data; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage({ command, data: data.data, remember, referrer }); } }; @@ -56,6 +60,8 @@ class ContentMessageHandler implements ContentMessageHandlerInterface { */ private handleExtensionMessage = (message: any) => { if (this.forwardCommands.includes(message.command)) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage(message); } }; diff --git a/apps/browser/src/autofill/content/context-menu-handler.ts b/apps/browser/src/autofill/content/context-menu-handler.ts index 30aa40be4a..35c2124a1f 100644 --- a/apps/browser/src/autofill/content/context-menu-handler.ts +++ b/apps/browser/src/autofill/content/context-menu-handler.ts @@ -60,6 +60,8 @@ chrome.runtime.onMessage.addListener((event, _sender, sendResponse) => { if (sendResponse) { sendResponse(identifier); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage({ command: "getClickedElementResponse", sender: "contextMenuHandler", diff --git a/apps/browser/src/autofill/content/notification-bar.ts b/apps/browser/src/autofill/content/notification-bar.ts index 3d1109e92f..e5b2fcb4af 100644 --- a/apps/browser/src/autofill/content/notification-bar.ts +++ b/apps/browser/src/autofill/content/notification-bar.ts @@ -31,6 +31,8 @@ interface HTMLElementWithFormOpId extends HTMLElement { if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", loadNotificationBar); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises loadNotificationBar(); } @@ -942,6 +944,8 @@ async function loadNotificationBar() { // Helper Functions function sendPlatformMessage(msg: any) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage(msg); } diff --git a/apps/browser/src/autofill/content/trigger-autofill-script-injection.ts b/apps/browser/src/autofill/content/trigger-autofill-script-injection.ts index ac5015bd50..95a2391991 100644 --- a/apps/browser/src/autofill/content/trigger-autofill-script-injection.ts +++ b/apps/browser/src/autofill/content/trigger-autofill-script-injection.ts @@ -1,3 +1,5 @@ (function () { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage({ command: "triggerAutofillScriptInjection" }); })(); diff --git a/apps/browser/src/autofill/notification/bar.ts b/apps/browser/src/autofill/notification/bar.ts index bc680c47dc..7ac04ba2c0 100644 --- a/apps/browser/src/autofill/notification/bar.ts +++ b/apps/browser/src/autofill/notification/bar.ts @@ -282,6 +282,8 @@ function setContent(template: HTMLTemplateElement) { } function sendPlatformMessage(msg: Record) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage(msg); } diff --git a/apps/browser/src/autofill/popup/settings/autofill.component.ts b/apps/browser/src/autofill/popup/settings/autofill.component.ts index f0bca311a8..8dc6df6ccd 100644 --- a/apps/browser/src/autofill/popup/settings/autofill.component.ts +++ b/apps/browser/src/autofill/popup/settings/autofill.component.ts @@ -124,14 +124,24 @@ export class AutofillComponent implements OnInit { async commandSettings() { if (this.platformUtilsService.isChrome()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("chrome://extensions/shortcuts"); } else if (this.platformUtilsService.isOpera()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("opera://extensions/shortcuts"); } else if (this.platformUtilsService.isEdge()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("edge://extensions/shortcuts"); } else if (this.platformUtilsService.isVivaldi()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("vivaldi://extensions/shortcuts"); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("https://bitwarden.com/help/keyboard-shortcuts"); } } @@ -155,6 +165,8 @@ export class AutofillComponent implements OnInit { protected openDisablePasswordManagerLink(event: Event) { event.preventDefault(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab(this.disablePasswordManagerLink); } diff --git a/apps/browser/src/autofill/services/autofill-overlay-content.service.spec.ts b/apps/browser/src/autofill/services/autofill-overlay-content.service.spec.ts index a6f7ba710b..fa62bc362d 100644 --- a/apps/browser/src/autofill/services/autofill-overlay-content.service.spec.ts +++ b/apps/browser/src/autofill/services/autofill-overlay-content.service.spec.ts @@ -165,6 +165,8 @@ describe("AutofillOverlayContentService", () => { it("ignores fields that are readonly", () => { autofillFieldData.readonly = true; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillOverlayContentService.setupAutofillOverlayListenerOnField( autofillFieldElement, autofillFieldData, @@ -176,6 +178,8 @@ describe("AutofillOverlayContentService", () => { it("ignores fields that contain a disabled attribute", () => { autofillFieldData.disabled = true; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillOverlayContentService.setupAutofillOverlayListenerOnField( autofillFieldElement, autofillFieldData, @@ -187,6 +191,8 @@ describe("AutofillOverlayContentService", () => { it("ignores fields that are not viewable", () => { autofillFieldData.viewable = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillOverlayContentService.setupAutofillOverlayListenerOnField( autofillFieldElement, autofillFieldData, @@ -199,6 +205,8 @@ describe("AutofillOverlayContentService", () => { AutoFillConstants.ExcludedOverlayTypes.forEach((excludedType) => { autofillFieldData.type = excludedType; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillOverlayContentService.setupAutofillOverlayListenerOnField( autofillFieldElement, autofillFieldData, @@ -211,6 +219,8 @@ describe("AutofillOverlayContentService", () => { it("ignores fields that contain the keyword `search`", () => { autofillFieldData.placeholder = "search"; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillOverlayContentService.setupAutofillOverlayListenerOnField( autofillFieldElement, autofillFieldData, @@ -222,6 +232,8 @@ describe("AutofillOverlayContentService", () => { it("ignores fields that contain the keyword `captcha` ", () => { autofillFieldData.placeholder = "captcha"; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillOverlayContentService.setupAutofillOverlayListenerOnField( autofillFieldElement, autofillFieldData, @@ -233,6 +245,8 @@ describe("AutofillOverlayContentService", () => { it("ignores fields that do not appear as a login field", () => { autofillFieldData.placeholder = "not-a-login-field"; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillOverlayContentService.setupAutofillOverlayListenerOnField( autofillFieldElement, autofillFieldData, @@ -1524,6 +1538,8 @@ describe("AutofillOverlayContentService", () => { placeholder: "username", elementNumber: 1, }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillOverlayContentService.setupAutofillOverlayListenerOnField( autofillFieldElement, autofillFieldData, diff --git a/apps/browser/src/autofill/services/autofill-overlay-content.service.ts b/apps/browser/src/autofill/services/autofill-overlay-content.service.ts index 55bfc32755..ba70cc0548 100644 --- a/apps/browser/src/autofill/services/autofill-overlay-content.service.ts +++ b/apps/browser/src/autofill/services/autofill-overlay-content.service.ts @@ -118,6 +118,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte } if (this.pageDetailsUpdateRequired) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("bgCollectPageDetails", { sender: "autofillOverlayContentService", }); @@ -179,6 +181,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte this.overlayButtonElement.remove(); this.isOverlayButtonVisible = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("autofillOverlayElementClosed", { overlayElement: AutofillOverlayElement.Button, }); @@ -195,6 +199,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte this.overlayListElement.remove(); this.isOverlayListVisible = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("autofillOverlayElementClosed", { overlayElement: AutofillOverlayElement.List, }); @@ -216,6 +222,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte hostname: globalThis.document.location.hostname, }; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("autofillOverlayAddNewVaultItem", { login }); } @@ -327,6 +335,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte */ private handleFormFieldBlurEvent = () => { this.isFieldCurrentlyFocused = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("checkAutofillOverlayFocused"); }; @@ -354,6 +364,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte event.preventDefault(); event.stopPropagation(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.focusOverlayList(); } }; @@ -371,6 +383,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("focusAutofillOverlayList"); } @@ -493,6 +507,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte } if (!formElementHasValue || (!this.isOverlayCiphersPopulated && this.isUserAuthed())) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("openAutofillOverlay"); return; } @@ -583,6 +599,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte this.isOverlayButtonVisible = true; this.setOverlayRepositionEventListeners(); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("updateAutofillOverlayPosition", { overlayElement: AutofillOverlayElement.Button, }); @@ -601,6 +619,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte this.isOverlayListVisible = true; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("updateAutofillOverlayPosition", { overlayElement: AutofillOverlayElement.List, }); @@ -625,6 +645,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte */ private toggleOverlayHidden(isHidden: boolean) { const displayValue = isHidden ? "none" : "block"; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("updateAutofillOverlayHidden", { display: displayValue }); this.isOverlayButtonVisible = !isHidden; @@ -649,6 +671,8 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte focusedFieldRects: { width, height, top, left }, }; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendExtensionMessage("updateFocusedFieldData", { focusedFieldData: this.focusedFieldData, }); diff --git a/apps/browser/src/autofill/services/autofill.service.spec.ts b/apps/browser/src/autofill/services/autofill.service.spec.ts index 300979d77d..6d94beae1e 100644 --- a/apps/browser/src/autofill/services/autofill.service.spec.ts +++ b/apps/browser/src/autofill/services/autofill.service.spec.ts @@ -122,6 +122,8 @@ describe("AutofillService", () => { }); autofillService["autofillScriptPortsSet"] = new Set([port1, port2]); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillService.reloadAutofillScripts(); expect(port1.disconnect).toHaveBeenCalled(); @@ -133,6 +135,8 @@ describe("AutofillService", () => { autofillService["autofillScriptPortsSet"] = new Set([mock()]); jest.spyOn(autofillService as any, "injectAutofillScriptsInAllTabs"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autofillService.reloadAutofillScripts(); expect(autofillService["injectAutofillScriptsInAllTabs"]).toHaveBeenCalled(); diff --git a/apps/browser/src/autofill/services/autofill.service.ts b/apps/browser/src/autofill/services/autofill.service.ts index 74174c153e..a20531d94d 100644 --- a/apps/browser/src/autofill/services/autofill.service.ts +++ b/apps/browser/src/autofill/services/autofill.service.ts @@ -57,6 +57,8 @@ export default class AutofillService implements AutofillServiceInterface { async loadAutofillScriptsOnInstall() { BrowserApi.addListener(chrome.runtime.onConnect, this.handleInjectedScriptPortConnection); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.injectAutofillScriptsInAllTabs(); } @@ -72,6 +74,8 @@ export default class AutofillService implements AutofillServiceInterface { this.autofillScriptPortsSet.delete(port); }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.injectAutofillScriptsInAllTabs(); } @@ -243,9 +247,13 @@ export default class AutofillService implements AutofillServiceInterface { didAutofill = true; if (!options.skipLastUsed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.cipherService.updateLastUsedDate(options.cipher.id); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessage( tab, { @@ -277,6 +285,8 @@ export default class AutofillService implements AutofillServiceInterface { ); if (didAutofill) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientAutofilled, options.cipher.id); if (totp !== null) { return totp; @@ -2000,6 +2010,8 @@ export default class AutofillService implements AutofillServiceInterface { for (let index = 0; index < tabs.length; index++) { const tab = tabs[index]; if (tab.url?.startsWith("http")) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.injectAutofillScripts(tab, 0, false); } } diff --git a/apps/browser/src/autofill/services/collect-autofill-content.service.ts b/apps/browser/src/autofill/services/collect-autofill-content.service.ts index 26eb79a4b8..ea81874e35 100644 --- a/apps/browser/src/autofill/services/collect-autofill-content.service.ts +++ b/apps/browser/src/autofill/services/collect-autofill-content.service.ts @@ -349,6 +349,8 @@ class CollectAutofillContentService implements CollectAutofillContentServiceInte if (element.tagName.toLowerCase() === "span") { this.cacheAutofillFieldElement(index, element, autofillFieldBase); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.autofillOverlayContentService?.setupAutofillOverlayListenerOnField( element, autofillFieldBase, @@ -393,6 +395,8 @@ class CollectAutofillContentService implements CollectAutofillContentServiceInte }; this.cacheAutofillFieldElement(index, element, autofillField); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.autofillOverlayContentService?.setupAutofillOverlayListenerOnField(element, autofillField); return autofillField; }; @@ -1095,6 +1099,8 @@ class CollectAutofillContentService implements CollectAutofillContentServiceInte ) { // We are setting this item to a -1 index because we do not know its position in the DOM. // This value should be updated with the next call to collect page details. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.buildAutofillFieldItem(node as ElementWithOpId, -1); } } @@ -1171,6 +1177,8 @@ class CollectAutofillContentService implements CollectAutofillContentServiceInte return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateAutofillFieldElementData( attributeName, targetElement as ElementWithOpId, diff --git a/apps/browser/src/autofill/services/insert-autofill-content.service.spec.ts b/apps/browser/src/autofill/services/insert-autofill-content.service.spec.ts index a3173204c9..b137d2cd7c 100644 --- a/apps/browser/src/autofill/services/insert-autofill-content.service.spec.ts +++ b/apps/browser/src/autofill/services/insert-autofill-content.service.spec.ts @@ -428,6 +428,8 @@ describe("InsertAutofillContentService", () => { const scriptAction: FillScript = [action, opid, value]; jest.spyOn(insertAutofillContentService["autofillInsertActions"], action); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises insertAutofillContentService["runFillScriptAction"](scriptAction, 0); jest.advanceTimersByTime(20); diff --git a/apps/browser/src/background/commands.background.ts b/apps/browser/src/background/commands.background.ts index a37717baa0..d175402c1e 100644 --- a/apps/browser/src/background/commands.background.ts +++ b/apps/browser/src/background/commands.background.ts @@ -28,6 +28,8 @@ export default class CommandsBackground { async init() { BrowserApi.messageListener("commands.background", (msg: any) => { if (msg.command === "unlockCompleted" && msg.data.target === "commands.background") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.processCommand(msg.data.commandToRetry.msg.command, msg.data.commandToRetry.sender); } }); @@ -62,6 +64,8 @@ export default class CommandsBackground { const options = (await this.passwordGenerationService.getOptions())?.[0] ?? {}; const password = await this.passwordGenerationService.generatePassword(options); this.platformUtilsService.copyToClipboard(password, { window: window }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.passwordGenerationService.addHistory(password); } @@ -101,6 +105,8 @@ export default class CommandsBackground { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.main.openPopup(); } } diff --git a/apps/browser/src/background/idle.background.ts b/apps/browser/src/background/idle.background.ts index 7ef6f7090b..28c056cc0e 100644 --- a/apps/browser/src/background/idle.background.ts +++ b/apps/browser/src/background/idle.background.ts @@ -30,8 +30,12 @@ export default class IdleBackground { const idleHandler = (newState: string) => { if (newState === "active") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.reconnectFromActivity(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.disconnectFromInactivity(); } }; @@ -72,6 +76,8 @@ export default class IdleBackground { window.clearTimeout(this.idleTimer); this.idleTimer = null; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.idle.queryState(IdleInterval, (state: string) => { if (state !== this.idleState) { this.idleState = state; diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 7f87e8508c..4970dedf7a 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -291,6 +291,8 @@ export default class MainBackground { // Services const lockedCallback = async (userId?: string) => { if (this.notificationsService != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.updateConnection(false); } await this.refreshBadge(); @@ -378,6 +380,8 @@ export default class MainBackground { this.messagingService, (clipboardValue, clearMs) => { if (this.systemService != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.systemService.clearClipboard(clipboardValue, clearMs); } }, @@ -463,6 +467,8 @@ export default class MainBackground { // AuthService should send the messages to the background not popup. send = (subscriber: string, arg: any = {}) => { const message = Object.assign({}, { command: subscriber }, arg); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises that.runtimeBackground.processMessage(message, that as any); }; })(); @@ -795,6 +801,8 @@ export default class MainBackground { const options = (await this.passwordGenerationService.getOptions())?.[0] ?? {}; const password = await this.passwordGenerationService.generatePassword(options); this.platformUtilsService.copyToClipboard(password, { window: window }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.passwordGenerationService.addHistory(password); }, async (tab, cipher) => { @@ -803,6 +811,8 @@ export default class MainBackground { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessage(tab, { command: "collectPageDetails", tab: tab, @@ -889,6 +899,8 @@ export default class MainBackground { await new UpdateBadge(self).setBadgeIcon("", win.id); }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.onWindowCreated(async (win) => { if (win.incognito) { await new UpdateBadge(self).setBadgeIcon("", win.id); @@ -905,6 +917,8 @@ export default class MainBackground { if (!this.isPrivateMode) { await this.refreshBadge(); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.fullSync(true); setTimeout(() => this.notificationsService.init(), 2500); resolve(); @@ -1017,10 +1031,14 @@ export default class MainBackground { } if (BrowserApi.manifestVersion === 3) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.sendMessage("updateBadge"); } await this.refreshBadge(); await this.mainContextMenuHandler.noAccess(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.updateConnection(false); await this.systemService.clearPendingClipboard(); await this.systemService.startProcessReload(this.authService); @@ -1041,6 +1059,8 @@ export default class MainBackground { options.frameId = frameId; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessage( tab, { diff --git a/apps/browser/src/background/nativeMessaging.background.ts b/apps/browser/src/background/nativeMessaging.background.ts index 614691a92b..6177763d9c 100644 --- a/apps/browser/src/background/nativeMessaging.background.ts +++ b/apps/browser/src/background/nativeMessaging.background.ts @@ -80,6 +80,8 @@ export class NativeMessagingBackground { private logService: LogService, private authService: AuthService, ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setBiometricFingerprintValidated(false); if (chrome?.permissions?.onAdded) { @@ -92,6 +94,8 @@ export class NativeMessagingBackground { async connect() { this.appId = await this.appIdService.getAppId(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setBiometricFingerprintValidated(false); return new Promise((resolve, reject) => { @@ -138,6 +142,8 @@ export class NativeMessagingBackground { if (this.validatingFingerprint) { this.validatingFingerprint = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setBiometricFingerprintValidated(true); } this.sharedSecret = new SymmetricCryptoKey(decrypted); @@ -165,6 +171,8 @@ export class NativeMessagingBackground { case "verifyFingerprint": { if (this.sharedSecret == null) { this.validatingFingerprint = true; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.showFingerprintDialog(); } break; @@ -178,6 +186,8 @@ export class NativeMessagingBackground { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onMessage(message.message); } }); @@ -383,6 +393,8 @@ export class NativeMessagingBackground { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.runtimeBackground.processMessage({ command: "unlocked" }, null); } break; @@ -402,6 +414,8 @@ export class NativeMessagingBackground { this.publicKey = publicKey; this.privateKey = privateKey; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendUnencrypted({ command: "setupEncryption", publicKey: Utils.fromBufferToB64(publicKey), diff --git a/apps/browser/src/background/runtime.background.ts b/apps/browser/src/background/runtime.background.ts index f5e0c989e0..b0affcfa61 100644 --- a/apps/browser/src/background/runtime.background.ts +++ b/apps/browser/src/background/runtime.background.ts @@ -78,6 +78,8 @@ export default class RuntimeBackground { return true; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.processMessage(msg, sender); return false; }; @@ -127,6 +129,8 @@ export default class RuntimeBackground { await this.main.refreshBadge(); await this.main.refreshMenu(); }, 2000); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.main.avatarUpdateService.loadColorFromState(); this.configService.triggerServerConfigFetch(); } @@ -154,6 +158,8 @@ export default class RuntimeBackground { switch (msg.sender) { case "autofiller": case "autofill_cmd": { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setLastActive(new Date().getTime()); const totpCode = await this.autofillService.doAutoFillActiveTab( [ @@ -323,10 +329,14 @@ export default class RuntimeBackground { private async checkOnInstalled() { setTimeout(async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.autofillService.loadAutofillScriptsOnInstall(); if (this.onInstalledReason != null) { if (this.onInstalledReason === "install") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("https://bitwarden.com/browser-start/"); await this.settingsService.setAutoFillOverlayVisibility( AutofillOverlayVisibility.OnFieldFocus, diff --git a/apps/browser/src/platform/alarms/on-alarm-listener.ts b/apps/browser/src/platform/alarms/on-alarm-listener.ts index 2551693023..274f19f789 100644 --- a/apps/browser/src/platform/alarms/on-alarm-listener.ts +++ b/apps/browser/src/platform/alarms/on-alarm-listener.ts @@ -18,6 +18,8 @@ export const onAlarmListener = async (alarm: chrome.alarms.Alarm) => { switch (key) { case clearClipboardAlarmName: + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises ClearClipboard.run(); break; default: diff --git a/apps/browser/src/platform/alarms/register-alarms.ts b/apps/browser/src/platform/alarms/register-alarms.ts index 2833e7c888..86b9fb9774 100644 --- a/apps/browser/src/platform/alarms/register-alarms.ts +++ b/apps/browser/src/platform/alarms/register-alarms.ts @@ -23,6 +23,8 @@ function alarmsToBeCreated(numberOfAlarms: number): void { let calculatedWhen: number = Date.now() + offset; for (let index = 0; index < numberOfAlarms; index++) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.alarms.create(`bw_alarm${index}`, { periodInMinutes: 1, when: calculatedWhen }); calculatedWhen += offset; } diff --git a/apps/browser/src/platform/background.ts b/apps/browser/src/platform/background.ts index 148ec8280b..3b1ba8f6bb 100644 --- a/apps/browser/src/platform/background.ts +++ b/apps/browser/src/platform/background.ts @@ -27,11 +27,15 @@ if (BrowserApi.manifestVersion === 3) { BrowserApi.messageListener( "runtime.background", (message: { command: string }, sender, sendResponse) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises runtimeMessageListener(message, sender); }, ); } else { const bitwardenMain = ((window as any).bitwardenMain = new MainBackground()); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises bitwardenMain.bootstrap().then(() => { // Finished bootstrapping }); diff --git a/apps/browser/src/platform/background/service-factories/state-service.factory.ts b/apps/browser/src/platform/background/service-factories/state-service.factory.ts index c4d76ad5c8..158fc80b5f 100644 --- a/apps/browser/src/platform/background/service-factories/state-service.factory.ts +++ b/apps/browser/src/platform/background/service-factories/state-service.factory.ts @@ -58,6 +58,8 @@ export async function stateServiceFactory( opts.stateServiceOptions.useAccountCache, ), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises service.init(); return service; } diff --git a/apps/browser/src/platform/browser/browser-api.spec.ts b/apps/browser/src/platform/browser/browser-api.spec.ts index 231f8b78ab..1d11edb92e 100644 --- a/apps/browser/src/platform/browser/browser-api.spec.ts +++ b/apps/browser/src/platform/browser/browser-api.spec.ts @@ -11,6 +11,8 @@ describe("BrowserApi", () => { describe("getWindow", () => { it("will get the current window if a window id is not provided", () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.getWindow(); expect(chrome.windows.getCurrent).toHaveBeenCalledWith({ populate: true }, expect.anything()); @@ -19,6 +21,8 @@ describe("BrowserApi", () => { it("will get the window with the provided id if one is provided", () => { const windowId = 1; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.getWindow(windowId); expect(chrome.windows.get).toHaveBeenCalledWith( @@ -31,6 +35,8 @@ describe("BrowserApi", () => { describe("getCurrentWindow", () => { it("will get the current window", () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.getCurrentWindow(); expect(chrome.windows.getCurrent).toHaveBeenCalledWith({ populate: true }, expect.anything()); @@ -41,6 +47,8 @@ describe("BrowserApi", () => { it("will get the window associated with the passed window id", () => { const windowId = 1; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.getWindowById(windowId); expect(chrome.windows.get).toHaveBeenCalledWith( @@ -55,6 +63,8 @@ describe("BrowserApi", () => { it("removes the window based on the passed window id", () => { const windowId = 10; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.removeWindow(windowId); expect(chrome.windows.remove).toHaveBeenCalledWith(windowId, expect.anything()); @@ -68,6 +78,8 @@ describe("BrowserApi", () => { focused: true, }; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.updateWindowProperties(windowId, windowOptions); expect(chrome.windows.update).toHaveBeenCalledWith( @@ -82,6 +94,8 @@ describe("BrowserApi", () => { it("will focus the window with the provided window id", () => { const windowId = 1; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.focusWindow(windowId); expect(chrome.windows.update).toHaveBeenCalledWith( diff --git a/apps/browser/src/platform/browser/browser-api.ts b/apps/browser/src/platform/browser/browser-api.ts index 4cf3d44e21..b4c53363cc 100644 --- a/apps/browser/src/platform/browser/browser-api.ts +++ b/apps/browser/src/platform/browser/browser-api.ts @@ -321,6 +321,8 @@ export class BrowserApi { } static async focusTab(tabId: number) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.tabs.update(tabId, { active: true, highlighted: true }); } @@ -329,6 +331,8 @@ export class BrowserApi { // Reactivating the active tab dismisses the popup tab. The promise final // condition is only called if the popup wasn't already dismissed (future proofing). // ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1433604 + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises browser.tabs.update({ active: true }).finally(win.close); } else { win.close(); diff --git a/apps/browser/src/platform/decorators/session-sync-observable/browser-session.decorator.ts b/apps/browser/src/platform/decorators/session-sync-observable/browser-session.decorator.ts index 47fb5d7e08..8cf84ef153 100644 --- a/apps/browser/src/platform/decorators/session-sync-observable/browser-session.decorator.ts +++ b/apps/browser/src/platform/decorators/session-sync-observable/browser-session.decorator.ts @@ -41,6 +41,8 @@ export function browserSession>(constructor: TCto storageSerice, metadata, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises syncer.init(); return syncer; } diff --git a/apps/browser/src/platform/decorators/session-sync-observable/session-syncer.spec.ts b/apps/browser/src/platform/decorators/session-sync-observable/session-syncer.spec.ts index f163cf495a..18f0ceac60 100644 --- a/apps/browser/src/platform/decorators/session-sync-observable/session-syncer.spec.ts +++ b/apps/browser/src/platform/decorators/session-sync-observable/session-syncer.spec.ts @@ -88,6 +88,8 @@ describe("session syncer", () => { // block observing the subject jest.spyOn(sut as any, "observe").mockImplementation(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.init(); expect(sut["ignoreNUpdates"]).toBe(3); @@ -99,6 +101,8 @@ describe("session syncer", () => { // block observing the subject jest.spyOn(sut as any, "observe").mockImplementation(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.init(); expect(sut["ignoreNUpdates"]).toBe(1); @@ -109,6 +113,8 @@ describe("session syncer", () => { //Block a call to update const updateSpy = jest.spyOn(sut as any, "updateFromMemory").mockImplementation(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.init(); await awaitAsync(); @@ -120,6 +126,8 @@ describe("session syncer", () => { //Block a call to update const updateSpy = jest.spyOn(sut as any, "update").mockImplementation(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.init(); await awaitAsync(); @@ -135,6 +143,8 @@ describe("session syncer", () => { beforeEach(() => { sendMessageSpy = jest.spyOn(BrowserApi, "sendMessage"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.init(); behaviorSubject.next(value); @@ -160,6 +170,8 @@ describe("session syncer", () => { nextSpy = jest.spyOn(behaviorSubject, "next"); sendMessageSpy = jest.spyOn(BrowserApi, "sendMessage"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.init(); }); @@ -222,6 +234,8 @@ describe("session syncer", () => { jest.spyOn(SyncedItemMetadata, "builder").mockReturnValue(builder); saveSpy = jest.spyOn(storageService, "save"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.init(); await awaitAsync(); }); diff --git a/apps/browser/src/platform/decorators/session-sync-observable/session-syncer.ts b/apps/browser/src/platform/decorators/session-sync-observable/session-syncer.ts index 7f57e6431e..a91798a9d0 100644 --- a/apps/browser/src/platform/decorators/session-sync-observable/session-syncer.ts +++ b/apps/browser/src/platform/decorators/session-sync-observable/session-syncer.ts @@ -74,6 +74,8 @@ export class SessionSyncer { private listenForUpdates() { // This is an unawaited promise, but it will be executed asynchronously in the background. BrowserApi.messageListener(this.updateMessageCommand, (message) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateFromMessage(message); }); } diff --git a/apps/browser/src/platform/listeners/on-command-listener.ts b/apps/browser/src/platform/listeners/on-command-listener.ts index 893136205a..b0dc3bf5f6 100644 --- a/apps/browser/src/platform/listeners/on-command-listener.ts +++ b/apps/browser/src/platform/listeners/on-command-listener.ts @@ -100,5 +100,7 @@ const doGeneratePasswordToClipboard = async (tab: chrome.tabs.Tab): Promise { if (details.reason != null && details.reason === chrome.runtime.OnInstalledReason.INSTALL) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("https://bitwarden.com/browser-start/"); if (await environmentService.hasManagedEnvironment()) { diff --git a/apps/browser/src/platform/listeners/update-badge.ts b/apps/browser/src/platform/listeners/update-badge.ts index 8f624e1e82..9cc9c9b510 100644 --- a/apps/browser/src/platform/listeners/update-badge.ts +++ b/apps/browser/src/platform/listeners/update-badge.ts @@ -167,6 +167,8 @@ export class UpdateBadge { setBadgeBackgroundColor(color = "#294e5f") { if (this.badgeAction?.setBadgeBackgroundColor) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.badgeAction.setBadgeBackgroundColor({ color }); } if (this.isOperaSidebar(this.sidebarAction)) { @@ -196,6 +198,8 @@ export class UpdateBadge { private setActionText(text: string, tabId?: number) { if (this.badgeAction?.setBadgeText) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.badgeAction.setBadgeText({ text, tabId }); } } @@ -206,6 +210,8 @@ export class UpdateBadge { } else if (this.sidebarAction) { // Firefox const title = `Bitwarden${Utils.isNullOrEmpty(text) ? "" : ` [${text}]`}`; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sidebarAction.setTitle({ title, tabId }); } } @@ -216,6 +222,8 @@ export class UpdateBadge { } if (this.useSyncApiCalls) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.badgeAction.setIcon(options); } else { await new Promise((resolve) => this.badgeAction.setIcon(options, () => resolve())); diff --git a/apps/browser/src/platform/popup/browser-popup-utils.spec.ts b/apps/browser/src/platform/popup/browser-popup-utils.spec.ts index d640a3bc23..ffe485e1a2 100644 --- a/apps/browser/src/platform/popup/browser-popup-utils.spec.ts +++ b/apps/browser/src/platform/popup/browser-popup-utils.spec.ts @@ -196,6 +196,8 @@ describe("BrowserPopupUtils", () => { jest.spyOn(BrowserPopupUtils as any, "isSingleActionPopoutOpen").mockResolvedValueOnce(false); jest.spyOn(BrowserPopupUtils as any, "buildPopoutUrl"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.openPopout(url); expect(BrowserPopupUtils["buildPopoutUrl"]).not.toHaveBeenCalled(); diff --git a/apps/browser/src/platform/services/browser-file-download.service.ts b/apps/browser/src/platform/services/browser-file-download.service.ts index ec1de5f366..8cb4d498a3 100644 --- a/apps/browser/src/platform/services/browser-file-download.service.ts +++ b/apps/browser/src/platform/services/browser-file-download.service.ts @@ -19,6 +19,8 @@ export class BrowserFileDownloadService implements FileDownloadService { } else { data = Utils.fromBufferToB64(request.blobData as ArrayBuffer); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises SafariApp.sendMessageToApp( "downloadFile", JSON.stringify({ diff --git a/apps/browser/src/platform/services/browser-platform-utils.service.ts b/apps/browser/src/platform/services/browser-platform-utils.service.ts index a610afd733..733e121ee1 100644 --- a/apps/browser/src/platform/services/browser-platform-utils.service.ts +++ b/apps/browser/src/platform/services/browser-platform-utils.service.ts @@ -174,6 +174,8 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService } launchUri(uri: string, options?: any): void { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab(uri, options && options.extensionPage === true); } @@ -228,6 +230,8 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService const clearMs: number = options && options.clearMs ? options.clearMs : null; if (this.isSafari()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises SafariApp.sendMessageToApp("copyToClipboard", text).then(() => { if (!clearing && this.clipboardWriteCallback != null) { this.clipboardWriteCallback(text, clearMs); diff --git a/apps/browser/src/platform/state/background-derived-state.ts b/apps/browser/src/platform/state/background-derived-state.ts index 420901b0f8..7407f50780 100644 --- a/apps/browser/src/platform/state/background-derived-state.ts +++ b/apps/browser/src/platform/state/background-derived-state.ts @@ -55,6 +55,8 @@ export class BackgroundDerivedState< const stateSubscription = this.state$.subscribe((state) => { // delay to allow the foreground to connect. This may just be needed for testing setTimeout(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendNewMessage( { action: "nextState", @@ -96,6 +98,8 @@ export class BackgroundDerivedState< port: chrome.runtime.Port, ) { const id = Utils.newGuid(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendMessage( { ...message, @@ -110,6 +114,8 @@ export class BackgroundDerivedState< response: Omit, port: chrome.runtime.Port, ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendMessage( { ...response, diff --git a/apps/browser/src/platform/state/derived-state-service-interactions.spec.ts b/apps/browser/src/platform/state/derived-state-service-interactions.spec.ts index bc4e82315c..8b07f7e8a3 100644 --- a/apps/browser/src/platform/state/derived-state-service-interactions.spec.ts +++ b/apps/browser/src/platform/state/derived-state-service-interactions.spec.ts @@ -72,6 +72,8 @@ describe("foreground background derived state interactions", () => { const dateString = "2020-12-12"; const emissions = trackEmissions(background.state$); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises foreground.forceValue(new Date(dateString)); await awaitAsync(); @@ -87,6 +89,8 @@ describe("foreground background derived state interactions", () => { expect(foreground["port"]).toBeDefined(); const newDate = new Date(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises foreground.forceValue(newDate); await awaitAsync(); @@ -100,6 +104,8 @@ describe("foreground background derived state interactions", () => { expect(foreground["port"]).toBeUndefined(); const newDate = new Date(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises foreground.forceValue(newDate); await awaitAsync(); diff --git a/apps/browser/src/popup/app.component.ts b/apps/browser/src/popup/app.component.ts index 174a757b3e..e1ec0678d3 100644 --- a/apps/browser/src/popup/app.component.ts +++ b/apps/browser/src/popup/app.component.ts @@ -93,20 +93,30 @@ export class AppComponent implements OnInit, OnDestroy { }); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["home"]); }); this.changeDetectorRef.detectChanges(); } else if (msg.command === "authBlocked") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["home"]); } else if ( msg.command === "locked" && (msg.userId == null || msg.userId == this.activeUserId) ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["lock"]); } else if (msg.command === "showDialog") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.showDialog(msg); } else if (msg.command === "showNativeMessagingFinterprintDialog") { // TODO: Should be refactored to live in another service. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.showNativeMessagingFingerprintDialog(msg); } else if (msg.command === "showToast") { this.showToast(msg); @@ -121,13 +131,19 @@ export class AppComponent implements OnInit, OnDestroy { 2000, ); } else if (msg.command === "reloadPopup") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } else if (msg.command === "convertAccountToKeyConnector") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/remove-password"]); } else if (msg.command === "switchAccountFinish") { // TODO: unset loading? // this.loading = false; } else if (msg.command == "update-temp-password") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/update-temp-password"]); } else { msg.webExtSender = sender; diff --git a/apps/browser/src/popup/components/pop-out.component.ts b/apps/browser/src/popup/components/pop-out.component.ts index 8858757435..d60936a235 100644 --- a/apps/browser/src/popup/components/pop-out.component.ts +++ b/apps/browser/src/popup/components/pop-out.component.ts @@ -25,6 +25,8 @@ export class PopOutComponent implements OnInit { } expand() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.openCurrentPagePopout(window); } } diff --git a/apps/browser/src/popup/main.ts b/apps/browser/src/popup/main.ts index ef69e0342f..05ecfb43e5 100644 --- a/apps/browser/src/popup/main.ts +++ b/apps/browser/src/popup/main.ts @@ -19,6 +19,8 @@ if (process.env.ENV === "production") { } function init() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: true }); } diff --git a/apps/browser/src/popup/services/services.module.ts b/apps/browser/src/popup/services/services.module.ts index 9a8484e8a2..536c4de4da 100644 --- a/apps/browser/src/popup/services/services.module.ts +++ b/apps/browser/src/popup/services/services.module.ts @@ -131,6 +131,8 @@ const mainBackground: MainBackground = needsBackgroundInit function createLocalBgService() { const localBgService = new MainBackground(isPrivateMode); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises localBgService.bootstrap(); return localBgService; } diff --git a/apps/browser/src/popup/settings/excluded-domains.component.ts b/apps/browser/src/popup/settings/excluded-domains.component.ts index cb1810521f..a7708c7ce3 100644 --- a/apps/browser/src/popup/settings/excluded-domains.component.ts +++ b/apps/browser/src/popup/settings/excluded-domains.component.ts @@ -51,6 +51,8 @@ export class ExcludedDomainsComponent implements OnInit, OnDestroy { await this.loadCurrentUris(); this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "tabChanged": @@ -106,6 +108,8 @@ export class ExcludedDomainsComponent implements OnInit, OnDestroy { } await this.stateService.setNeverDomains(savedDomains); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/tabs/settings"]); } diff --git a/apps/browser/src/popup/settings/folders.component.ts b/apps/browser/src/popup/settings/folders.component.ts index 6e97fb332a..edf7fe939e 100644 --- a/apps/browser/src/popup/settings/folders.component.ts +++ b/apps/browser/src/popup/settings/folders.component.ts @@ -28,10 +28,14 @@ export class FoldersComponent { } folderSelected(folder: FolderView) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/edit-folder"], { queryParams: { folderId: folder.id } }); } addFolder() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/add-folder"]); } } diff --git a/apps/browser/src/popup/settings/help-and-feedback.component.ts b/apps/browser/src/popup/settings/help-and-feedback.component.ts index 0ff9887353..cba57529f0 100644 --- a/apps/browser/src/popup/settings/help-and-feedback.component.ts +++ b/apps/browser/src/popup/settings/help-and-feedback.component.ts @@ -8,13 +8,19 @@ import { BrowserApi } from "../../platform/browser/browser-api"; }) export class HelpAndFeedbackComponent { launchHelp() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("https://bitwarden.com/help/"); } launchContactForm() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("https://bitwarden.com/contact/"); } launchForums() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("https://bitwarden.com/getinvolved/"); } } diff --git a/apps/browser/src/popup/settings/settings.component.ts b/apps/browser/src/popup/settings/settings.component.ts index 64edb6ae42..f15b25d92d 100644 --- a/apps/browser/src/popup/settings/settings.component.ts +++ b/apps/browser/src/popup/settings/settings.component.ts @@ -397,6 +397,8 @@ export class SettingsComponent implements OnInit { const error = BiometricErrors[e as BiometricErrorTypes]; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.dialogService.openSimpleDialog({ title: { key: error.title }, content: { key: error.description }, @@ -444,6 +446,8 @@ export class SettingsComponent implements OnInit { type: "info", }); if (confirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab(this.environmentService.getWebVaultUrl()); } } @@ -455,6 +459,8 @@ export class SettingsComponent implements OnInit { type: "info", }); if (confirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("https://bitwarden.com/help/setup-two-step-login/"); } } @@ -466,23 +472,31 @@ export class SettingsComponent implements OnInit { type: "info", }); if (confirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab("https://bitwarden.com/help/about-organizations/"); } } async webVault() { const url = this.environmentService.getWebVaultUrl(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab(url); } async import() { await this.router.navigate(["/import"]); if (await BrowserApi.isPopupOpen()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.openCurrentPagePopout(window); } } export() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/export"]); } @@ -504,6 +518,8 @@ export class SettingsComponent implements OnInit { rate() { const deviceType = this.platformUtilsService.getDevice(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab((RateUrls as any)[deviceType]); } diff --git a/apps/browser/src/services/vault-timeout/vault-timeout.service.ts b/apps/browser/src/services/vault-timeout/vault-timeout.service.ts index 228c63f0b8..9e9a24fb9c 100644 --- a/apps/browser/src/services/vault-timeout/vault-timeout.service.ts +++ b/apps/browser/src/services/vault-timeout/vault-timeout.service.ts @@ -4,8 +4,12 @@ import { SafariApp } from "../../browser/safariApp"; export default class VaultTimeoutService extends BaseVaultTimeoutService { startCheck() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.checkVaultTimeout(); if (this.platformUtilsService.isSafari()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.checkSafari(); } else { setInterval(() => this.checkVaultTimeout(), 10 * 1000); // check every 10 seconds @@ -20,6 +24,8 @@ export default class VaultTimeoutService extends BaseVaultTimeoutService { while (true) { try { await SafariApp.sendMessageToApp("sleep"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.checkVaultTimeout(); } catch (e) { // eslint-disable-next-line diff --git a/apps/browser/src/tools/popup/components/file-popout-callout.component.ts b/apps/browser/src/tools/popup/components/file-popout-callout.component.ts index eae0f12ad9..9218403b13 100644 --- a/apps/browser/src/tools/popup/components/file-popout-callout.component.ts +++ b/apps/browser/src/tools/popup/components/file-popout-callout.component.ts @@ -29,6 +29,8 @@ export class FilePopoutCalloutComponent implements OnInit { } popOutWindow() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.openCurrentPagePopout(window); } } diff --git a/apps/browser/src/tools/popup/generator/generator.component.ts b/apps/browser/src/tools/popup/generator/generator.component.ts index e4263d3caa..c683b6f4a6 100644 --- a/apps/browser/src/tools/popup/generator/generator.component.ts +++ b/apps/browser/src/tools/popup/generator/generator.component.ts @@ -62,6 +62,8 @@ export class GeneratorComponent extends BaseGeneratorComponent { this.cipherState.login.username = this.username; } this.addEditCipherInfo.cipher = this.cipherState; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setAddEditCipherInfo(this.addEditCipherInfo); this.close(); } diff --git a/apps/browser/src/tools/popup/send/send-add-edit.component.ts b/apps/browser/src/tools/popup/send/send-add-edit.component.ts index ef2b57992a..0eff33176a 100644 --- a/apps/browser/src/tools/popup/send/send-add-edit.component.ts +++ b/apps/browser/src/tools/popup/send/send-add-edit.component.ts @@ -67,6 +67,8 @@ export class SendAddEditComponent extends BaseAddEditComponent { } popOutWindow() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.openCurrentPagePopout(window); } @@ -117,6 +119,8 @@ export class SendAddEditComponent extends BaseAddEditComponent { cancel() { // If true, the window was pop'd out on the add-send page. location.back will not work if ((window as any).previousPopupUrl.startsWith("/add-send")) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["tabs/send"]); } else { this.location.back(); diff --git a/apps/browser/src/tools/popup/send/send-groupings.component.ts b/apps/browser/src/tools/popup/send/send-groupings.component.ts index 40bb38d574..25fa67d51a 100644 --- a/apps/browser/src/tools/popup/send/send-groupings.component.ts +++ b/apps/browser/src/tools/popup/send/send-groupings.component.ts @@ -86,25 +86,35 @@ export class SendGroupingsComponent extends BaseSendComponent { } if (!this.syncService.syncInProgress) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } else { this.loadedTimeout = window.setTimeout(() => { if (!this.loaded) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } }, 5000); } if (!this.syncService.syncInProgress || restoredScopeState) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.setContentScrollY(window, this.state?.scrollY); } // Load all sends if sync completed in background this.broadcasterService.subscribe(ComponentId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": window.setTimeout(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); }, 500); break; @@ -123,16 +133,22 @@ export class SendGroupingsComponent extends BaseSendComponent { window.clearTimeout(this.loadedTimeout); } // Save state + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.saveState(); // Unsubscribe this.broadcasterService.unsubscribe(ComponentId); } async selectType(type: SendType) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/send-type"], { queryParams: { type: type } }); } async selectSend(s: SendView) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/edit-send"], { queryParams: { sendId: s.id } }); } @@ -140,6 +156,8 @@ export class SendGroupingsComponent extends BaseSendComponent { if (this.disableSend) { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/add-send"]); } @@ -147,6 +165,8 @@ export class SendGroupingsComponent extends BaseSendComponent { if (this.disableSend) { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.removePassword(s); } diff --git a/apps/browser/src/tools/popup/send/send-type.component.ts b/apps/browser/src/tools/popup/send/send-type.component.ts index f72be474f1..4b27edc043 100644 --- a/apps/browser/src/tools/popup/send/send-type.component.ts +++ b/apps/browser/src/tools/popup/send/send-type.component.ts @@ -101,18 +101,26 @@ export class SendTypeComponent extends BaseSendComponent { // Restore state and remove reference if (this.applySavedState && this.state != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.setContentScrollY(window, this.state?.scrollY); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setBrowserSendTypeComponentState(null); }); // Refresh Send list if sync completed in background this.broadcasterService.subscribe(ComponentId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": if (message.successfully) { this.refreshTimeout = window.setTimeout(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.refresh(); }, 500); } @@ -132,12 +140,16 @@ export class SendTypeComponent extends BaseSendComponent { window.clearTimeout(this.refreshTimeout); } // Save state + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.saveState(); // Unsubscribe this.broadcasterService.unsubscribe(ComponentId); } async selectSend(s: SendView) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/edit-send"], { queryParams: { sendId: s.id } }); } @@ -145,6 +157,8 @@ export class SendTypeComponent extends BaseSendComponent { if (this.disableSend) { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/add-send"], { queryParams: { type: this.type } }); } @@ -152,6 +166,8 @@ export class SendTypeComponent extends BaseSendComponent { if (this.disableSend) { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.removePassword(s); } diff --git a/apps/browser/src/tools/popup/settings/export.component.ts b/apps/browser/src/tools/popup/settings/export.component.ts index b45e99a59b..dd18bb1e94 100644 --- a/apps/browser/src/tools/popup/settings/export.component.ts +++ b/apps/browser/src/tools/popup/settings/export.component.ts @@ -50,6 +50,8 @@ export class ExportComponent extends BaseExportComponent { protected saved() { super.saved(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/tabs/settings"]); } } diff --git a/apps/browser/src/tools/popup/settings/import/import-browser.component.ts b/apps/browser/src/tools/popup/settings/import/import-browser.component.ts index 3fea3aad04..7ee4877ce1 100644 --- a/apps/browser/src/tools/popup/settings/import/import-browser.component.ts +++ b/apps/browser/src/tools/popup/settings/import/import-browser.component.ts @@ -26,6 +26,8 @@ export class ImportBrowserComponent { constructor(private router: Router) {} protected async onSuccessfulImport(organizationId: string): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/tabs/settings"]); } } diff --git a/apps/browser/src/vault/fido2/browser-fido2-user-interface.service.ts b/apps/browser/src/vault/fido2/browser-fido2-user-interface.service.ts index a45b0153a3..6109112b5f 100644 --- a/apps/browser/src/vault/fido2/browser-fido2-user-interface.service.ts +++ b/apps/browser/src/vault/fido2/browser-fido2-user-interface.service.ts @@ -149,6 +149,8 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi } static sendMessage(msg: BrowserFido2Message) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.sendMessage(BrowserFido2MessageName, msg); } @@ -198,6 +200,8 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi fromEvent(abortController.signal, "abort") .pipe(takeUntil(this.destroy$)) .subscribe(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.close(); BrowserFido2UserInterfaceSession.sendMessage({ type: "AbortRequest", @@ -214,7 +218,11 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi ) .subscribe((msg) => { if (msg.type === "AbortResponse") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.abort(msg.fallbackRequested); } }); @@ -364,7 +372,11 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi takeUntil(this.destroy$), ) .subscribe(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.abort(true); }); diff --git a/apps/browser/src/vault/fido2/content/content-script.ts b/apps/browser/src/vault/fido2/content/content-script.ts index 3d64b2cfb6..e12c592262 100644 --- a/apps/browser/src/vault/fido2/content/content-script.ts +++ b/apps/browser/src/vault/fido2/content/content-script.ts @@ -43,6 +43,8 @@ function injectPageScript() { } // If the page-script already exists, send a reconnect message to the page-script + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises messenger.sendReconnectCommand(); } @@ -130,8 +132,12 @@ async function run() { const port = chrome.runtime.connect({ name: "fido2ContentScriptReady" }); port.onDisconnect.addListener(() => { // Cleanup the messenger and remove the event listener + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises messenger.destroy(); }); } +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises run(); diff --git a/apps/browser/src/vault/fido2/content/messaging/messenger.spec.ts b/apps/browser/src/vault/fido2/content/messaging/messenger.spec.ts index 4b108a5581..0c46ac39aa 100644 --- a/apps/browser/src/vault/fido2/content/messaging/messenger.spec.ts +++ b/apps/browser/src/vault/fido2/content/messaging/messenger.spec.ts @@ -31,6 +31,8 @@ describe("Messenger", () => { it("should deliver message to B when sending request from A", () => { const request = createRequest(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises messengerA.request(request); const received = handlerB.receive(); @@ -64,6 +66,8 @@ describe("Messenger", () => { it("should deliver abort signal to B when requesting abort", () => { const abortController = new AbortController(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises messengerA.request(createRequest(), abortController); abortController.abort(); @@ -99,9 +103,13 @@ describe("Messenger", () => { it("should dispatch the destroy event on messenger destruction", async () => { const request = createRequest(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises messengerA.request(request); const dispatchEventSpy = jest.spyOn((messengerA as any).onDestroy, "dispatchEvent"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises messengerA.destroy(); expect(dispatchEventSpy).toHaveBeenCalledWith(expect.any(Event)); @@ -109,10 +117,14 @@ describe("Messenger", () => { it("should trigger onDestroyListener when the destroy event is dispatched", async () => { const request = createRequest(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises messengerA.request(request); const onDestroyListener = jest.fn(); (messengerA as any).onDestroy.addEventListener("destroy", onDestroyListener); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises messengerA.destroy(); expect(onDestroyListener).toHaveBeenCalled(); diff --git a/apps/browser/src/vault/fido2/content/page-script.ts b/apps/browser/src/vault/fido2/content/page-script.ts index b489fd0f3e..9adea68307 100644 --- a/apps/browser/src/vault/fido2/content/page-script.ts +++ b/apps/browser/src/vault/fido2/content/page-script.ts @@ -34,6 +34,8 @@ if (!browserNativeWebauthnSupport) { } if (browserNativeWebauthnSupport) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable().then((available) => { browserNativeWebauthnPlatformAuthenticatorSupport = available; diff --git a/apps/browser/src/vault/fido2/content/trigger-fido2-content-script-injection.ts b/apps/browser/src/vault/fido2/content/trigger-fido2-content-script-injection.ts index 5b90247281..7ca6956729 100644 --- a/apps/browser/src/vault/fido2/content/trigger-fido2-content-script-injection.ts +++ b/apps/browser/src/vault/fido2/content/trigger-fido2-content-script-injection.ts @@ -1,3 +1,5 @@ (function () { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises chrome.runtime.sendMessage({ command: "triggerFido2ContentScriptInjection" }); })(); diff --git a/apps/browser/src/vault/popup/components/action-buttons.component.ts b/apps/browser/src/vault/popup/components/action-buttons.component.ts index 5dbf4f35b8..a3b8259c82 100644 --- a/apps/browser/src/vault/popup/components/action-buttons.component.ts +++ b/apps/browser/src/vault/popup/components/action-buttons.component.ts @@ -68,10 +68,16 @@ export class ActionButtonsComponent { ); if (typeI18nKey === "password") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, cipher.id); } else if (typeI18nKey === "verificationCodeTotp") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedHiddenField, cipher.id); } else if (typeI18nKey === "securityCode") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedCardCode, cipher.id); } } diff --git a/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts b/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts index d062a7b0a0..bd619138e6 100644 --- a/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts +++ b/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts @@ -99,6 +99,8 @@ export class Fido2UseBrowserLinkComponent { }; savedDomains[validDomain] = null; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setNeverDomains(savedDomains); this.platformUtilsService.showToast( diff --git a/apps/browser/src/vault/popup/components/fido2/fido2.component.ts b/apps/browser/src/vault/popup/components/fido2/fido2.component.ts index a0cc808a6f..fcd9dd20a7 100644 --- a/apps/browser/src/vault/popup/components/fido2/fido2.component.ts +++ b/apps/browser/src/vault/popup/components/fido2/fido2.component.ts @@ -272,6 +272,8 @@ export class Fido2Component implements OnInit, OnDestroy { } viewPasskey() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/view-cipher"], { queryParams: { cipherId: this.cipher.id, @@ -290,6 +292,8 @@ export class Fido2Component implements OnInit, OnDestroy { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/add-cipher"], { queryParams: { name: Utils.getHostname(this.url), diff --git a/apps/browser/src/vault/popup/components/vault/add-edit.component.ts b/apps/browser/src/vault/popup/components/vault/add-edit.component.ts index 6960fc6dff..db785feb02 100644 --- a/apps/browser/src/vault/popup/components/vault/add-edit.component.ts +++ b/apps/browser/src/vault/popup/components/vault/add-edit.component.ts @@ -198,6 +198,8 @@ export class AddEditComponent extends BaseAddEditComponent { } if (this.cloneMode) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/tabs/vault"]); } else { this.location.back(); @@ -213,8 +215,12 @@ export class AddEditComponent extends BaseAddEditComponent { .createUrlTree(["/attachments"], { queryParams: { cipherId: this.cipher.id } }) .toString(); const currentBaseUrl = window.location.href.replace(this.router.url, ""); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.openCurrentPagePopout(window, currentBaseUrl + destinationUrl); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/attachments"], { queryParams: { cipherId: this.cipher.id } }); } } @@ -222,6 +228,8 @@ export class AddEditComponent extends BaseAddEditComponent { editCollections() { super.editCollections(); if (this.cipher.organizationId != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/collections"], { queryParams: { cipherId: this.cipher.id } }); } } @@ -237,6 +245,8 @@ export class AddEditComponent extends BaseAddEditComponent { } if (this.inAddEditPopoutWindow()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises closeAddEditVaultItemPopout(); return; } @@ -248,6 +258,8 @@ export class AddEditComponent extends BaseAddEditComponent { const confirmed = await super.generateUsername(); if (confirmed) { await this.saveCipherState(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["generator"], { queryParams: { type: "username" } }); } return confirmed; @@ -257,6 +269,8 @@ export class AddEditComponent extends BaseAddEditComponent { const confirmed = await super.generatePassword(); if (confirmed) { await this.saveCipherState(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["generator"], { queryParams: { type: "password" } }); } return confirmed; @@ -265,6 +279,8 @@ export class AddEditComponent extends BaseAddEditComponent { async delete(): Promise { const confirmed = await super.delete(); if (confirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/tabs/vault"]); } return confirmed; diff --git a/apps/browser/src/vault/popup/components/vault/current-tab.component.ts b/apps/browser/src/vault/popup/components/vault/current-tab.component.ts index 872f6c8d97..9e32654526 100644 --- a/apps/browser/src/vault/popup/components/vault/current-tab.component.ts +++ b/apps/browser/src/vault/popup/components/vault/current-tab.component.ts @@ -75,11 +75,15 @@ export class CurrentTabComponent implements OnInit, OnDestroy { this.inSidebar = BrowserPopupUtils.inSidebar(window); this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": if (this.isLoading) { window.setTimeout(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); }, 500); } @@ -142,6 +146,8 @@ export class CurrentTabComponent implements OnInit, OnDestroy { } addCipher() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/add-cipher"], { queryParams: { name: this.hostname, @@ -152,6 +158,8 @@ export class CurrentTabComponent implements OnInit, OnDestroy { } viewCipher(cipher: CipherView) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/view-cipher"], { queryParams: { cipherId: cipher.id } }); } @@ -210,6 +218,8 @@ export class CurrentTabComponent implements OnInit, OnDestroy { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/tabs/vault"], { queryParams: { searchText: this.searchText } }); } @@ -233,6 +243,8 @@ export class CurrentTabComponent implements OnInit, OnDestroy { this.hostname = Utils.getHostname(this.url); this.pageDetails = []; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessage(this.tab, { command: "collectPageDetails", tab: this.tab, @@ -284,6 +296,8 @@ export class CurrentTabComponent implements OnInit, OnDestroy { } async goToSettings() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["autofill"]); } diff --git a/apps/browser/src/vault/popup/components/vault/share.component.ts b/apps/browser/src/vault/popup/components/vault/share.component.ts index 7f99ea72db..1a6c9c059e 100644 --- a/apps/browser/src/vault/popup/components/vault/share.component.ts +++ b/apps/browser/src/vault/popup/components/vault/share.component.ts @@ -39,6 +39,8 @@ export class ShareComponent extends BaseShareComponent { async ngOnInit() { // eslint-disable-next-line rxjs-angular/prefer-takeuntil this.onSharedCipher.subscribe(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["view-cipher", { cipherId: this.cipherId }]); }); // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe @@ -57,6 +59,8 @@ export class ShareComponent extends BaseShareComponent { } cancel() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/view-cipher"], { replaceUrl: true, queryParams: { cipherId: this.cipher.id }, diff --git a/apps/browser/src/vault/popup/components/vault/vault-filter.component.ts b/apps/browser/src/vault/popup/components/vault/vault-filter.component.ts index 61f21a8750..5e7959b38f 100644 --- a/apps/browser/src/vault/popup/components/vault/vault-filter.component.ts +++ b/apps/browser/src/vault/popup/components/vault/vault-filter.component.ts @@ -98,10 +98,14 @@ export class VaultFilterComponent implements OnInit, OnDestroy { await this.browserStateService.setBrowserVaultItemsComponentState(null); this.broadcasterService.subscribe(ComponentId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": window.setTimeout(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); }, 500); break; @@ -125,16 +129,22 @@ export class VaultFilterComponent implements OnInit, OnDestroy { } if (!this.syncService.syncInProgress) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } else { this.loadedTimeout = window.setTimeout(() => { if (!this.loaded) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } }, 5000); } if (!this.syncService.syncInProgress || restoredScopeState) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.setContentScrollY(window, this.state?.scrollY); } }); @@ -147,6 +157,8 @@ export class VaultFilterComponent implements OnInit, OnDestroy { if (this.selectedTimeout != null) { window.clearTimeout(this.selectedTimeout); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.saveState(); this.broadcasterService.unsubscribe(ComponentId); } @@ -229,24 +241,34 @@ export class VaultFilterComponent implements OnInit, OnDestroy { } async selectType(type: CipherType) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/ciphers"], { queryParams: { type: type } }); } async selectFolder(folder: FolderView) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/ciphers"], { queryParams: { folderId: folder.id || "none" } }); } async selectCollection(collection: CollectionView) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/ciphers"], { queryParams: { collectionId: collection.id } }); } async selectTrash() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/ciphers"], { queryParams: { deleted: true } }); } async selectCipher(cipher: CipherView) { this.selectedTimeout = window.setTimeout(() => { if (!this.preventSelected) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/view-cipher"], { queryParams: { cipherId: cipher.id } }); } this.preventSelected = false; @@ -263,6 +285,8 @@ export class VaultFilterComponent implements OnInit, OnDestroy { } this.preventSelected = true; await this.cipherService.updateLastLaunchedDate(cipher.id); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab(cipher.login.launchUri); if (BrowserPopupUtils.inPopup(window)) { BrowserApi.closePopup(window); @@ -270,6 +294,8 @@ export class VaultFilterComponent implements OnInit, OnDestroy { } async addCipher() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/add-cipher"], { queryParams: { selectedVault: this.vaultFilter.selectedOrganizationId }, }); diff --git a/apps/browser/src/vault/popup/components/vault/vault-items.component.ts b/apps/browser/src/vault/popup/components/vault/vault-items.component.ts index 1e29a17981..60a8f4b78e 100644 --- a/apps/browser/src/vault/popup/components/vault/vault-items.component.ts +++ b/apps/browser/src/vault/popup/components/vault/vault-items.component.ts @@ -152,6 +152,8 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnIn } if (this.applySavedState && this.state != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserPopupUtils.setContentScrollY(window, this.state.scrollY, { delay: 0, containerSelector: this.scrollingContainer, @@ -161,11 +163,15 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnIn }); this.broadcasterService.subscribe(ComponentId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": if (message.successfully) { window.setTimeout(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.refresh(); }, 500); } @@ -180,6 +186,8 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnIn } ngOnDestroy() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.saveState(); this.broadcasterService.unsubscribe(ComponentId); } @@ -188,6 +196,8 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnIn this.selectedTimeout = window.setTimeout(() => { if (!this.preventSelected) { super.selectCipher(cipher); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/view-cipher"], { queryParams: { cipherId: cipher.id } }); } this.preventSelected = false; @@ -196,11 +206,15 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnIn selectFolder(folder: FolderView) { if (folder.id != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/ciphers"], { queryParams: { folderId: folder.id } }); } } selectCollection(collection: CollectionView) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/ciphers"], { queryParams: { collectionId: collection.id } }); } @@ -214,6 +228,8 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnIn } this.preventSelected = true; await this.cipherService.updateLastLaunchedDate(cipher.id); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.createNewTab(cipher.login.launchUri); if (BrowserPopupUtils.inPopup(window)) { BrowserApi.closePopup(window); @@ -225,6 +241,8 @@ export class VaultItemsComponent extends BaseVaultItemsComponent implements OnIn return false; } super.addCipher(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/add-cipher"], { queryParams: { folderId: this.folderId, diff --git a/apps/browser/src/vault/popup/components/vault/view.component.ts b/apps/browser/src/vault/popup/components/vault/view.component.ts index 63512ebe30..5f8b9c8677 100644 --- a/apps/browser/src/vault/popup/components/vault/view.component.ts +++ b/apps/browser/src/vault/popup/components/vault/view.component.ts @@ -136,6 +136,8 @@ export class ViewComponent extends BaseViewComponent { if (params.cipherId) { this.cipherId = params.cipherId; } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.close(); } @@ -145,6 +147,8 @@ export class ViewComponent extends BaseViewComponent { super.ngOnInit(); this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "collectPageDetailsResponse": @@ -191,6 +195,8 @@ export class ViewComponent extends BaseViewComponent { return false; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/edit-cipher"], { queryParams: { cipherId: this.cipher.id } }); return true; } @@ -204,6 +210,8 @@ export class ViewComponent extends BaseViewComponent { return false; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/clone-cipher"], { queryParams: { cloneMode: true, @@ -219,6 +227,8 @@ export class ViewComponent extends BaseViewComponent { } if (this.cipher.organizationId == null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/share-cipher"], { replaceUrl: true, queryParams: { cipherId: this.cipher.id }, @@ -281,6 +291,8 @@ export class ViewComponent extends BaseViewComponent { return false; } if (await super.restore()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.close(); return true; } @@ -290,6 +302,8 @@ export class ViewComponent extends BaseViewComponent { async delete() { if (await super.delete()) { this.messagingService.send("deletedCipher"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.close(); return true; } @@ -307,7 +321,11 @@ export class ViewComponent extends BaseViewComponent { BrowserPopupUtils.inSingleActionPopout(window, VaultPopoutType.viewVaultItem) && this.senderTabId ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.focusTab(this.senderTabId); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises closeViewVaultItemPopout(`${VaultPopoutType.viewVaultItem}_${this.cipher.id}`); return; } @@ -325,6 +343,8 @@ export class ViewComponent extends BaseViewComponent { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises BrowserApi.tabSendMessage(this.tab, { command: "collectPageDetails", tab: this.tab, diff --git a/apps/browser/src/vault/popup/settings/folder-add-edit.component.ts b/apps/browser/src/vault/popup/settings/folder-add-edit.component.ts index 03a4716bcc..ca24de56ef 100644 --- a/apps/browser/src/vault/popup/settings/folder-add-edit.component.ts +++ b/apps/browser/src/vault/popup/settings/folder-add-edit.component.ts @@ -51,6 +51,8 @@ export class FolderAddEditComponent extends BaseFolderAddEditComponent { async submit(): Promise { if (await super.submit()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/folders"]); return true; } @@ -61,6 +63,8 @@ export class FolderAddEditComponent extends BaseFolderAddEditComponent { async delete(): Promise { const confirmed = await super.delete(); if (confirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/folders"]); } return confirmed; diff --git a/apps/browser/src/vault/services/fido2.service.ts b/apps/browser/src/vault/services/fido2.service.ts index a2b21f5651..98b440b109 100644 --- a/apps/browser/src/vault/services/fido2.service.ts +++ b/apps/browser/src/vault/services/fido2.service.ts @@ -7,6 +7,8 @@ export default class Fido2Service implements Fido2ServiceInterface { const tabs = await BrowserApi.tabsQuery({}); tabs.forEach((tab) => { if (tab.url?.startsWith("https")) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.injectFido2ContentScripts({ tab } as chrome.runtime.MessageSender); } }); diff --git a/apps/cli/src/bw.ts b/apps/cli/src/bw.ts index 250aa46169..c87d380ec3 100644 --- a/apps/cli/src/bw.ts +++ b/apps/cli/src/bw.ts @@ -616,4 +616,6 @@ export class Main { } const main = new Main(); +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises main.run(); diff --git a/apps/cli/src/commands/get.command.ts b/apps/cli/src/commands/get.command.ts index 43d1ab4d93..1bb7daeb0a 100644 --- a/apps/cli/src/commands/get.command.ts +++ b/apps/cli/src/commands/get.command.ts @@ -141,6 +141,8 @@ export class GetCommand extends DownloadCommand { } } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientViewed, id, diff --git a/apps/cli/src/platform/services/lowdb-storage.service.ts b/apps/cli/src/platform/services/lowdb-storage.service.ts index a296c88c88..3cbaeeafc0 100644 --- a/apps/cli/src/platform/services/lowdb-storage.service.ts +++ b/apps/cli/src/platform/services/lowdb-storage.service.ts @@ -98,6 +98,8 @@ export class LowdbStorageService implements AbstractStorageService { } if (this.defaults != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.lockDbFile(() => { this.logService.info("Writing defaults."); this.readForNoCache(); @@ -134,6 +136,8 @@ export class LowdbStorageService implements AbstractStorageService { await this.waitForReady(); return this.lockDbFile(() => { this.readForNoCache(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.db.set(key, obj).write(); this.updatesSubject.next({ key, updateType: "save" }); this.logService.debug(`Successfully wrote ${key} to db`); @@ -145,6 +149,8 @@ export class LowdbStorageService implements AbstractStorageService { await this.waitForReady(); return this.lockDbFile(() => { this.readForNoCache(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.db.unset(key).write(); this.updatesSubject.next({ key, updateType: "remove" }); this.logService.debug(`Successfully removed ${key} from db`); @@ -159,6 +165,8 @@ export class LowdbStorageService implements AbstractStorageService { try { return action(); } finally { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises release(); } }); diff --git a/apps/cli/src/tools/export.command.ts b/apps/cli/src/tools/export.command.ts index e88449d238..dbb0f86e06 100644 --- a/apps/cli/src/tools/export.command.ts +++ b/apps/cli/src/tools/export.command.ts @@ -70,6 +70,8 @@ export class ExportCommand { const eventType = options.organizationid ? EventType.Organization_ClientExportedVault : EventType.User_ClientExportedVault; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(eventType, null, true, options.organizationid); } catch (e) { return Response.error(e); diff --git a/apps/cli/src/tools/import.command.ts b/apps/cli/src/tools/import.command.ts index b24274c720..1cb3ac19f6 100644 --- a/apps/cli/src/tools/import.command.ts +++ b/apps/cli/src/tools/import.command.ts @@ -76,6 +76,8 @@ export class ImportCommand { const response = await this.importService.import(importer, contents, organizationId); if (response.success) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.syncService.fullSync(true); return Response.success(new MessageResponse("Imported " + filepath, null)); } diff --git a/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-create.ts b/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-create.ts index 6a37904fdc..59313bf6cb 100644 --- a/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-create.ts +++ b/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-create.ts @@ -19,6 +19,8 @@ const argv: any = yargs(hideBin(process.argv)).option("name", { const { name } = argv; +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { const nativeMessageService = new NativeMessageService(NativeMessagingVersion.One); // Handshake diff --git a/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-retrieval.ts b/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-retrieval.ts index 17f3dd00c8..2e55afbb36 100644 --- a/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-retrieval.ts +++ b/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-retrieval.ts @@ -18,6 +18,8 @@ const argv: any = yargs(hideBin(process.argv)).option("uri", { const { uri } = argv; +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { const nativeMessageService = new NativeMessageService(NativeMessagingVersion.One); // Handshake diff --git a/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-update.ts b/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-update.ts index 559175b168..b71b984dc9 100644 --- a/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-update.ts +++ b/apps/desktop/native-messaging-test-runner/src/commands/bw-credential-update.ts @@ -43,6 +43,8 @@ const argv: any = yargs(hideBin(process.argv)) const { name, username, password, uri, credentialId } = argv; +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { const nativeMessageService = new NativeMessageService(NativeMessagingVersion.One); // Handshake diff --git a/apps/desktop/native-messaging-test-runner/src/commands/bw-generate-password.ts b/apps/desktop/native-messaging-test-runner/src/commands/bw-generate-password.ts index d59fb083f3..da914c67b4 100644 --- a/apps/desktop/native-messaging-test-runner/src/commands/bw-generate-password.ts +++ b/apps/desktop/native-messaging-test-runner/src/commands/bw-generate-password.ts @@ -18,6 +18,8 @@ const argv: any = yargs(hideBin(process.argv)).option("userId", { const { userId } = argv; +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { const nativeMessageService = new NativeMessageService(NativeMessagingVersion.One); // Handshake diff --git a/apps/desktop/native-messaging-test-runner/src/commands/bw-handshake.ts b/apps/desktop/native-messaging-test-runner/src/commands/bw-handshake.ts index 68c5876357..2ba5d469aa 100644 --- a/apps/desktop/native-messaging-test-runner/src/commands/bw-handshake.ts +++ b/apps/desktop/native-messaging-test-runner/src/commands/bw-handshake.ts @@ -6,6 +6,8 @@ import { LogUtils } from "../log-utils"; import NativeMessageService from "../native-message.service"; import * as config from "../variables"; +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { const nativeMessageService = new NativeMessageService(NativeMessagingVersion.One); diff --git a/apps/desktop/native-messaging-test-runner/src/commands/bw-status.ts b/apps/desktop/native-messaging-test-runner/src/commands/bw-status.ts index 3e431b9910..466e3fca52 100644 --- a/apps/desktop/native-messaging-test-runner/src/commands/bw-status.ts +++ b/apps/desktop/native-messaging-test-runner/src/commands/bw-status.ts @@ -6,6 +6,8 @@ import { LogUtils } from "../log-utils"; import NativeMessageService from "../native-message.service"; import * as config from "../variables"; +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { const nativeMessageService = new NativeMessageService(NativeMessagingVersion.One); diff --git a/apps/desktop/src/app/accounts/settings.component.ts b/apps/desktop/src/app/accounts/settings.component.ts index 4155d34d71..34c7f8d065 100644 --- a/apps/desktop/src/app/accounts/settings.component.ts +++ b/apps/desktop/src/app/accounts/settings.component.ts @@ -573,6 +573,8 @@ export class SettingsComponent implements OnInit { } async saveOpenAtLogin() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setOpenAtLogin(this.form.value.openAtLogin); this.messagingService.send( this.form.value.openAtLogin ? "addOpenAtLogin" : "removeOpenAtLogin", @@ -624,6 +626,8 @@ export class SettingsComponent implements OnInit { if (!this.form.value.enableBrowserIntegration) { this.form.controls.enableBrowserIntegrationFingerprint.setValue(false); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.saveBrowserIntegrationFingerprint(); } } diff --git a/apps/desktop/src/app/app.component.ts b/apps/desktop/src/app/app.component.ts index ac34bb17a9..ca2687946a 100644 --- a/apps/desktop/src/app/app.component.ts +++ b/apps/desktop/src/app/app.component.ts @@ -171,23 +171,37 @@ export class AppComponent implements OnInit, OnDestroy { /// and subscribe to events through that service observable. /// this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "loggedIn": case "unlocked": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.recordActivity(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.updateConnection(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateAppMenu(); this.systemService.cancelProcessReload(); break; case "loggedOut": this.modalService.closeAll(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.updateConnection(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateAppMenu(); await this.systemService.clearPendingClipboard(); await this.systemService.startProcessReload(this.authService); break; case "authBlocked": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["login"]); break; case "logout": @@ -202,6 +216,8 @@ export class AppComponent implements OnInit, OnDestroy { const currentUser = await this.stateService.getUserId(); const accounts = await firstValueFrom(this.stateService.accounts$); await this.vaultTimeoutService.lock(currentUser); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises Promise.all( Object.keys(accounts) .filter((u) => u !== currentUser) @@ -217,12 +233,16 @@ export class AppComponent implements OnInit, OnDestroy { ) { await this.router.navigate(["lock"]); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.updateConnection(); await this.updateAppMenu(); await this.systemService.clearPendingClipboard(); await this.systemService.startProcessReload(this.authService); break; case "startProcessReload": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.systemService.startProcessReload(this.authService); break; case "cancelProcessReload": @@ -235,6 +255,8 @@ export class AppComponent implements OnInit, OnDestroy { break; case "syncCompleted": if (message.successfully) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateAppMenu(); this.configService.triggerServerConfigFetch(); } @@ -267,10 +289,14 @@ export class AppComponent implements OnInit, OnDestroy { break; case "copiedToClipboard": if (!message.clearing) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.systemService.clearClipboard(message.clipboardValue, message.clearMs); } break; case "ssoCallback": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["sso"], { queryParams: { code: message.code, state: message.state }, }); @@ -363,6 +389,8 @@ export class AppComponent implements OnInit, OnDestroy { } break; case "convertAccountToKeyConnector": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/remove-password"]); break; case "switchAccount": { @@ -378,12 +406,16 @@ export class AppComponent implements OnInit, OnDestroy { if (locked) { this.messagingService.send("locked", { userId: message.userId }); } else if (forcedPasswordReset) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["update-temp-password"]); } else { this.messagingService.send("unlocked"); this.loading = true; await this.syncService.fullSync(true); this.loading = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["vault"]); } break; @@ -453,6 +485,8 @@ export class AppComponent implements OnInit, OnDestroy { // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe childComponent.onSavedFolder.subscribe(async () => { this.modal.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.syncService.fullSync(false); }); @@ -549,6 +583,8 @@ export class AppComponent implements OnInit, OnDestroy { } if (this.activeUserId == null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["login"]); } else if (preLogoutActiveUserId !== this.activeUserId) { this.messagingService.send("switchAccount"); @@ -604,8 +640,12 @@ export class AppComponent implements OnInit, OnDestroy { private idleStateChanged() { if (this.isIdle) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.disconnectFromInactivity(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.reconnectFromActivity(); } } @@ -651,6 +691,8 @@ export class AppComponent implements OnInit, OnDestroy { private routeToVault(action: string, cipherType: CipherType) { if (!this.router.url.includes("vault")) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/vault"], { queryParams: { action: action, @@ -669,6 +711,8 @@ export class AppComponent implements OnInit, OnDestroy { } const options = await this.getVaultTimeoutOptions(userId); if (options[0] === timeout) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises options[1] === "logOut" ? this.logOut(false, userId) : await this.vaultTimeoutService.lock(userId); diff --git a/apps/desktop/src/app/components/avatar.component.ts b/apps/desktop/src/app/components/avatar.component.ts index c77bfe0b7a..1000734063 100644 --- a/apps/desktop/src/app/components/avatar.component.ts +++ b/apps/desktop/src/app/components/avatar.component.ts @@ -26,12 +26,16 @@ export class AvatarComponent implements OnChanges, OnInit { ngOnInit() { if (!this.dynamic) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.generate(); } } ngOnChanges() { if (this.dynamic) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.generate(); } } diff --git a/apps/desktop/src/app/main.ts b/apps/desktop/src/app/main.ts index c22d4eb9e1..6c1b800235 100644 --- a/apps/desktop/src/app/main.ts +++ b/apps/desktop/src/app/main.ts @@ -16,6 +16,8 @@ if (!isDev()) { enableProdMode(); } +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: true }); // Disable drag and drop to prevent malicious links from executing in the context of the app diff --git a/apps/desktop/src/app/services/init.service.ts b/apps/desktop/src/app/services/init.service.ts index 998c49071e..27fb212821 100644 --- a/apps/desktop/src/app/services/init.service.ts +++ b/apps/desktop/src/app/services/init.service.ts @@ -48,6 +48,8 @@ export class InitService { // Workaround to ignore stateService.activeAccount until URLs are set // TODO: Remove this when implementing ticket PM-2637 this.environmentService.initialized = true; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.syncService.fullSync(true); await this.vaultTimeoutService.init(true); const locale = await this.stateService.getLocale(); diff --git a/apps/desktop/src/app/tools/generator.component.spec.ts b/apps/desktop/src/app/tools/generator.component.spec.ts index 401578943e..53f919a596 100644 --- a/apps/desktop/src/app/tools/generator.component.spec.ts +++ b/apps/desktop/src/app/tools/generator.component.spec.ts @@ -21,6 +21,8 @@ describe("GeneratorComponent", () => { beforeEach(() => { platformUtilsServiceMock = mock(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.configureTestingModule({ declarations: [GeneratorComponent, I18nPipe], providers: [ diff --git a/apps/desktop/src/app/tools/send/add-edit.component.ts b/apps/desktop/src/app/tools/send/add-edit.component.ts index 6b5e7176ef..d18bec7b5e 100644 --- a/apps/desktop/src/app/tools/send/add-edit.component.ts +++ b/apps/desktop/src/app/tools/send/add-edit.component.ts @@ -61,6 +61,8 @@ export class AddEditComponent extends BaseAddEditComponent { } async copyLinkToClipboard(link: string) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.copyLinkToClipboard(link); this.platformUtilsService.showToast( "success", diff --git a/apps/desktop/src/app/tools/send/send.component.ts b/apps/desktop/src/app/tools/send/send.component.ts index 4737e8a553..75410b2922 100644 --- a/apps/desktop/src/app/tools/send/send.component.ts +++ b/apps/desktop/src/app/tools/send/send.component.ts @@ -73,8 +73,12 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro this.searchBarService.setEnabled(true); this.searchBarService.setPlaceholderText(this.i18nService.t("searchSends")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.ngOnInit(); this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": @@ -111,6 +115,8 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro async savedSend(s: SendView) { await this.refresh(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.selectSend(s.id); } @@ -143,6 +149,8 @@ export class SendComponent extends BaseSendComponent implements OnInit, OnDestro await this.removePassword(send); if (this.sendId === send.id) { this.sendId = null; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.selectSend(send.id); } }, diff --git a/apps/desktop/src/auth/accessibility-cookie.component.ts b/apps/desktop/src/auth/accessibility-cookie.component.ts index 9a9aa36e50..5ec0dbfb56 100644 --- a/apps/desktop/src/auth/accessibility-cookie.component.ts +++ b/apps/desktop/src/auth/accessibility-cookie.component.ts @@ -38,6 +38,8 @@ export class AccessibilityCookieComponent { case "windowIsFocused": if (this.listenForCookie) { this.listenForCookie = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.checkForCookie(); } break; diff --git a/apps/desktop/src/auth/lock.component.spec.ts b/apps/desktop/src/auth/lock.component.spec.ts index 1ddbb6a4aa..c36e75a378 100644 --- a/apps/desktop/src/auth/lock.component.spec.ts +++ b/apps/desktop/src/auth/lock.component.spec.ts @@ -59,6 +59,8 @@ describe("LockComponent", () => { activatedRouteMock = mock(); activatedRouteMock.queryParams = mock(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.configureTestingModule({ declarations: [LockComponent, I18nPipe], providers: [ @@ -307,6 +309,8 @@ describe("LockComponent", () => { it('should wait for "delay" milliseconds', fakeAsync(async () => { const delaySpy = jest.spyOn(global, "setTimeout"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component["delayedAskForBiometric"](5000); tick(4000); @@ -319,18 +323,24 @@ describe("LockComponent", () => { })); it('should return; if "params" is defined and "params.promptBiometric" is false', fakeAsync(async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component["delayedAskForBiometric"](5000, { promptBiometric: false }); tick(5000); expect(component["biometricAsked"]).toBe(false); })); it('should not return; if "params" is defined and "params.promptBiometric" is true', fakeAsync(async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component["delayedAskForBiometric"](5000, { promptBiometric: true }); tick(5000); expect(component["biometricAsked"]).toBe(true); })); it('should not return; if "params" is undefined', fakeAsync(async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component["delayedAskForBiometric"](5000); tick(5000); expect(component["biometricAsked"]).toBe(true); @@ -338,6 +348,8 @@ describe("LockComponent", () => { it('should return; if "supportsBiometric" is false', fakeAsync(async () => { component["supportsBiometric"] = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component["delayedAskForBiometric"](5000); tick(5000); expect(component["biometricAsked"]).toBe(false); @@ -345,6 +357,8 @@ describe("LockComponent", () => { it('should return; if "autoPromptBiometric" is false', fakeAsync(async () => { component["autoPromptBiometric"] = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component["delayedAskForBiometric"](5000); tick(5000); expect(component["biometricAsked"]).toBe(false); @@ -354,6 +368,8 @@ describe("LockComponent", () => { isWindowVisibleMock.mockResolvedValue(true); component["unlockBiometric"] = jest.fn(); component["biometricAsked"] = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component["delayedAskForBiometric"](5000); tick(5000); @@ -364,6 +380,8 @@ describe("LockComponent", () => { isWindowVisibleMock.mockResolvedValue(false); component["unlockBiometric"] = jest.fn(); component["biometricAsked"] = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component["delayedAskForBiometric"](5000); tick(5000); @@ -375,6 +393,8 @@ describe("LockComponent", () => { component["unlockBiometric"] = jest.fn(); component["biometricAsked"] = true; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component["delayedAskForBiometric"](5000); tick(5000); diff --git a/apps/desktop/src/auth/lock.component.ts b/apps/desktop/src/auth/lock.component.ts index b52cd8d2c7..23485f143b 100644 --- a/apps/desktop/src/auth/lock.component.ts +++ b/apps/desktop/src/auth/lock.component.ts @@ -89,6 +89,8 @@ export class LockComponent extends BaseLockComponent { await this.displayBiometricUpdateWarning(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.delayedAskForBiometric(500); this.route.queryParams.pipe(switchMap((params) => this.delayedAskForBiometric(500, params))); @@ -142,6 +144,8 @@ export class LockComponent extends BaseLockComponent { this.biometricAsked = true; if (await ipc.platform.isWindowVisible()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.unlockBiometric(); } } diff --git a/apps/desktop/src/auth/login/login-approval.component.ts b/apps/desktop/src/auth/login/login-approval.component.ts index 8c3e5bb0b0..a870d2add6 100644 --- a/apps/desktop/src/auth/login/login-approval.component.ts +++ b/apps/desktop/src/auth/login/login-approval.component.ts @@ -62,6 +62,8 @@ export class LoginApprovalComponent implements OnInit, OnDestroy { clearInterval(this.interval); const closedWithButton = await firstValueFrom(this.dialogRef.closed); if (!closedWithButton) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.retrieveAuthRequestAndRespond(false); } this.destroy$.next(); diff --git a/apps/desktop/src/auth/login/login.component.ts b/apps/desktop/src/auth/login/login.component.ts index eef5b871fe..65b16ad7b7 100644 --- a/apps/desktop/src/auth/login/login.component.ts +++ b/apps/desktop/src/auth/login/login.component.ts @@ -149,6 +149,8 @@ export class LoginComponent extends BaseLoginComponent implements OnDestroy { // eslint-disable-next-line rxjs/no-async-subscribe childComponent.onSaved.pipe(takeUntil(this.componentDestroyed$)).subscribe(async () => { modal.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.environmentSelector.updateEnvironmentInfo(); await this.getLoginWithDevice(this.loggedEmail); }); diff --git a/apps/desktop/src/auth/register.component.ts b/apps/desktop/src/auth/register.component.ts index 0941740d54..23ada81ccb 100644 --- a/apps/desktop/src/auth/register.component.ts +++ b/apps/desktop/src/auth/register.component.ts @@ -72,6 +72,8 @@ export class RegisterComponent extends BaseRegisterComponent implements OnInit, }); }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.ngOnInit(); } diff --git a/apps/desktop/src/auth/sso.component.ts b/apps/desktop/src/auth/sso.component.ts index e5c97d6110..7332bd34bc 100644 --- a/apps/desktop/src/auth/sso.component.ts +++ b/apps/desktop/src/auth/sso.component.ts @@ -49,10 +49,14 @@ export class SsoComponent extends BaseSsoComponent { configService, ); super.onSuccessfulLogin = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises syncService.fullSync(true); }; super.onSuccessfulLoginTde = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises syncService.fullSync(true); }; diff --git a/apps/desktop/src/auth/two-factor.component.ts b/apps/desktop/src/auth/two-factor.component.ts index cfc6a51018..0c52243466 100644 --- a/apps/desktop/src/auth/two-factor.component.ts +++ b/apps/desktop/src/auth/two-factor.component.ts @@ -66,10 +66,14 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { configService, ); super.onSuccessfulLogin = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises syncService.fullSync(true); }; super.onSuccessfulLoginTde = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises syncService.fullSync(true); }; } diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index 2cfc77ddf6..af03f5ba98 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -192,6 +192,8 @@ export class Main { const locale = await this.stateService.getLocale(); await this.i18nService.init(locale != null ? locale : app.getLocale()); this.messagingMain.init(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.menuMain.init(); await this.trayMain.init("Bitwarden", [ { @@ -202,6 +204,8 @@ export class Main { }, ]); if (await this.stateService.getEnableStartToTray()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.trayMain.hideToTray(); } this.powerMonitorMain.init(); @@ -214,6 +218,8 @@ export class Main { (await this.stateService.getEnableBrowserIntegration()) || (await this.stateService.getEnableDuckDuckGoBrowserIntegration()) ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.nativeMessagingMain.listen(); } diff --git a/apps/desktop/src/main/menu/menu.about.ts b/apps/desktop/src/main/menu/menu.about.ts index ca0495764a..50e125b3d6 100644 --- a/apps/desktop/src/main/menu/menu.about.ts +++ b/apps/desktop/src/main/menu/menu.about.ts @@ -83,6 +83,8 @@ export class AboutMenu implements IMenubarMenu { } private async checkForUpdate() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this._updater.checkForUpdate(true); } } diff --git a/apps/desktop/src/main/menu/menu.account.ts b/apps/desktop/src/main/menu/menu.account.ts index 302d7d767b..142431ae0d 100644 --- a/apps/desktop/src/main/menu/menu.account.ts +++ b/apps/desktop/src/main/menu/menu.account.ts @@ -74,6 +74,8 @@ export class AccountMenu implements IMenubarMenu { noLink: true, }); if (result.response === 0) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal(this._webVaultUrl); } }, @@ -96,6 +98,8 @@ export class AccountMenu implements IMenubarMenu { noLink: true, }); if (result.response === 0) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal(this._webVaultUrl); } }, diff --git a/apps/desktop/src/main/menu/menu.first.ts b/apps/desktop/src/main/menu/menu.first.ts index 6d30ee5e85..d9575bb233 100644 --- a/apps/desktop/src/main/menu/menu.first.ts +++ b/apps/desktop/src/main/menu/menu.first.ts @@ -140,6 +140,8 @@ export class FirstMenu { protected async checkForUpdate(menuItem: MenuItem) { menuItem.enabled = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this._updater.checkForUpdate(true); menuItem.enabled = true; } diff --git a/apps/desktop/src/main/menu/menu.help.ts b/apps/desktop/src/main/menu/menu.help.ts index 70f46ebd99..133c90a6af 100644 --- a/apps/desktop/src/main/menu/menu.help.ts +++ b/apps/desktop/src/main/menu/menu.help.ts @@ -149,6 +149,8 @@ export class HelpMenu implements IMenubarMenu { id: "iOS", label: "iOS", click: () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal( "https://itunes.apple.com/app/" + "bitwarden-free-password-manager/id1137397744?mt=8", ); @@ -159,6 +161,8 @@ export class HelpMenu implements IMenubarMenu { label: "Android", visible: !isMacAppStore(), // Apple Guideline 2.3.10 - Accurate Metadata click: () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal( "https://play.google.com/store/apps/" + "details?id=com.x8bit.bitwarden", ); @@ -182,6 +186,8 @@ export class HelpMenu implements IMenubarMenu { id: "chrome", label: "Chrome", click: () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal( "https://chromewebstore.google.com/detail/" + "bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb", @@ -192,6 +198,8 @@ export class HelpMenu implements IMenubarMenu { id: "firefox", label: "Firefox", click: () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal( "https://addons.mozilla.org/firefox/addon/" + "bitwarden-password-manager/", ); @@ -201,6 +209,8 @@ export class HelpMenu implements IMenubarMenu { id: "firefox", label: "Opera", click: () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal( "https://addons.opera.com/extensions/details/" + "bitwarden-free-password-manager/", ); @@ -210,6 +220,8 @@ export class HelpMenu implements IMenubarMenu { id: "firefox", label: "Edge", click: () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal( "https://microsoftedge.microsoft.com/addons/" + "detail/jbkfoedolllekgbhcbcoahefnbanhhlh", @@ -220,6 +232,8 @@ export class HelpMenu implements IMenubarMenu { id: "safari", label: "Safari", click: () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal("https://bitwarden.com/download/"); }, }, diff --git a/apps/desktop/src/main/messaging.main.ts b/apps/desktop/src/main/messaging.main.ts index 71a2605828..44184e6f84 100644 --- a/apps/desktop/src/main/messaging.main.ts +++ b/apps/desktop/src/main/messaging.main.ts @@ -22,9 +22,13 @@ export class MessagingMain { init() { this.scheduleNextSync(); if (process.platform === "linux") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setOpenAtLogin(fs.existsSync(this.linuxStartupFile())); } else { const loginSettings = app.getLoginItemSettings(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setOpenAtLogin(loginSettings.openAtLogin); } ipcMain.on("messagingService", async (event: any, message: any) => this.onMessage(message)); @@ -36,10 +40,14 @@ export class MessagingMain { this.scheduleNextSync(); break; case "updateAppMenu": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.main.menuMain.updateApplicationMenuState(message.updateRequest); this.updateTrayMenu(message.updateRequest); break; case "minimizeOnCopy": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.getMinimizeOnCopyToClipboard().then((shouldMinimize) => { if (shouldMinimize && this.main.windowMain.win !== null) { this.main.windowMain.win.minimize(); @@ -53,6 +61,8 @@ export class MessagingMain { this.main.trayMain.removeTray(); break; case "hideToTray": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.main.trayMain.hideToTray(); break; case "addOpenAtLogin": @@ -69,10 +79,14 @@ export class MessagingMain { break; case "enableBrowserIntegration": this.main.nativeMessagingMain.generateManifests(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.main.nativeMessagingMain.listen(); break; case "enableDuckDuckGoBrowserIntegration": this.main.nativeMessagingMain.generateDdgManifests(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.main.nativeMessagingMain.listen(); break; case "disableBrowserIntegration": diff --git a/apps/desktop/src/main/native-messaging.main.ts b/apps/desktop/src/main/native-messaging.main.ts index 79a9c0f82a..77a0b31314 100644 --- a/apps/desktop/src/main/native-messaging.main.ts +++ b/apps/desktop/src/main/native-messaging.main.ts @@ -102,14 +102,22 @@ export class NativeMessagingMain { switch (process.platform) { case "win32": { const destination = path.join(this.userPath, "browsers"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.writeManifest(path.join(destination, "firefox.json"), firefoxJson); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.writeManifest(path.join(destination, "chrome.json"), chromeJson); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.createWindowsRegistry( "HKLM\\SOFTWARE\\Mozilla\\Firefox", "HKCU\\SOFTWARE\\Mozilla\\NativeMessagingHosts\\com.8bit.bitwarden", path.join(destination, "firefox.json"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.createWindowsRegistry( "HKCU\\SOFTWARE\\Google\\Chrome", "HKCU\\SOFTWARE\\Google\\Chrome\\NativeMessagingHosts\\com.8bit.bitwarden", @@ -139,6 +147,8 @@ export class NativeMessagingMain { } case "linux": if (existsSync(`${this.homedir()}/.mozilla/`)) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.writeManifest( `${this.homedir()}/.mozilla/native-messaging-hosts/com.8bit.bitwarden.json`, firefoxJson, @@ -146,6 +156,8 @@ export class NativeMessagingMain { } if (existsSync(`${this.homedir()}/.config/google-chrome/`)) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.writeManifest( `${this.homedir()}/.config/google-chrome/NativeMessagingHosts/com.8bit.bitwarden.json`, chromeJson, @@ -153,6 +165,8 @@ export class NativeMessagingMain { } if (existsSync(`${this.homedir()}/.config/microsoft-edge/`)) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.writeManifest( `${this.homedir()}/.config/microsoft-edge/NativeMessagingHosts/com.8bit.bitwarden.json`, chromeJson, @@ -188,11 +202,19 @@ export class NativeMessagingMain { removeManifests() { switch (process.platform) { case "win32": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises fs.unlink(path.join(this.userPath, "browsers", "firefox.json")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises fs.unlink(path.join(this.userPath, "browsers", "chrome.json")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.deleteWindowsRegistry( "HKCU\\SOFTWARE\\Mozilla\\NativeMessagingHosts\\com.8bit.bitwarden", ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.deleteWindowsRegistry( "HKCU\\SOFTWARE\\Google\\Chrome\\NativeMessagingHosts\\com.8bit.bitwarden", ); @@ -202,6 +224,8 @@ export class NativeMessagingMain { for (const [, value] of Object.entries(nmhs)) { const p = path.join(value, "NativeMessagingHosts", "com.8bit.bitwarden.json"); if (existsSync(p)) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises fs.unlink(p); } } @@ -211,6 +235,8 @@ export class NativeMessagingMain { if ( existsSync(`${this.homedir()}/.mozilla/native-messaging-hosts/com.8bit.bitwarden.json`) ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises fs.unlink(`${this.homedir()}/.mozilla/native-messaging-hosts/com.8bit.bitwarden.json`); } @@ -219,6 +245,8 @@ export class NativeMessagingMain { `${this.homedir()}/.config/google-chrome/NativeMessagingHosts/com.8bit.bitwarden.json`, ) ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises fs.unlink( `${this.homedir()}/.config/google-chrome/NativeMessagingHosts/com.8bit.bitwarden.json`, ); @@ -229,6 +257,8 @@ export class NativeMessagingMain { `${this.homedir()}/.config/microsoft-edge/NativeMessagingHosts/com.8bit.bitwarden.json`, ) ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises fs.unlink( `${this.homedir()}/.config/microsoft-edge/NativeMessagingHosts/com.8bit.bitwarden.json`, ); @@ -245,6 +275,8 @@ export class NativeMessagingMain { /* eslint-disable-next-line no-useless-escape */ const path = `${this.homedir()}/Library/Containers/com.duckduckgo.macos.browser/Data/Library/Application\ Support/NativeMessagingHosts/com.8bit.bitwarden.json`; if (existsSync(path)) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises fs.unlink(path); } break; diff --git a/apps/desktop/src/main/tray.main.ts b/apps/desktop/src/main/tray.main.ts index 2046e5ba32..3f8ad4eedf 100644 --- a/apps/desktop/src/main/tray.main.ts +++ b/apps/desktop/src/main/tray.main.ts @@ -63,6 +63,8 @@ export class TrayMain { win.on("minimize", async (e: Event) => { if (await this.stateService.getEnableMinimizeToTray()) { e.preventDefault(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.hideToTray(); } }); @@ -71,6 +73,8 @@ export class TrayMain { if (await this.stateService.getEnableCloseToTray()) { if (!this.windowMain.isQuitting) { e.preventDefault(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.hideToTray(); } } @@ -109,6 +113,8 @@ export class TrayMain { restoreFromTray() { if (this.windowMain.win == null || !this.windowMain.win.isVisible()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.toggleWindow(); } } @@ -142,6 +148,8 @@ export class TrayMain { } private showDock() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises app.dock.show(); } @@ -157,6 +165,8 @@ export class TrayMain { if (this.windowMain.win == null) { if (this.isDarwin()) { // On MacOS, closing the window via the red button destroys the BrowserWindow instance. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.windowMain.createWindow().then(() => { this.windowMain.win.show(); this.showDock(); diff --git a/apps/desktop/src/main/updater.main.ts b/apps/desktop/src/main/updater.main.ts index 749f79cc7b..c9a2dc0e14 100644 --- a/apps/desktop/src/main/updater.main.ts +++ b/apps/desktop/src/main/updater.main.ts @@ -58,6 +58,8 @@ export class UpdaterMain { }); if (result.response === 0) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises autoUpdater.downloadUpdate(); } else { this.reset(); @@ -67,6 +69,8 @@ export class UpdaterMain { autoUpdater.on("update-not-available", () => { if (this.doingUpdateCheckWithFeedback && this.windowMain.win != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises dialog.showMessageBox(this.windowMain.win, { message: this.i18nService.t("noUpdatesAvailable"), buttons: [this.i18nService.t("ok")], @@ -120,6 +124,8 @@ export class UpdaterMain { if (!this.canUpdate) { if (withFeedback) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal("https://github.com/bitwarden/clients/releases"); } diff --git a/apps/desktop/src/main/window.main.ts b/apps/desktop/src/main/window.main.ts index 511f38eba9..c3ec18a2ea 100644 --- a/apps/desktop/src/main/window.main.ts +++ b/apps/desktop/src/main/window.main.ts @@ -57,6 +57,8 @@ export class WindowMain { } this.win.webContents.reloadIgnoringCache(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.session.clearCache(); }); @@ -90,6 +92,8 @@ export class WindowMain { // down the application. app.on("before-quit", () => { // Allow biometric to auto-prompt on reload + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setBiometricPromptCancelled(false); this.isQuitting = true; }); @@ -177,6 +181,8 @@ export class WindowMain { this.win.show(); // and load the index.html of the app. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.win.loadURL( url.format({ protocol: "file:", diff --git a/apps/desktop/src/platform/main/biometric/biometrics.service.spec.ts b/apps/desktop/src/platform/main/biometric/biometrics.service.spec.ts index fd49294225..81dfd5a1b2 100644 --- a/apps/desktop/src/platform/main/biometric/biometrics.service.spec.ts +++ b/apps/desktop/src/platform/main/biometric/biometrics.service.spec.ts @@ -38,13 +38,19 @@ describe("biometrics tests", function () { const mockService = mock(); (sut as any).platformSpecificService = mockService; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.init(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.setEncryptionKeyHalf({ service: "test", key: "test", value: "test" }); expect(mockService.init).toBeCalled(); await sut.canAuthBiometric({ service: "test", key: "test", userId: "test" }); expect(mockService.osSupportsBiometric).toBeCalled(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.authenticateBiometric(); expect(mockService.authenticateBiometric).toBeCalled(); }); @@ -96,6 +102,8 @@ describe("biometrics tests", function () { innerService = mock(); (sut as any).platformSpecificService = innerService; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.init(); }); @@ -108,6 +116,8 @@ describe("biometrics tests", function () { }); it("should call osSupportsBiometric if client key half is provided", async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sut.setEncryptionKeyHalf({ service: "test", key: "test", value: "test" }); expect(innerService.init).toBeCalled(); diff --git a/apps/desktop/src/platform/main/biometric/biometrics.service.ts b/apps/desktop/src/platform/main/biometric/biometrics.service.ts index 54b8487175..32d4707f59 100644 --- a/apps/desktop/src/platform/main/biometric/biometrics.service.ts +++ b/apps/desktop/src/platform/main/biometric/biometrics.service.ts @@ -82,6 +82,8 @@ export class BiometricsService implements BiometricsServiceAbstraction { async authenticateBiometric(): Promise { let result = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.interruptProcessReload( () => { return this.platformSpecificService.authenticateBiometric(); diff --git a/apps/desktop/src/platform/services/electron-crypto.service.ts b/apps/desktop/src/platform/services/electron-crypto.service.ts index dba0435edc..f5d503828a 100644 --- a/apps/desktop/src/platform/services/electron-crypto.service.ts +++ b/apps/desktop/src/platform/services/electron-crypto.service.ts @@ -47,10 +47,16 @@ export class ElectronCryptoService extends CryptoService { override async clearStoredUserKey(keySuffix: KeySuffixOptions, userId?: UserId): Promise { if (keySuffix === KeySuffixOptions.Biometric) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setUserKeyBiometric(null, { userId: userId }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.clearDeprecatedKeys(KeySuffixOptions.Biometric, userId); return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.clearStoredUserKey(keySuffix, userId); } @@ -100,6 +106,8 @@ export class ElectronCryptoService extends CryptoService { protected override async clearAllStoredUserKeys(userId?: UserId): Promise { await this.stateService.setUserKeyBiometric(null, { userId: userId }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.clearAllStoredUserKeys(userId); } @@ -133,6 +141,8 @@ export class ElectronCryptoService extends CryptoService { await this.stateService.setCryptoMasterKeyBiometric(null, { userId: userId }); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.clearDeprecatedKeys(keySuffix, userId); } diff --git a/apps/desktop/src/platform/services/electron-platform-utils.service.ts b/apps/desktop/src/platform/services/electron-platform-utils.service.ts index f66aac5067..2e4bc3d820 100644 --- a/apps/desktop/src/platform/services/electron-platform-utils.service.ts +++ b/apps/desktop/src/platform/services/electron-platform-utils.service.ts @@ -61,6 +61,8 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService { } launchUri(uri: string, options?: any): void { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises ipc.platform.launchUri(uri); } @@ -108,6 +110,8 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService { const clearing = options?.clearing === true; const clearMs = options?.clearMs ?? null; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises ipc.platform.clipboard.write({ text: text, password: (options?.allowHistory ?? false) === false, // default to false diff --git a/apps/desktop/src/services/electron-main-messaging.service.ts b/apps/desktop/src/services/electron-main-messaging.service.ts index f6b4b13601..b7e5712a0c 100644 --- a/apps/desktop/src/services/electron-main-messaging.service.ts +++ b/apps/desktop/src/services/electron-main-messaging.service.ts @@ -84,6 +84,8 @@ export class ElectronMainMessagingService implements MessagingService { ipcMain.handle("launchUri", async (event, uri) => { if (SafeUrls.canLaunch(uri)) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises shell.openExternal(uri); } }); diff --git a/apps/desktop/src/services/native-message-handler.service.ts b/apps/desktop/src/services/native-message-handler.service.ts index 08ae536c6e..7d916af0ac 100644 --- a/apps/desktop/src/services/native-message-handler.service.ts +++ b/apps/desktop/src/services/native-message-handler.service.ts @@ -149,6 +149,8 @@ export class NativeMessageHandlerService { await this.sendEncryptedResponse(message, { command, payload: responseData }); } catch (error) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendEncryptedResponse(message, { command, payload: {} }); } } diff --git a/apps/desktop/src/services/native-messaging.service.ts b/apps/desktop/src/services/native-messaging.service.ts index 886d87e555..e578744188 100644 --- a/apps/desktop/src/services/native-messaging.service.ts +++ b/apps/desktop/src/services/native-messaging.service.ts @@ -48,6 +48,8 @@ export class NativeMessagingService { private async messageHandler(msg: LegacyMessageWrapper | Message) { const outerMessage = msg as Message; if (outerMessage.version) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.nativeMessageHandler.handleMessage(outerMessage); return; } @@ -93,6 +95,8 @@ export class NativeMessagingService { } } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.secureCommunication(remotePublicKey, appId); return; } @@ -133,6 +137,8 @@ export class NativeMessagingService { } if (!(await this.stateService.getBiometricUnlock({ userId: message.userId }))) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.send({ command: "biometricUnlock", response: "not enabled" }, appId); return this.ngZone.run(() => @@ -157,6 +163,8 @@ export class NativeMessagingService { // we send the master key still for backwards compatibility // with older browser extensions // TODO: Remove after 2023.10 release (https://bitwarden.atlassian.net/browse/PM-3472) + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.send( { command: "biometricUnlock", @@ -167,9 +175,13 @@ export class NativeMessagingService { appId, ); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.send({ command: "biometricUnlock", response: "canceled" }, appId); } } catch (e) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.send({ command: "biometricUnlock", response: "canceled" }, appId); } diff --git a/apps/desktop/src/utils.ts b/apps/desktop/src/utils.ts index 7966046d9a..7e31eb56bf 100644 --- a/apps/desktop/src/utils.ts +++ b/apps/desktop/src/utils.ts @@ -8,6 +8,8 @@ export function invokeMenu(menu: RendererMenuItem[]) { const menuWithoutClick = menu.map((m) => { return { label: m.label, type: m.type }; }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises ipc.platform.openContextMenu(menuWithoutClick).then((i: number) => { if (i !== -1) { menu[i].click(); diff --git a/apps/desktop/src/vault/app/vault/add-edit.component.ts b/apps/desktop/src/vault/app/vault/add-edit.component.ts index 1b98eac6fb..e6976503e7 100644 --- a/apps/desktop/src/vault/app/vault/add-edit.component.ts +++ b/apps/desktop/src/vault/app/vault/add-edit.component.ts @@ -100,6 +100,8 @@ export class AddEditComponent extends BaseAddEditComponent implements OnChanges, ) { this.cipher = null; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.load(); } diff --git a/apps/desktop/src/vault/app/vault/vault-filter/filters/organization-filter.component.ts b/apps/desktop/src/vault/app/vault/vault-filter/filters/organization-filter.component.ts index f4624b816f..bb89cd230c 100644 --- a/apps/desktop/src/vault/app/vault/vault-filter/filters/organization-filter.component.ts +++ b/apps/desktop/src/vault/app/vault/vault-filter/filters/organization-filter.component.ts @@ -30,6 +30,8 @@ export class OrganizationFilterComponent extends BaseOrganizationFilterComponent async applyOrganizationFilter(organization: Organization) { if (organization.enabled) { //proceed with default behaviour for enabled organizations + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.applyOrganizationFilter(organization); } else { this.platformUtilsService.showToast( diff --git a/apps/desktop/src/vault/app/vault/vault-items.component.ts b/apps/desktop/src/vault/app/vault/vault-items.component.ts index 2c5d256e2f..5af7e95035 100644 --- a/apps/desktop/src/vault/app/vault/vault-items.component.ts +++ b/apps/desktop/src/vault/app/vault/vault-items.component.ts @@ -24,6 +24,8 @@ export class VaultItemsComponent extends BaseVaultItemsComponent { // eslint-disable-next-line rxjs-angular/prefer-takeuntil searchBarService.searchText$.pipe(distinctUntilChanged()).subscribe((searchText) => { this.searchText = searchText; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.search(200); }); } diff --git a/apps/desktop/src/vault/app/vault/vault.component.ts b/apps/desktop/src/vault/app/vault/vault.component.ts index c79cc04c68..c3a05e4a99 100644 --- a/apps/desktop/src/vault/app/vault/vault.component.ts +++ b/apps/desktop/src/vault/app/vault/vault.component.ts @@ -108,6 +108,8 @@ export class VaultComponent implements OnInit, OnDestroy { async ngOnInit() { this.userHasPremiumAccess = await this.stateService.getCanAccessPremium(); this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { let detectChanges = true; @@ -137,6 +139,8 @@ export class VaultComponent implements OnInit, OnDestroy { await this.vaultFilterComponent.reloadOrganizations(); break; case "refreshCiphers": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.vaultItemsComponent.refresh(); break; case "modalShown": @@ -242,6 +246,8 @@ export class VaultComponent implements OnInit, OnDestroy { } } else if (params.action === "add") { this.addType = Number(params.addType); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.addCipher(this.addType); } @@ -274,6 +280,8 @@ export class VaultComponent implements OnInit, OnDestroy { label: this.i18nService.t("view"), click: () => this.functionWithChangeDetection(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.viewCipher(cipher); }), }, @@ -283,6 +291,8 @@ export class VaultComponent implements OnInit, OnDestroy { label: this.i18nService.t("edit"), click: () => this.functionWithChangeDetection(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.editCipher(cipher); }), }); @@ -291,6 +301,8 @@ export class VaultComponent implements OnInit, OnDestroy { label: this.i18nService.t("clone"), click: () => this.functionWithChangeDetection(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.cloneCipher(cipher); }), }); @@ -323,6 +335,8 @@ export class VaultComponent implements OnInit, OnDestroy { label: this.i18nService.t("copyPassword"), click: () => { this.copyValue(cipher, cipher.login.password, "password", "Password"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, cipher.id); }, }); @@ -352,6 +366,8 @@ export class VaultComponent implements OnInit, OnDestroy { label: this.i18nService.t("copySecurityCode"), click: () => { this.copyValue(cipher, cipher.card.code, "securityCode", "Security Code"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedCardCode, cipher.id); }, }); @@ -503,6 +519,8 @@ export class VaultComponent implements OnInit, OnDestroy { // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe childComponent.onSharedCipher.subscribe(async () => { this.modal.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.viewCipher(cipher); await this.vaultItemsComponent.refresh(); }); @@ -527,6 +545,8 @@ export class VaultComponent implements OnInit, OnDestroy { // eslint-disable-next-line rxjs-angular/prefer-takeuntil childComponent.onSavedCollections.subscribe(() => { this.modal.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.viewCipher(cipher); }); // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe @@ -702,6 +722,8 @@ export class VaultComponent implements OnInit, OnDestroy { }; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { relativeTo: this.route, queryParams: queryParams, diff --git a/apps/web/src/app/admin-console/common/base.people.component.ts b/apps/web/src/app/admin-console/common/base.people.component.ts index f01b9d1cb8..29303f4ccc 100644 --- a/apps/web/src/app/admin-console/common/base.people.component.ts +++ b/apps/web/src/app/admin-console/common/base.people.component.ts @@ -164,6 +164,8 @@ export abstract class BasePeopleComponent< } // Reset checkbox selecton this.selectAll(false); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.resetPaging(); } @@ -392,6 +394,8 @@ export abstract class BasePeopleComponent< isPaging() { const searching = this.isSearching(); if (searching && this.didScroll) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.resetPaging(); } return !searching && this.users && this.users.length > this.pageSize; @@ -409,6 +413,8 @@ export abstract class BasePeopleComponent< let index = this.users.indexOf(user); if (index > -1) { this.users.splice(index, 1); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.resetPaging(); } diff --git a/apps/web/src/app/admin-console/organizations/manage/groups.component.ts b/apps/web/src/app/admin-console/organizations/manage/groups.component.ts index 75a8001140..a41d57f874 100644 --- a/apps/web/src/app/admin-console/organizations/manage/groups.component.ts +++ b/apps/web/src/app/admin-console/organizations/manage/groups.component.ts @@ -227,6 +227,8 @@ export class GroupsComponent implements OnInit, OnDestroy { } add() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.edit(null); } diff --git a/apps/web/src/app/admin-console/organizations/members/people.component.ts b/apps/web/src/app/admin-console/organizations/members/people.component.ts index 56e3a0520e..afe07aaad1 100644 --- a/apps/web/src/app/admin-console/organizations/members/people.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/people.component.ts @@ -200,6 +200,8 @@ export class PeopleComponent if (qParams.viewEvents != null) { const user = this.users.filter((u) => u.id === qParams.viewEvents); if (user.length > 0 && user[0].status === OrganizationUserStatusType.Confirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.events(user[0]); } } @@ -415,6 +417,8 @@ export class PeopleComponent } const simpleDialog = this.dialogService.openSimpleDialogRef(orgUpgradeSimpleDialogOpts); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises firstValueFrom(simpleDialog.closed).then(this.handleDialogClose.bind(this)); } @@ -463,6 +467,8 @@ export class PeopleComponent case MemberDialogResult.Saved: case MemberDialogResult.Revoked: case MemberDialogResult.Restored: + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); break; } @@ -531,6 +537,8 @@ export class PeopleComponent this.organization.id, filteredUsers.map((user) => user.id), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.showBulkStatus( users, filteredUsers, @@ -606,6 +614,8 @@ export class PeopleComponent // eslint-disable-next-line rxjs-angular/prefer-takeuntil comp.onPasswordReset.subscribe(() => { modal.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); }); }, diff --git a/apps/web/src/app/admin-console/organizations/policies/policies.component.ts b/apps/web/src/app/admin-console/organizations/policies/policies.component.ts index 636647e1c2..6f8bb27671 100644 --- a/apps/web/src/app/admin-console/organizations/policies/policies.component.ts +++ b/apps/web/src/app/admin-console/organizations/policies/policies.component.ts @@ -58,6 +58,8 @@ export class PoliciesComponent implements OnInit { if (orgPolicy.id === policyIdFromEvents) { for (let i = 0; i < this.policies.length; i++) { if (this.policies[i].type === orgPolicy.type) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.edit(this.policies[i]); break; } @@ -91,6 +93,8 @@ export class PoliciesComponent implements OnInit { // eslint-disable-next-line rxjs-angular/prefer-takeuntil comp.onSavedPolicy.subscribe(() => { modal.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); }); }, diff --git a/apps/web/src/app/admin-console/organizations/settings/account.component.ts b/apps/web/src/app/admin-console/organizations/settings/account.component.ts index bf55168a3f..204ac77a62 100644 --- a/apps/web/src/app/admin-console/organizations/settings/account.component.ts +++ b/apps/web/src/app/admin-console/organizations/settings/account.component.ts @@ -225,6 +225,8 @@ export class AccountComponent { const result = await lastValueFrom(dialog.closed); if (result === DeleteOrganizationDialogResult.Deleted) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } } diff --git a/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.spec.ts b/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.spec.ts index 4a648b7287..90e652675c 100644 --- a/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.spec.ts +++ b/apps/web/src/app/admin-console/organizations/shared/components/access-selector/access-selector.component.spec.ts @@ -52,6 +52,8 @@ describe("AccessSelectorComponent", () => { let fixture: ComponentFixture; beforeEach(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.configureTestingModule({ imports: [ ButtonModule, diff --git a/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.ts b/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.ts index 0cd6a4c277..46a75c3736 100644 --- a/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.ts +++ b/apps/web/src/app/admin-console/organizations/sponsorships/accept-family-sponsorship.component.ts @@ -14,13 +14,19 @@ export class AcceptFamilySponsorshipComponent extends BaseAcceptComponent { requiredParameters = ["email", "token"]; async authedHandler(qParams: Params) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/setup/families-for-enterprise"], { queryParams: qParams }); } async unauthedHandler(qParams: Params) { if (!qParams.register) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/login"], { queryParams: { email: qParams.email } }); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/register"], { queryParams: { email: qParams.email } }); } } diff --git a/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.ts b/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.ts index b5445d2a51..3eeb940406 100644 --- a/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.ts +++ b/apps/web/src/app/admin-console/organizations/sponsorships/families-for-enterprise-setup.component.ts @@ -79,6 +79,8 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy { this.i18nService.t("sponsoredFamiliesAcceptFailed"), { timeout: 10000 }, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); return; } @@ -135,6 +137,8 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy { ); await this.syncService.fullSync(true); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } catch (e) { if (this.showNewOrganization) { @@ -148,6 +152,8 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit, OnDestroy { const result = await lastValueFrom(dialog.closed); if (result === DeleteOrganizationDialogResult.Deleted) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } } diff --git a/apps/web/src/app/admin-console/settings/sponsored-families.component.ts b/apps/web/src/app/admin-console/settings/sponsored-families.component.ts index bf9f2306b3..562192a262 100644 --- a/apps/web/src/app/admin-console/settings/sponsored-families.component.ts +++ b/apps/web/src/app/admin-console/settings/sponsored-families.component.ts @@ -101,6 +101,8 @@ export class SponsoredFamiliesComponent implements OnInit, OnDestroy { await this.formPromise; this.platformUtilsService.showToast("success", null, this.i18nService.t("sponsorshipCreated")); this.formPromise = null; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.resetForm(); await this.forceReload(); } diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts index 1f7d8cc2f1..25a8675d83 100644 --- a/apps/web/src/app/app.component.ts +++ b/apps/web/src/app/app.component.ts @@ -105,28 +105,44 @@ export class AppComponent implements OnDestroy, OnInit { /// and subscribe to events through that service observable. /// this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "loggedIn": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.updateConnection(false); break; case "loggedOut": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.updateConnection(false); break; case "unlocked": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.updateConnection(false); break; case "authBlocked": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); break; case "logout": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.logOut(!!message.expired, message.redirect); break; case "lockVault": await this.vaultTimeoutService.lock(); break; case "locked": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.updateConnection(false); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["lock"]); break; case "lockedUrl": @@ -146,6 +162,8 @@ export class AppComponent implements OnDestroy, OnInit { type: "info", }); if (upgradeConfirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([ "organizations", message.organizationId, @@ -163,6 +181,8 @@ export class AppComponent implements OnDestroy, OnInit { type: "success", }); if (premiumConfirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["settings/subscription/premium"]); } break; @@ -185,9 +205,13 @@ export class AppComponent implements OnDestroy, OnInit { this.showToast(message); break; case "setFullWidth": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.setFullWidth(); break; case "convertAccountToKeyConnector": + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/remove-password"]); break; default: @@ -217,6 +241,8 @@ export class AppComponent implements OnDestroy, OnInit { new SendOptionsPolicy(), ]); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.setFullWidth(); } @@ -253,6 +279,8 @@ export class AppComponent implements OnDestroy, OnInit { await this.stateService.clean({ userId: userId }); if (redirect) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } }); @@ -265,6 +293,8 @@ export class AppComponent implements OnDestroy, OnInit { } this.lastActivity = now; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setLastActive(now); // Idle states if (this.isIdle) { @@ -313,8 +343,12 @@ export class AppComponent implements OnDestroy, OnInit { private idleStateChanged() { if (this.isIdle) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.disconnectFromInactivity(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.notificationsService.reconnectFromActivity(); } } diff --git a/apps/web/src/app/auth/accept-organization.component.ts b/apps/web/src/app/auth/accept-organization.component.ts index 6ab421f6d6..21f3a41fa6 100644 --- a/apps/web/src/app/auth/accept-organization.component.ts +++ b/apps/web/src/app/auth/accept-organization.component.ts @@ -79,6 +79,8 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent { : this.i18nService.t("inviteAcceptedDesc"), { timeout: 10000 }, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/vault"]); } @@ -203,6 +205,8 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent { // if user exists, send user to login if (orgUserHasExistingUser) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/login"], { queryParams: { email: qParams.email }, }); @@ -213,6 +217,8 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent { if (orgSsoIdentifier) { // We only send sso org identifier if the org has SSO enabled and the SSO policy required. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/sso"], { queryParams: { email: qParams.email, identifier: orgSsoIdentifier }, }); @@ -221,6 +227,8 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent { // if SSO is disabled OR if sso is enabled but the SSO login required policy is not enabled // then send user to create account + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/register"], { queryParams: { email: qParams.email, fromOrgInvite: true }, }); diff --git a/apps/web/src/app/auth/emergency-access/accept/accept-emergency.component.ts b/apps/web/src/app/auth/emergency-access/accept/accept-emergency.component.ts index 7aeb309e1b..8ff847c3a2 100644 --- a/apps/web/src/app/auth/emergency-access/accept/accept-emergency.component.ts +++ b/apps/web/src/app/auth/emergency-access/accept/accept-emergency.component.ts @@ -42,6 +42,8 @@ export class AcceptEmergencyComponent extends BaseAcceptComponent { this.i18nService.t("emergencyInviteAcceptedDesc"), { timeout: 10000 }, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/vault"]); } diff --git a/apps/web/src/app/auth/emergency-access/services/emergency-access.service.ts b/apps/web/src/app/auth/emergency-access/services/emergency-access.service.ts index 284c142317..6bcb933e51 100644 --- a/apps/web/src/app/auth/emergency-access/services/emergency-access.service.ts +++ b/apps/web/src/app/auth/emergency-access/services/emergency-access.service.ts @@ -249,6 +249,8 @@ export class EmergencyAccessService { request.newMasterPasswordHash = masterKeyHash; request.key = encKey[1].encryptedString; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.emergencyAccessApiService.postEmergencyAccessPassword(id, request); } diff --git a/apps/web/src/app/auth/lock.component.ts b/apps/web/src/app/auth/lock.component.ts index d04d7601fe..7088623aaf 100644 --- a/apps/web/src/app/auth/lock.component.ts +++ b/apps/web/src/app/auth/lock.component.ts @@ -72,6 +72,8 @@ export class LockComponent extends BaseLockComponent { async ngOnInit() { await super.ngOnInit(); this.onSuccessfulSubmit = async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigateByUrl(this.successRoute); }; } diff --git a/apps/web/src/app/auth/login/login.component.ts b/apps/web/src/app/auth/login/login.component.ts index 2cd0817b15..ef48aeff67 100644 --- a/apps/web/src/app/auth/login/login.component.ts +++ b/apps/web/src/app/auth/login/login.component.ts @@ -168,17 +168,23 @@ export class LoginComponent extends BaseLoginComponent implements OnInit { const policiesData: { [id: string]: PolicyData } = {}; this.policies.data.map((p) => (policiesData[p.id] = new PolicyData(p))); await this.policyService.replace(policiesData); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["update-password"]); return; } } this.loginService.clearValues(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute]); } goToHint() { this.setFormValues(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigateByUrl("/hint"); } @@ -186,10 +192,14 @@ export class LoginComponent extends BaseLoginComponent implements OnInit { const email = this.formGroup.value.email; if (email) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/register"], { queryParams: { email: email } }); return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/register"]); } @@ -206,6 +216,8 @@ export class LoginComponent extends BaseLoginComponent implements OnInit { if (!result.requiresEncryptionKeyMigration) { return false; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["migrate-legacy-encryption"]); return true; } diff --git a/apps/web/src/app/auth/recover-delete.component.ts b/apps/web/src/app/auth/recover-delete.component.ts index f28cc24f29..e52353e382 100644 --- a/apps/web/src/app/auth/recover-delete.component.ts +++ b/apps/web/src/app/auth/recover-delete.component.ts @@ -34,6 +34,8 @@ export class RecoverDeleteComponent { null, this.i18nService.t("deleteRecoverEmailSent"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } catch (e) { this.logService.error(e); diff --git a/apps/web/src/app/auth/recover-two-factor.component.ts b/apps/web/src/app/auth/recover-two-factor.component.ts index 79abce9f5a..d727a2ab0e 100644 --- a/apps/web/src/app/auth/recover-two-factor.component.ts +++ b/apps/web/src/app/auth/recover-two-factor.component.ts @@ -43,6 +43,8 @@ export class RecoverTwoFactorComponent { null, this.i18nService.t("twoStepRecoverDisabled"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } catch (e) { this.logService.error(e); diff --git a/apps/web/src/app/auth/settings/account/change-avatar.component.ts b/apps/web/src/app/auth/settings/account/change-avatar.component.ts index 7f3d1ab3d8..2efe554bbe 100644 --- a/apps/web/src/app/auth/settings/account/change-avatar.component.ts +++ b/apps/web/src/app/auth/settings/account/change-avatar.component.ts @@ -73,12 +73,16 @@ export class ChangeAvatarComponent implements OnInit, OnDestroy { this.currentSelection = color; }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.setSelection(await this.accountUpdateService.loadColorFromState()); } async showCustomPicker() { this.customColorSelected = true; this.colorPickerElement.nativeElement.click(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.setSelection(this.customColor$.value); } diff --git a/apps/web/src/app/auth/settings/change-password.component.ts b/apps/web/src/app/auth/settings/change-password.component.ts index 04868a6350..dd0a68b4f0 100644 --- a/apps/web/src/app/auth/settings/change-password.component.ts +++ b/apps/web/src/app/auth/settings/change-password.component.ts @@ -73,6 +73,8 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent { ); if (!(await this.userVerificationService.hasMasterPassword())) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/settings/security/two-factor"]); } diff --git a/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.ts b/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.ts index ef34a58c59..084a80a582 100644 --- a/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/emergency-access.component.ts @@ -60,6 +60,8 @@ export class EmergencyAccessComponent implements OnInit { this.canAccessPremium = await this.stateService.getCanAccessPremium(); const orgs = await this.organizationService.getAll(); this.isOrganizationOwner = orgs.some((o) => o.isOwner); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } @@ -87,11 +89,15 @@ export class EmergencyAccessComponent implements OnInit { // eslint-disable-next-line rxjs-angular/prefer-takeuntil comp.onSaved.subscribe(() => { modal.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); }); // eslint-disable-next-line rxjs-angular/prefer-takeuntil comp.onDeleted.subscribe(() => { modal.close(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.remove(details); }); }, @@ -99,6 +105,8 @@ export class EmergencyAccessComponent implements OnInit { } invite() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.edit(null); } diff --git a/apps/web/src/app/auth/settings/emergency-access/view/emergency-access-view.component.ts b/apps/web/src/app/auth/settings/emergency-access/view/emergency-access-view.component.ts index afa7fd7881..c048edef45 100644 --- a/apps/web/src/app/auth/settings/emergency-access/view/emergency-access-view.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/view/emergency-access-view.component.ts @@ -40,6 +40,8 @@ export class EmergencyAccessViewComponent implements OnInit { this.id = qParams.id; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); }); } diff --git a/apps/web/src/app/auth/settings/two-factor-setup.component.ts b/apps/web/src/app/auth/settings/two-factor-setup.component.ts index b2f31648c8..7034afff73 100644 --- a/apps/web/src/app/auth/settings/two-factor-setup.component.ts +++ b/apps/web/src/app/auth/settings/two-factor-setup.component.ts @@ -168,6 +168,8 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy { } recoveryCode() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.openModal(this.recoveryModalRef, TwoFactorRecoveryComponent); } diff --git a/apps/web/src/app/auth/sso.component.ts b/apps/web/src/app/auth/sso.component.ts index ecc2e29ab7..ced1437077 100644 --- a/apps/web/src/app/auth/sso.component.ts +++ b/apps/web/src/app/auth/sso.component.ts @@ -60,6 +60,8 @@ export class SsoComponent extends BaseSsoComponent { } async ngOnInit() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.ngOnInit(); // eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe @@ -120,6 +122,8 @@ export class SsoComponent extends BaseSsoComponent { if (this.clientId === "browser") { document.cookie = `ssoHandOffMessage=${this.i18nService.t("ssoHandOff")};SameSite=strict`; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.submit(); } } diff --git a/apps/web/src/app/auth/trial-initiation/trial-initiation.component.spec.ts b/apps/web/src/app/auth/trial-initiation/trial-initiation.component.spec.ts index d3ef9c8e3e..0b8b0221dd 100644 --- a/apps/web/src/app/auth/trial-initiation/trial-initiation.component.spec.ts +++ b/apps/web/src/app/auth/trial-initiation/trial-initiation.component.spec.ts @@ -42,6 +42,8 @@ describe("TrialInitiationComponent", () => { policyApiServiceMock = mock(); policyServiceMock = mock(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.configureTestingModule({ imports: [ RouterTestingModule.withRoutes([ @@ -207,6 +209,8 @@ describe("TrialInitiationComponent", () => { fixture = TestBed.createComponent(TrialInitiationComponent); component = fixture.componentInstance; fixture.detectChanges(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises component.ngOnInit(); expect(component.layout).toBe("default"); expect(component.accountCreateOnly).toBe(true); diff --git a/apps/web/src/app/auth/trial-initiation/trial-initiation.component.ts b/apps/web/src/app/auth/trial-initiation/trial-initiation.component.ts index 279c23d553..24ea1a6783 100644 --- a/apps/web/src/app/auth/trial-initiation/trial-initiation.component.ts +++ b/apps/web/src/app/auth/trial-initiation/trial-initiation.component.ts @@ -242,10 +242,14 @@ export class TrialInitiationComponent implements OnInit, OnDestroy { } navigateToOrgVault() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["organizations", this.orgId, "vault"]); } navigateToOrgInvite() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["organizations", this.orgId, "members"]); } diff --git a/apps/web/src/app/auth/two-factor.component.ts b/apps/web/src/app/auth/two-factor.component.ts index 2456208185..2f6b3b27e1 100644 --- a/apps/web/src/app/auth/two-factor.component.ts +++ b/apps/web/src/app/auth/two-factor.component.ts @@ -88,12 +88,16 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { if (!result.requiresEncryptionKeyMigration) { return false; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["migrate-legacy-encryption"]); return true; } goAfterLogIn = async () => { this.loginService.clearValues(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute], { queryParams: { identifier: this.orgIdentifier, diff --git a/apps/web/src/app/auth/verify-email-token.component.ts b/apps/web/src/app/auth/verify-email-token.component.ts index 7a4a288031..67ea7c9785 100644 --- a/apps/web/src/app/auth/verify-email-token.component.ts +++ b/apps/web/src/app/auth/verify-email-token.component.ts @@ -37,6 +37,8 @@ export class VerifyEmailTokenComponent implements OnInit { await this.apiService.refreshIdentityToken(); } this.platformUtilsService.showToast("success", null, this.i18nService.t("emailVerified")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); return; } catch (e) { @@ -44,6 +46,8 @@ export class VerifyEmailTokenComponent implements OnInit { } } this.platformUtilsService.showToast("error", null, this.i18nService.t("emailVerifiedFailed")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); }); } diff --git a/apps/web/src/app/auth/verify-recover-delete.component.ts b/apps/web/src/app/auth/verify-recover-delete.component.ts index 0a191992a6..92f2c50efa 100644 --- a/apps/web/src/app/auth/verify-recover-delete.component.ts +++ b/apps/web/src/app/auth/verify-recover-delete.component.ts @@ -37,6 +37,8 @@ export class VerifyRecoverDeleteComponent implements OnInit { this.token = qParams.token; this.email = qParams.email; } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } }); @@ -52,6 +54,8 @@ export class VerifyRecoverDeleteComponent implements OnInit { this.i18nService.t("accountDeleted"), this.i18nService.t("accountDeletedDesc"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } catch (e) { this.logService.error(e); diff --git a/apps/web/src/app/billing/individual/billing-history-view.component.ts b/apps/web/src/app/billing/individual/billing-history-view.component.ts index cfef0ff8d5..3ee6415d6d 100644 --- a/apps/web/src/app/billing/individual/billing-history-view.component.ts +++ b/apps/web/src/app/billing/individual/billing-history-view.component.ts @@ -21,6 +21,8 @@ export class BillingHistoryViewComponent implements OnInit { async ngOnInit() { if (this.platformUtilsService.isSelfHost()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/settings/subscription"]); return; } diff --git a/apps/web/src/app/billing/individual/premium.component.ts b/apps/web/src/app/billing/individual/premium.component.ts index 4cfd2196c9..8f40c3f1c2 100644 --- a/apps/web/src/app/billing/individual/premium.component.ts +++ b/apps/web/src/app/billing/individual/premium.component.ts @@ -50,6 +50,8 @@ export class PremiumComponent implements OnInit { this.canAccessPremium = await this.stateService.getCanAccessPremium(); const premiumPersonally = await this.stateService.getHasPremiumPersonally(); if (premiumPersonally) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/settings/subscription/user-subscription"]); return; } @@ -123,6 +125,8 @@ export class PremiumComponent implements OnInit { await this.syncService.fullSync(true); this.platformUtilsService.showToast("success", null, this.i18nService.t("premiumUpdated")); this.messagingService.send("purchasedPremium"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/settings/subscription/user-subscription"]); } diff --git a/apps/web/src/app/billing/individual/user-subscription.component.ts b/apps/web/src/app/billing/individual/user-subscription.component.ts index 1918d71fa4..51cebc595d 100644 --- a/apps/web/src/app/billing/individual/user-subscription.component.ts +++ b/apps/web/src/app/billing/individual/user-subscription.component.ts @@ -57,6 +57,8 @@ export class UserSubscriptionComponent implements OnInit { this.loading = true; this.sub = await this.apiService.getUserSubscription(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/settings/subscription/premium"]); return; } @@ -83,6 +85,8 @@ export class UserSubscriptionComponent implements OnInit { this.reinstatePromise = this.apiService.postReinstatePremium(); await this.reinstatePromise; this.platformUtilsService.showToast("success", null, this.i18nService.t("reinstated")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } catch (e) { this.logService.error(e); @@ -112,6 +116,8 @@ export class UserSubscriptionComponent implements OnInit { null, this.i18nService.t("canceledSubscription"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } catch (e) { this.logService.error(e); @@ -140,6 +146,8 @@ export class UserSubscriptionComponent implements OnInit { closeUpdateLicense(load: boolean) { this.showUpdateLicense = false; if (load) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } } @@ -152,6 +160,8 @@ export class UserSubscriptionComponent implements OnInit { closeStorage(load: boolean) { this.showAdjustStorage = false; if (load) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } } diff --git a/apps/web/src/app/billing/organizations/organization-plans.component.ts b/apps/web/src/app/billing/organizations/organization-plans.component.ts index 78a18674c4..70b91a0d0d 100644 --- a/apps/web/src/app/billing/organizations/organization-plans.component.ts +++ b/apps/web/src/app/billing/organizations/organization-plans.component.ts @@ -565,6 +565,8 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy { await this.syncService.fullSync(true); if (!this.acceptingSponsorship && !this.isInTrialFlow) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/organizations/" + orgId]); } diff --git a/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts b/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts index d2f0fb2224..09f0f9ca40 100644 --- a/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts +++ b/apps/web/src/app/billing/organizations/organization-subscription-cloud.component.ts @@ -56,6 +56,8 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy async ngOnInit() { if (this.route.snapshot.queryParamMap.get("upgrade")) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.changePlan(); } @@ -290,6 +292,8 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy null, this.i18nService.t("canceledSubscription"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } catch (e) { this.logService.error(e); @@ -314,6 +318,8 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy try { await this.organizationApiService.reinstate(this.organizationId); this.platformUtilsService.showToast("success", null, this.i18nService.t("reinstated")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } catch (e) { this.logService.error(e); @@ -339,6 +345,8 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy }); await firstValueFrom(dialogRef.closed); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } @@ -347,6 +355,8 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy } subscriptionAdjusted() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } @@ -358,6 +368,8 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy closeStorage(load: boolean) { this.showAdjustStorage = false; if (load) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } } diff --git a/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.ts b/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.ts index 7898083454..5a9a8eb081 100644 --- a/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.ts +++ b/apps/web/src/app/billing/organizations/organization-subscription-selfhost.component.ts @@ -139,6 +139,8 @@ export class OrganizationSubscriptionSelfhostComponent implements OnInit, OnDest } licenseUploaded() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); this.messagingService.send("updatedOrgLicense"); } @@ -158,6 +160,8 @@ export class OrganizationSubscriptionSelfhostComponent implements OnInit, OnDest this.form.get("updateMethod").setValue(LicenseOptions.SYNC); await this.organizationApiService.selfHostedSyncLicense(this.organizationId); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); await this.loadOrganizationConnection(); this.messagingService.send("updatedOrgLicense"); diff --git a/apps/web/src/app/billing/shared/adjust-storage.component.ts b/apps/web/src/app/billing/shared/adjust-storage.component.ts index 9474324fe6..25462c2829 100644 --- a/apps/web/src/app/billing/shared/adjust-storage.component.ts +++ b/apps/web/src/app/billing/shared/adjust-storage.component.ts @@ -79,6 +79,8 @@ export class AdjustStorageComponent { this.i18nService.t("couldNotChargeCardPayInvoice"), { timeout: 10000 }, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["../billing"], { relativeTo: this.activatedRoute }); } else { this.platformUtilsService.showToast( diff --git a/apps/web/src/app/billing/shared/payment-method.component.ts b/apps/web/src/app/billing/shared/payment-method.component.ts index 7917357835..d2b65968c3 100644 --- a/apps/web/src/app/billing/shared/payment-method.component.ts +++ b/apps/web/src/app/billing/shared/payment-method.component.ts @@ -68,6 +68,8 @@ export class PaymentMethodComponent implements OnInit { if (params.organizationId) { this.organizationId = params.organizationId; } else if (this.platformUtilsService.isSelfHost()) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/settings/subscription"]); return; } @@ -112,6 +114,8 @@ export class PaymentMethodComponent implements OnInit { closeAddCredit(load: boolean) { this.showAddCredit = false; if (load) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } } @@ -123,6 +127,8 @@ export class PaymentMethodComponent implements OnInit { closePayment(load: boolean) { this.showAdjustPayment = false; if (load) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } } @@ -143,6 +149,8 @@ export class PaymentMethodComponent implements OnInit { null, this.i18nService.t("verifiedBankAccount"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.load(); } catch (e) { this.logService.error(e); diff --git a/apps/web/src/app/billing/shared/payment.component.ts b/apps/web/src/app/billing/shared/payment.component.ts index ddf4f522f4..6e34962cb7 100644 --- a/apps/web/src/app/billing/shared/payment.component.ts +++ b/apps/web/src/app/billing/shared/payment.component.ts @@ -192,6 +192,8 @@ export class PaymentComponent implements OnInit, OnDestroy { this.method === PaymentMethodType.BankAccount ) { if (this.method === PaymentMethodType.Card) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.apiService .postSetupPayment() .then((clientSecret) => diff --git a/apps/web/src/app/common/base.accept.component.ts b/apps/web/src/app/common/base.accept.component.ts index 1b2f034362..cad1d90088 100644 --- a/apps/web/src/app/common/base.accept.component.ts +++ b/apps/web/src/app/common/base.accept.component.ts @@ -62,6 +62,8 @@ export abstract class BaseAcceptComponent implements OnInit { ? this.i18nService.t(this.failedShortMessage, errorMessage) : this.i18nService.t(this.failedMessage); this.platformUtilService.showToast("error", null, message, { timeout: 10000 }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } diff --git a/apps/web/src/app/settings/settings.component.ts b/apps/web/src/app/settings/settings.component.ts index 181506607e..c2fd1c77fa 100644 --- a/apps/web/src/app/settings/settings.component.ts +++ b/apps/web/src/app/settings/settings.component.ts @@ -32,6 +32,8 @@ export class SettingsComponent implements OnInit, OnDestroy { async ngOnInit() { this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "purchasedPremium": diff --git a/apps/web/src/app/tools/reports/pages/exposed-passwords-report.component.spec.ts b/apps/web/src/app/tools/reports/pages/exposed-passwords-report.component.spec.ts index 656abbff2a..d1cf89eb08 100644 --- a/apps/web/src/app/tools/reports/pages/exposed-passwords-report.component.spec.ts +++ b/apps/web/src/app/tools/reports/pages/exposed-passwords-report.component.spec.ts @@ -20,6 +20,8 @@ describe("ExposedPasswordsReportComponent", () => { beforeEach(() => { auditService = mock(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.configureTestingModule({ declarations: [ExposedPasswordsReportComponent, I18nPipe], providers: [ diff --git a/apps/web/src/app/tools/reports/pages/inactive-two-factor-report.component.spec.ts b/apps/web/src/app/tools/reports/pages/inactive-two-factor-report.component.spec.ts index 56c14b92fb..97321480fa 100644 --- a/apps/web/src/app/tools/reports/pages/inactive-two-factor-report.component.spec.ts +++ b/apps/web/src/app/tools/reports/pages/inactive-two-factor-report.component.spec.ts @@ -18,6 +18,8 @@ describe("InactiveTwoFactorReportComponent", () => { let fixture: ComponentFixture; beforeEach(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.configureTestingModule({ declarations: [InactiveTwoFactorReportComponent, I18nPipe], providers: [ diff --git a/apps/web/src/app/tools/reports/pages/reused-passwords-report.component.spec.ts b/apps/web/src/app/tools/reports/pages/reused-passwords-report.component.spec.ts index 01ed07a568..450e42805a 100644 --- a/apps/web/src/app/tools/reports/pages/reused-passwords-report.component.spec.ts +++ b/apps/web/src/app/tools/reports/pages/reused-passwords-report.component.spec.ts @@ -17,6 +17,8 @@ describe("ReusedPasswordsReportComponent", () => { let fixture: ComponentFixture; beforeEach(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.configureTestingModule({ declarations: [ReusedPasswordsReportComponent, I18nPipe], providers: [ diff --git a/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.spec.ts b/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.spec.ts index 3bc8346d7a..5cdf640c55 100644 --- a/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.spec.ts +++ b/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.spec.ts @@ -17,6 +17,8 @@ describe("UnsecuredWebsitesReportComponent", () => { let fixture: ComponentFixture; beforeEach(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.configureTestingModule({ declarations: [UnsecuredWebsitesReportComponent, I18nPipe], providers: [ diff --git a/apps/web/src/app/tools/reports/pages/weak-passwords-report.component.spec.ts b/apps/web/src/app/tools/reports/pages/weak-passwords-report.component.spec.ts index 9d74412dc2..f1446c4209 100644 --- a/apps/web/src/app/tools/reports/pages/weak-passwords-report.component.spec.ts +++ b/apps/web/src/app/tools/reports/pages/weak-passwords-report.component.spec.ts @@ -20,6 +20,8 @@ describe("WeakPasswordsReportComponent", () => { beforeEach(() => { passwordStrengthService = mock(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.configureTestingModule({ declarations: [WeakPasswordsReportComponent, I18nPipe], providers: [ diff --git a/apps/web/src/app/tools/send/send.component.ts b/apps/web/src/app/tools/send/send.component.ts index c844534fae..265571db59 100644 --- a/apps/web/src/app/tools/send/send.component.ts +++ b/apps/web/src/app/tools/send/send.component.ts @@ -76,6 +76,8 @@ export class SendComponent extends BaseSendComponent { // Broadcaster subscription - load if sync completes in the background this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": diff --git a/apps/web/src/app/tools/vault-export/export.component.ts b/apps/web/src/app/tools/vault-export/export.component.ts index 2144f73c29..c55a2a38f7 100644 --- a/apps/web/src/app/tools/vault-export/export.component.ts +++ b/apps/web/src/app/tools/vault-export/export.component.ts @@ -82,6 +82,8 @@ export class ExportComponent extends BaseExportComponent { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.doExport(); } diff --git a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts index 7d3769756d..9872ef0da0 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts @@ -58,6 +58,8 @@ export class VaultCipherRowComponent { @HostListener("click") protected click() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { queryParams: { itemId: this.cipher.id }, queryParamsHandling: "merge", diff --git a/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.ts b/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.ts index 157a53ecf7..73148c64d2 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.ts @@ -73,6 +73,8 @@ export class VaultCollectionRowComponent { @HostListener("click") protected click() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { queryParams: { collectionId: this.collection.id }, queryParamsHandling: "merge", diff --git a/apps/web/src/app/vault/individual-vault/add-edit.component.ts b/apps/web/src/app/vault/individual-vault/add-edit.component.ts index e732d2ba0f..5376a68922 100644 --- a/apps/web/src/app/vault/individual-vault/add-edit.component.ts +++ b/apps/web/src/app/vault/individual-vault/add-edit.component.ts @@ -128,6 +128,8 @@ export class AddEditComponent extends BaseAddEditComponent implements OnInit, On this.showPasswordCount = !this.showPasswordCount; if (this.editMode && this.showPasswordCount) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledPasswordVisible, this.cipherId, @@ -157,10 +159,16 @@ export class AddEditComponent extends BaseAddEditComponent implements OnInit, On if (this.editMode) { if (typeI18nKey === "password") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, this.cipherId); } else if (typeI18nKey === "securityCode") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedCardCode, this.cipherId); } else if (aType === "H_Field") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientCopiedHiddenField, this.cipherId, diff --git a/apps/web/src/app/vault/individual-vault/vault-filter/services/routed-vault-filter-bridge.service.ts b/apps/web/src/app/vault/individual-vault/vault-filter/services/routed-vault-filter-bridge.service.ts index 10de9c15ab..08ce9b67ba 100644 --- a/apps/web/src/app/vault/individual-vault/vault-filter/services/routed-vault-filter-bridge.service.ts +++ b/apps/web/src/app/vault/individual-vault/vault-filter/services/routed-vault-filter-bridge.service.ts @@ -65,6 +65,8 @@ export class RoutedVaultFilterBridgeService { navigate(filter: RoutedVaultFilterModel) { const [commands, extras] = this.routedVaultFilterService.createRoute(filter); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(commands, extras); } } diff --git a/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.spec.ts b/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.spec.ts index 912626beac..5db01ab26a 100644 --- a/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.spec.ts +++ b/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.spec.ts @@ -61,6 +61,8 @@ describe("vault filter service", () => { } }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises vaultFilterService.setCollapsedFilterNodes(nodes); }); @@ -180,6 +182,8 @@ describe("vault filter service", () => { createCollectionView("1", "collection 1", "org test id"), createCollectionView("2", "collection 2", "non matching org id"), ]; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises vaultFilterService.reloadCollections(storedCollections); await expect(firstValueFrom(vaultFilterService.filteredCollections$)).resolves.toEqual([ @@ -195,6 +199,8 @@ describe("vault filter service", () => { createCollectionView("id-2", "Collection 1/Collection 2", "org test id"), createCollectionView("id-3", "Collection 1/Collection 3", "org test id"), ]; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises vaultFilterService.reloadCollections(storedCollections); const result = await firstValueFrom(vaultFilterService.collectionTree$); @@ -208,6 +214,8 @@ describe("vault filter service", () => { createCollectionView("id-1", "Collection 1", "org test id"), createCollectionView("id-3", "Collection 1/Collection 2/Collection 3", "org test id"), ]; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises vaultFilterService.reloadCollections(storedCollections); const result = await firstValueFrom(vaultFilterService.collectionTree$); @@ -224,6 +232,8 @@ describe("vault filter service", () => { createCollectionView("id-3", "Collection 1/Collection 2/Collection 3", "org test id"), createCollectionView("id-4", "Collection 1/Collection 4", "org test id"), ]; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises vaultFilterService.reloadCollections(storedCollections); const result = await firstValueFrom(vaultFilterService.collectionTree$); @@ -242,6 +252,8 @@ describe("vault filter service", () => { createCollectionView("id-1", "Collection 1", "org test id"), createCollectionView("id-3", "Collection 1/Collection 2/Collection 3", "org test id"), ]; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises vaultFilterService.reloadCollections(storedCollections); const result = await firstValueFrom(vaultFilterService.collectionTree$); diff --git a/apps/web/src/app/vault/individual-vault/vault.component.ts b/apps/web/src/app/vault/individual-vault/vault.component.ts index 2d662e04fc..7894677b69 100644 --- a/apps/web/src/app/vault/individual-vault/vault.component.ts +++ b/apps/web/src/app/vault/individual-vault/vault.component.ts @@ -223,6 +223,8 @@ export class VaultComponent implements OnInit, OnDestroy { ); this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": @@ -339,6 +341,8 @@ export class VaultComponent implements OnInit, OnDestroy { const cipherId = getCipherIdFromParams(params); if (cipherId) { if ((await this.cipherService.get(cipherId)) != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.editCipherId(cipherId); } else { this.platformUtilsService.showToast( @@ -346,6 +350,8 @@ export class VaultComponent implements OnInit, OnDestroy { this.i18nService.t("errorOccurred"), this.i18nService.t("unknownCipher"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { queryParams: { itemId: null, cipherId: null }, queryParamsHandling: "merge", @@ -470,6 +476,8 @@ export class VaultComponent implements OnInit, OnDestroy { } const orgs = await firstValueFrom(this.filterComponent.filters.organizationFilter.data$); const orgNode = ServiceUtils.getTreeNodeObject(orgs, orgId) as TreeNode; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.filterComponent.filters?.organizationFilter?.action(orgNode); } @@ -487,6 +495,8 @@ export class VaultComponent implements OnInit, OnDestroy { const result = await lastValueFrom(dialog.closed); if (result === FolderAddEditDialogResult.Deleted) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { queryParams: { folderId: null }, queryParamsHandling: "merge", @@ -638,6 +648,8 @@ export class VaultComponent implements OnInit, OnDestroy { }, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises modal.onClosedPromise().then(() => { this.go({ cipherId: null, itemId: null }); }); @@ -714,6 +726,8 @@ export class VaultComponent implements OnInit, OnDestroy { ); // Navigate away if we deleted the collection we were viewing if (this.selectedCollection?.node.id === collection.id) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { queryParams: { collectionId: this.selectedCollection.parent?.node.id ?? null }, queryParamsHandling: "merge", @@ -929,8 +943,12 @@ export class VaultComponent implements OnInit, OnDestroy { ); if (field === "password") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, cipher.id); } else if (field === "totp") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedHiddenField, cipher.id); } } @@ -992,6 +1010,8 @@ export class VaultComponent implements OnInit, OnDestroy { }; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { relativeTo: this.route, queryParams: queryParams, diff --git a/apps/web/src/app/vault/org-vault/vault-filter/vault-filter.component.ts b/apps/web/src/app/vault/org-vault/vault-filter/vault-filter.component.ts index 819281738e..742a4242b4 100644 --- a/apps/web/src/app/vault/org-vault/vault-filter/vault-filter.component.ts +++ b/apps/web/src/app/vault/org-vault/vault-filter/vault-filter.component.ts @@ -70,6 +70,8 @@ export class VaultFilterComponent extends BaseVaultFilterComponent implements On protected async addCollectionFilter(): Promise { // Ensure the Collections filter is never collapsed for the org vault + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.removeCollapsibleCollection(); const collectionFilterSection: VaultFilterSection = { diff --git a/apps/web/src/app/vault/org-vault/vault-header/vault-header.component.ts b/apps/web/src/app/vault/org-vault/vault-header/vault-header.component.ts index aa3ae5bc34..877c9022a7 100644 --- a/apps/web/src/app/vault/org-vault/vault-header/vault-header.component.ts +++ b/apps/web/src/app/vault/org-vault/vault-header/vault-header.component.ts @@ -125,12 +125,16 @@ export class VaultHeaderComponent { const simpleDialog = this.dialogService.openSimpleDialogRef(orgUpgradeSimpleDialogOpts); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises firstValueFrom(simpleDialog.closed).then((result: boolean | undefined) => { if (!result) { return; } if (result && this.organization.canEditSubscription) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/organizations", this.organization.id, "billing", "subscription"], { queryParams: { upgrade: true }, }); diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts index 844b17090d..56052dfac5 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.ts +++ b/apps/web/src/app/vault/org-vault/vault.component.ts @@ -204,6 +204,8 @@ export class VaultComponent implements OnInit, OnDestroy { ); this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": @@ -393,6 +395,8 @@ export class VaultComponent implements OnInit, OnDestroy { organization.canUseAdminCollections || (await this.cipherService.get(cipherId)) != null ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.editCipherId(cipherId); } else { this.platformUtilsService.showToast( @@ -400,6 +404,8 @@ export class VaultComponent implements OnInit, OnDestroy { this.i18nService.t("errorOccurred"), this.i18nService.t("unknownCipher"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { queryParams: { cipherId: null, itemId: null }, queryParamsHandling: "merge", @@ -420,6 +426,8 @@ export class VaultComponent implements OnInit, OnDestroy { } const cipher = allCiphers$.find((c) => c.id === cipherId); if (organization.useEvents && cipher != undefined) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.viewEvents(cipher); } else { this.platformUtilsService.showToast( @@ -427,6 +435,8 @@ export class VaultComponent implements OnInit, OnDestroy { this.i18nService.t("errorOccurred"), this.i18nService.t("unknownCipher"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { queryParams: { viewEvents: null }, queryParamsHandling: "merge", @@ -669,6 +679,8 @@ export class VaultComponent implements OnInit, OnDestroy { }, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises modal.onClosedPromise().then(() => { this.go({ cipherId: null, itemId: null }); }); @@ -797,6 +809,8 @@ export class VaultComponent implements OnInit, OnDestroy { // Navigate away if we deleted the colletion we were viewing if (this.selectedCollection?.node.id === collection.id) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { queryParams: { collectionId: this.selectedCollection.parent?.node.id ?? null }, queryParamsHandling: "merge", @@ -883,8 +897,12 @@ export class VaultComponent implements OnInit, OnDestroy { ); if (field === "password") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, cipher.id); } else if (field === "totp") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedHiddenField, cipher.id); } } @@ -981,6 +999,8 @@ export class VaultComponent implements OnInit, OnDestroy { }; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([], { relativeTo: this.route, queryParams: queryParams, diff --git a/apps/web/src/app/vault/settings/purge-vault.component.ts b/apps/web/src/app/vault/settings/purge-vault.component.ts index f064a7a3db..4ef9e20e2a 100644 --- a/apps/web/src/app/vault/settings/purge-vault.component.ts +++ b/apps/web/src/app/vault/settings/purge-vault.component.ts @@ -36,10 +36,16 @@ export class PurgeVaultComponent { .then((request) => this.apiService.postPurgeCiphers(request, this.organizationId)); await this.formPromise; this.platformUtilsService.showToast("success", null, this.i18nService.t("vaultPurged")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.syncService.fullSync(true); if (this.organizationId != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["organizations", this.organizationId, "vault"]); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["vault"]); } } catch (e) { diff --git a/apps/web/src/connectors/captcha.ts b/apps/web/src/connectors/captcha.ts index 918209598a..0362c9121f 100644 --- a/apps/web/src/connectors/captcha.ts +++ b/apps/web/src/connectors/captcha.ts @@ -9,6 +9,8 @@ if (window.location.pathname.includes("mobile")) { } document.addEventListener("DOMContentLoaded", () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises init(); }); @@ -75,6 +77,8 @@ async function start() { callback: "captchaSuccess", "error-callback": "captchaError", }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises watchHeight(); }); document.head.appendChild(script); @@ -101,6 +105,8 @@ function onMessage() { } if (event.data === "start") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises start(); } }, diff --git a/apps/web/src/connectors/webauthn-fallback.ts b/apps/web/src/connectors/webauthn-fallback.ts index bae95a0ad5..980a8b3dbf 100644 --- a/apps/web/src/connectors/webauthn-fallback.ts +++ b/apps/web/src/connectors/webauthn-fallback.ts @@ -106,6 +106,8 @@ function start() { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises initWebAuthn(json); } diff --git a/apps/web/src/main.ts b/apps/web/src/main.ts index 01b054780a..b0729b6b85 100644 --- a/apps/web/src/main.ts +++ b/apps/web/src/main.ts @@ -14,4 +14,6 @@ if (process.env.NODE_ENV === "production") { enableProdMode(); } +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: true }); diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/clients/clients.component.ts b/bitwarden_license/bit-web/src/app/admin-console/providers/clients/clients.component.ts index f946709ecb..dc3dea3c9d 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/clients/clients.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/clients/clients.component.ts @@ -102,6 +102,8 @@ export class ClientsComponent implements OnInit { isPaging() { const searching = this.isSearching(); if (searching && this.didScroll) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.resetPaging(); } return !searching && this.clients && this.clients.length > this.pageSize; diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/events.component.ts b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/events.component.ts index 1b0b45ba4c..59ff44953e 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/events.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/events.component.ts @@ -54,6 +54,8 @@ export class EventsComponent extends BaseEventsComponent implements OnInit { this.providerId = params.providerId; const provider = await this.providerService.get(this.providerId); if (provider == null || !provider.useEvents) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/providers", this.providerId]); return; } diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/people.component.ts b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/people.component.ts index d0bc7a8013..227e37984f 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/people.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/people.component.ts @@ -94,6 +94,8 @@ export class PeopleComponent const provider = await this.providerService.get(this.providerId); if (!provider.canManageUsers) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["../"], { relativeTo: this.route }); return; } @@ -108,6 +110,8 @@ export class PeopleComponent if (qParams.viewEvents != null) { const user = this.users.filter((u) => u.id === qParams.viewEvents); if (user.length > 0 && user[0].status === ProviderUserStatusType.Confirmed) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.events(user[0]); } } @@ -215,6 +219,8 @@ export class PeopleComponent try { const request = new ProviderUserBulkRequest(filteredUsers.map((user) => user.id)); const response = this.apiService.postManyProviderUserReinvite(this.providerId, request); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.showBulkStatus( users, filteredUsers, diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/setup/setup.component.ts b/bitwarden_license/bit-web/src/app/admin-console/providers/setup/setup.component.ts index 7b909e538b..5b1f6d1cb4 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/setup/setup.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/setup/setup.component.ts @@ -51,6 +51,8 @@ export class SetupComponent implements OnInit { this.i18nService.t("emergencyInviteAcceptFailed"), { timeout: 10000 }, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); return; } @@ -62,10 +64,14 @@ export class SetupComponent implements OnInit { try { const provider = await this.apiService.getProvider(this.providerId); if (provider.name != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/providers", provider.id], { replaceUrl: true }); } } catch (e) { this.validationService.showError(e); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); } }); @@ -92,6 +98,8 @@ export class SetupComponent implements OnInit { this.platformUtilsService.showToast("success", null, this.i18nService.t("providerSetup")); await this.syncService.fullSync(true); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/providers", provider.id]); } catch (e) { this.validationService.showError(e); diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/overview/overview.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/overview/overview.component.ts index 8000fa8f63..c916d6f48b 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/overview/overview.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/overview/overview.component.ts @@ -196,6 +196,8 @@ export class OverviewComponent implements OnInit, OnDestroy { ...prevTasks[organizationId], ...newlyCompletedOrgTasks, }; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setSMOnboardingTasks({ ...prevTasks, [organizationId]: nextOrgTasks, @@ -304,6 +306,8 @@ export class OverviewComponent implements OnInit, OnDestroy { protected hideOnboarding() { this.showOnboarding = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.saveCompletedTasks(this.organizationId, { importSecrets: true, createSecret: true, diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/projects/dialog/project-dialog.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/projects/dialog/project-dialog.component.ts index fd6fe6c885..0b65bd0a26 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/projects/dialog/project-dialog.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/projects/dialog/project-dialog.component.ts @@ -82,6 +82,8 @@ export class ProjectDialogComponent implements OnInit { const projectView = this.getProjectView(); if (this.data.operation === OperationType.Add) { const newProject = await this.createProject(projectView); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["sm", this.data.organizationId, "projects", newProject.id]); } else { projectView.id = this.data.projectId; diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project-people.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project-people.component.ts index 92f68bb90d..b52a8938b4 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project-people.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project-people.component.ts @@ -38,6 +38,8 @@ export class ProjectPeopleComponent implements OnInit, OnDestroy { }), ), catchError(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/sm", this.organizationId, "projects"]); return EMPTY; }), @@ -124,6 +126,8 @@ export class ProjectPeopleComponent implements OnInit, OnDestroy { this.currentAccessPolicies = convertToAccessPolicyItemViews(peoplePoliciesViews); if (showAccessRemovalWarning) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["sm", this.organizationId, "projects"]); } this.platformUtilsService.showToast( diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project.component.ts index ae3c6e05db..d24ff7a3b0 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/projects/project/project.component.ts @@ -57,6 +57,8 @@ export class ProjectComponent implements OnInit, OnDestroy { this.project$ = combineLatest([this.route.params, currentProjectEdited]).pipe( switchMap(([params, _]) => this.projectService.getByProjectId(params.projectId)), catchError(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/sm", this.organizationId, "projects"]).then(() => { this.platformUtilsService.showToast( "error", diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/secrets/dialog/secret-dialog.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/secrets/dialog/secret-dialog.component.ts index 5054a59bc4..e944fbce0c 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/secrets/dialog/secret-dialog.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/secrets/dialog/secret-dialog.component.ts @@ -212,6 +212,8 @@ export class SecretDialogComponent implements OnInit { ); // If the secret is deleted, chain close this dialog after the delete dialog + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises lastValueFrom(dialogRef.closed).then( (closeData) => closeData !== undefined && this.dialogRef.close(), ); diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/dialog/service-account-dialog.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/dialog/service-account-dialog.component.ts index 205e157cbe..9aa7c658f3 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/dialog/service-account-dialog.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/dialog/service-account-dialog.component.ts @@ -47,6 +47,8 @@ export class ServiceAccountDialogComponent { async ngOnInit() { if (this.data.operation == OperationType.Edit) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.loadData(); } } diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/people/service-account-people.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/people/service-account-people.component.ts index 04e0617815..ab6a627fd9 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/people/service-account-people.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/people/service-account-people.component.ts @@ -41,6 +41,8 @@ export class ServiceAccountPeopleComponent implements OnInit, OnDestroy { }), ), catchError(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/sm", this.organizationId, "service-accounts"]); return EMPTY; }), @@ -196,6 +198,8 @@ export class ServiceAccountPeopleComponent implements OnInit, OnDestroy { selectedPolicies: ApItemValueType[], ): Promise { if (showAccessRemovalWarning) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["sm", this.organizationId, "service-accounts"]); } else if ( this.accessPolicySelectorService.isAccessRemoval(currentAccessPolicies, selectedPolicies) diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/service-account.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/service-account.component.ts index 19a10b9e41..d352e8a246 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/service-account.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/service-accounts/service-account.component.ts @@ -43,6 +43,8 @@ export class ServiceAccountComponent implements OnInit, OnDestroy { ), ), catchError(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/sm", this.organizationId, "service-accounts"]).then(() => { this.platformUtilsService.showToast( "error", diff --git a/bitwarden_license/bit-web/src/app/secrets-manager/shared/secrets-list.component.ts b/bitwarden_license/bit-web/src/app/secrets-manager/shared/secrets-list.component.ts index 0398c649a1..d640114e07 100644 --- a/bitwarden_license/bit-web/src/app/secrets-manager/shared/secrets-list.component.ts +++ b/bitwarden_license/bit-web/src/app/secrets-manager/shared/secrets-list.component.ts @@ -141,6 +141,8 @@ export class SecretsListComponent implements OnDestroy { secretService: SecretService, ) { const value = secretService.getBySecretId(id).then((secret) => secret.value); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises SecretsListComponent.copyToClipboardAsync(value, platformUtilsService).then(() => { platformUtilsService.showToast( "success", diff --git a/bitwarden_license/bit-web/src/main.ts b/bitwarden_license/bit-web/src/main.ts index f3bf5608e8..06b4cdf5d1 100644 --- a/bitwarden_license/bit-web/src/main.ts +++ b/bitwarden_license/bit-web/src/main.ts @@ -14,4 +14,6 @@ if (process.env.NODE_ENV === "production") { enableProdMode(); } +// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. +// eslint-disable-next-line @typescript-eslint/no-floating-promises platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: true }); diff --git a/libs/angular/src/auth/components/base-login-decryption-options.component.ts b/libs/angular/src/auth/components/base-login-decryption-options.component.ts index c821b3d8c0..eecd852c7b 100644 --- a/libs/angular/src/auth/components/base-login-decryption-options.component.ts +++ b/libs/angular/src/auth/components/base-login-decryption-options.component.ts @@ -112,6 +112,8 @@ export class BaseLoginDecryptionOptionsComponent implements OnInit, OnDestroy { // - User does not have admin approval (i.e. has not enrolled into admin reset) // - AND does not have a master password + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.loadNewUserData(); } else { this.loadUntrustedDeviceData(accountDecryptionOptions); @@ -237,15 +239,21 @@ export class BaseLoginDecryptionOptionsComponent implements OnInit, OnDestroy { } this.loginService.setEmail(this.data.userEmail); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/login-with-device"]); } async requestAdminApproval() { this.loginService.setEmail(this.data.userEmail); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/admin-approval-requested"]); } async approveWithMasterPassword() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/lock"], { queryParams: { from: "login-initiated" } }); } diff --git a/libs/angular/src/auth/components/base-login-via-webauthn.component.ts b/libs/angular/src/auth/components/base-login-via-webauthn.component.ts index 95a023a258..c2bd1becf2 100644 --- a/libs/angular/src/auth/components/base-login-via-webauthn.component.ts +++ b/libs/angular/src/auth/components/base-login-via-webauthn.component.ts @@ -27,11 +27,15 @@ export class BaseLoginViaWebAuthnComponent implements OnInit { ) {} ngOnInit(): void { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.authenticate(); } protected retry() { this.currentState = "assert"; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.authenticate(); } diff --git a/libs/angular/src/auth/components/environment-selector.component.ts b/libs/angular/src/auth/components/environment-selector.component.ts index eecba7b4ab..80cc058180 100644 --- a/libs/angular/src/auth/components/environment-selector.component.ts +++ b/libs/angular/src/auth/components/environment-selector.component.ts @@ -58,8 +58,12 @@ export class EnvironmentSelectorComponent implements OnInit, OnDestroy { async ngOnInit() { this.configService.serverConfig$.pipe(takeUntil(this.componentDestroyed$)).subscribe(() => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateEnvironmentInfo(); }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateEnvironmentInfo(); } @@ -74,6 +78,8 @@ export class EnvironmentSelectorComponent implements OnInit, OnDestroy { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateEnvironmentInfo(); if (option === Region.SelfHosted) { @@ -82,6 +88,8 @@ export class EnvironmentSelectorComponent implements OnInit, OnDestroy { } await this.environmentService.setRegion(option); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateEnvironmentInfo(); } @@ -91,6 +99,8 @@ export class EnvironmentSelectorComponent implements OnInit, OnDestroy { close() { this.isOpen = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.updateEnvironmentInfo(); } } diff --git a/libs/angular/src/auth/components/hint.component.ts b/libs/angular/src/auth/components/hint.component.ts index d77dfe0b54..54edc5b8fa 100644 --- a/libs/angular/src/auth/components/hint.component.ts +++ b/libs/angular/src/auth/components/hint.component.ts @@ -54,6 +54,8 @@ export class HintComponent implements OnInit { if (this.onSuccessfulSubmit != null) { this.onSuccessfulSubmit(); } else if (this.router != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute]); } } catch (e) { diff --git a/libs/angular/src/auth/components/lock.component.ts b/libs/angular/src/auth/components/lock.component.ts index d03b28abdb..fc8c6eac20 100644 --- a/libs/angular/src/auth/components/lock.component.ts +++ b/libs/angular/src/auth/components/lock.component.ts @@ -291,6 +291,8 @@ export class LockComponent implements OnInit, OnDestroy { await this.stateService.setForceSetPasswordReason( ForceSetPasswordReason.WeakMasterPassword, ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.forcePasswordResetRoute]); return; } @@ -303,6 +305,8 @@ export class LockComponent implements OnInit, OnDestroy { if (this.onSuccessfulSubmit != null) { await this.onSuccessfulSubmit(); } else if (this.router != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute]); } } diff --git a/libs/angular/src/auth/components/login-via-auth-request.component.ts b/libs/angular/src/auth/components/login-via-auth-request.component.ts index 317f47bb54..c047a3173f 100644 --- a/libs/angular/src/auth/components/login-via-auth-request.component.ts +++ b/libs/angular/src/auth/components/login-via-auth-request.component.ts @@ -100,6 +100,8 @@ export class LoginViaAuthRequestComponent .pipe(takeUntil(this.destroy$)) .subscribe((id) => { // Only fires on approval currently + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.verifyAndHandleApprovedAuthReq(id); }); } @@ -126,6 +128,8 @@ export class LoginViaAuthRequestComponent if (!this.email) { this.platformUtilsService.showToast("error", null, this.i18nService.t("userEmailMissing")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/login-initiated"]); return; } @@ -147,6 +151,8 @@ export class LoginViaAuthRequestComponent if (!this.email) { this.platformUtilsService.showToast("error", null, this.i18nService.t("userEmailMissing")); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/login"]); return; } @@ -212,6 +218,8 @@ export class LoginViaAuthRequestComponent await this.stateService.setAdminAuthRequest(null); // start new auth request + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.startAuthRequestLogin(); } @@ -335,6 +343,8 @@ export class LoginViaAuthRequestComponent errorRoute = "/login-initiated"; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([errorRoute]); this.validationService.showError(error); return; @@ -435,14 +445,22 @@ export class LoginViaAuthRequestComponent private async handlePostLoginNavigation(loginResponse: AuthResult) { if (loginResponse.requiresTwoFactor) { if (this.onSuccessfulLoginTwoFactorNavigate != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLoginTwoFactorNavigate(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.twoFactorRoute]); } } else if (loginResponse.forcePasswordReset != ForceSetPasswordReason.None) { if (this.onSuccessfulLoginForceResetNavigate != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLoginForceResetNavigate(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.forcePasswordResetRoute]); } } else { @@ -464,12 +482,18 @@ export class LoginViaAuthRequestComponent } if (this.onSuccessfulLogin != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLogin(); } if (this.onSuccessfulLoginNavigate != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLoginNavigate(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute]); } } diff --git a/libs/angular/src/auth/components/login.component.ts b/libs/angular/src/auth/components/login.component.ts index bc7f373897..5e9d21bee7 100644 --- a/libs/angular/src/auth/components/login.component.ts +++ b/libs/angular/src/auth/components/login.component.ts @@ -161,23 +161,37 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit, return; } else if (response.requiresTwoFactor) { if (this.onSuccessfulLoginTwoFactorNavigate != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLoginTwoFactorNavigate(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.twoFactorRoute]); } } else if (response.forcePasswordReset != ForceSetPasswordReason.None) { if (this.onSuccessfulLoginForceResetNavigate != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLoginForceResetNavigate(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.forcePasswordResetRoute]); } } else { if (this.onSuccessfulLogin != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLogin(); } if (this.onSuccessfulLoginNavigate != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLoginNavigate(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute]); } } @@ -206,6 +220,8 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit, } this.setFormValues(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/login-with-device"]); } diff --git a/libs/angular/src/auth/components/register.component.ts b/libs/angular/src/auth/components/register.component.ts index f7c0a76509..28e64a075b 100644 --- a/libs/angular/src/auth/components/register.component.ts +++ b/libs/angular/src/auth/components/register.component.ts @@ -101,6 +101,8 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn } async ngOnInit() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.setupCaptcha(); } @@ -141,6 +143,8 @@ export class RegisterComponent extends CaptchaProtectedComponent implements OnIn null, this.i18nService.t("newAccountCreated"), ); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute], { queryParams: { email: email } }); } } catch (e) { diff --git a/libs/angular/src/auth/components/remove-password.component.ts b/libs/angular/src/auth/components/remove-password.component.ts index 37702d7577..9a65728fa9 100644 --- a/libs/angular/src/auth/components/remove-password.component.ts +++ b/libs/angular/src/auth/components/remove-password.component.ts @@ -50,6 +50,8 @@ export class RemovePasswordComponent implements OnInit { this.i18nService.t("removedMasterPassword"), ); await this.keyConnectorService.removeConvertAccountRequired(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([""]); } catch (e) { this.platformUtilsService.showToast("error", this.i18nService.t("errorOccurred"), e.message); @@ -73,6 +75,8 @@ export class RemovePasswordComponent implements OnInit { await this.actionPromise; this.platformUtilsService.showToast("success", null, this.i18nService.t("leftOrganization")); await this.keyConnectorService.removeConvertAccountRequired(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([""]); } catch (e) { this.platformUtilsService.showToast("error", this.i18nService.t("errorOccurred"), e); diff --git a/libs/angular/src/auth/components/set-password.component.ts b/libs/angular/src/auth/components/set-password.component.ts index fe8840f387..7027cfe876 100644 --- a/libs/angular/src/auth/components/set-password.component.ts +++ b/libs/angular/src/auth/components/set-password.component.ts @@ -78,6 +78,8 @@ export class SetPasswordComponent extends BaseChangePasswordComponent { } async ngOnInit() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises super.ngOnInit(); await this.syncService.fullSync(true); @@ -197,8 +199,12 @@ export class SetPasswordComponent extends BaseChangePasswordComponent { await this.formPromise; if (this.onSuccessfulChangePassword != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulChangePassword(); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.successRoute]); } } catch { diff --git a/libs/angular/src/auth/components/sso.component.ts b/libs/angular/src/auth/components/sso.component.ts index 49047144ff..53e143955c 100644 --- a/libs/angular/src/auth/components/sso.component.ts +++ b/libs/angular/src/auth/components/sso.component.ts @@ -283,9 +283,13 @@ export class SsoComponent { if (this.onSuccessfulLoginTde != null) { // Don't await b/c causes hang on desktop & browser + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLoginTde(); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.navigateViaCallbackOrRoute( this.onSuccessfulLoginTdeNavigate, // Navigate to TDE page (if user was on trusted device and TDE has decrypted @@ -321,6 +325,8 @@ export class SsoComponent { private async handleSuccessfulLogin() { if (this.onSuccessfulLogin != null) { // Don't await b/c causes hang on desktop & browser + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLogin(); } diff --git a/libs/angular/src/auth/components/two-factor.component.ts b/libs/angular/src/auth/components/two-factor.component.ts index 38c1618fc8..8981d5a5d8 100644 --- a/libs/angular/src/auth/components/two-factor.component.ts +++ b/libs/angular/src/auth/components/two-factor.component.ts @@ -79,6 +79,8 @@ export class TwoFactorComponent extends CaptchaProtectedComponent implements OnI async ngOnInit() { if (!this.authing || this.twoFactorService.getProviders() == null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.loginRoute]); return; } @@ -103,6 +105,8 @@ export class TwoFactorComponent extends CaptchaProtectedComponent implements OnI this.i18nService, (token: string) => { this.token = token; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.submit(); }, (error: string) => { @@ -299,9 +303,13 @@ export class TwoFactorComponent extends CaptchaProtectedComponent implements OnI if (this.onSuccessfulLoginTde != null) { // Note: awaiting this will currently cause a hang on desktop & browser as they will wait for a full sync to complete // before navigating to the success route. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLoginTde(); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.navigateViaCallbackOrRoute( this.onSuccessfulLoginTdeNavigate, // Navigate to TDE page (if user was on trusted device and TDE has decrypted @@ -338,6 +346,8 @@ export class TwoFactorComponent extends CaptchaProtectedComponent implements OnI } private async handleForcePasswordReset(orgIdentifier: string) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate([this.forcePasswordResetRoute], { queryParams: { identifier: orgIdentifier, @@ -349,6 +359,8 @@ export class TwoFactorComponent extends CaptchaProtectedComponent implements OnI if (this.onSuccessfulLogin != null) { // Note: awaiting this will currently cause a hang on desktop & browser as they will wait for a full sync to complete // before navigating to the success route. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulLogin(); } await this.navigateViaCallbackOrRoute(this.onSuccessfulLoginNavigate, [this.successRoute]); diff --git a/libs/angular/src/auth/components/update-password.component.ts b/libs/angular/src/auth/components/update-password.component.ts index d0946b7d1c..2ffffb6c5d 100644 --- a/libs/angular/src/auth/components/update-password.component.ts +++ b/libs/angular/src/auth/components/update-password.component.ts @@ -64,6 +64,8 @@ export class UpdatePasswordComponent extends BaseChangePasswordComponent { async cancel() { await this.stateService.setOrganizationInvitation(null); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/vault"]); } @@ -109,6 +111,8 @@ export class UpdatePasswordComponent extends BaseChangePasswordComponent { request.key = newUserKey[1].encryptedString; // Update user's password + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.apiService.postPassword(request); this.platformUtilsService.showToast( @@ -118,6 +122,8 @@ export class UpdatePasswordComponent extends BaseChangePasswordComponent { ); if (this.onSuccessfulChangePassword != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulChangePassword(); } else { this.messagingService.send("logout"); diff --git a/libs/angular/src/auth/components/update-temp-password.component.ts b/libs/angular/src/auth/components/update-temp-password.component.ts index ff2e852479..0b4541fe52 100644 --- a/libs/angular/src/auth/components/update-temp-password.component.ts +++ b/libs/angular/src/auth/components/update-temp-password.component.ts @@ -76,6 +76,8 @@ export class UpdateTempPasswordComponent extends BaseChangePasswordComponent { // If we somehow end up here without a reason, go back to the home page if (this.reason == ForceSetPasswordReason.None) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.router.navigate(["/"]); return; } @@ -164,6 +166,8 @@ export class UpdateTempPasswordComponent extends BaseChangePasswordComponent { await this.stateService.setForceSetPasswordReason(ForceSetPasswordReason.None); if (this.onSuccessfulChangePassword != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulChangePassword(); } else { this.messagingService.send("logout"); diff --git a/libs/angular/src/components/modal/dynamic-modal.component.ts b/libs/angular/src/components/modal/dynamic-modal.component.ts index 8131572da9..7674662951 100644 --- a/libs/angular/src/components/modal/dynamic-modal.component.ts +++ b/libs/angular/src/components/modal/dynamic-modal.component.ts @@ -47,6 +47,8 @@ export class DynamicModalComponent implements AfterViewInit, OnDestroy { this.el.nativeElement.querySelector(".modal-dialog"), ); if (this.el.nativeElement.querySelector("[appAutoFocus]") == null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.focusTrap.focusFirstTabbableElementWhenReady(); } } diff --git a/libs/angular/src/platform/services/theming/theming.service.ts b/libs/angular/src/platform/services/theming/theming.service.ts index dd588df7e1..6ee85e9ad7 100644 --- a/libs/angular/src/platform/services/theming/theming.service.ts +++ b/libs/angular/src/platform/services/theming/theming.service.ts @@ -21,6 +21,8 @@ export class ThemingService implements AbstractThemingService { @Inject(WINDOW) private window: Window, @Inject(DOCUMENT) private document: Document, ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.monitorThemeChanges(); } diff --git a/libs/angular/src/tools/export/components/export-scope-callout.component.ts b/libs/angular/src/tools/export/components/export-scope-callout.component.ts index 1653f8013b..48651d822a 100644 --- a/libs/angular/src/tools/export/components/export-scope-callout.component.ts +++ b/libs/angular/src/tools/export/components/export-scope-callout.component.ts @@ -23,6 +23,8 @@ export class ExportScopeCalloutComponent implements OnInit { @Input() set organizationId(value: string) { this._organizationId = value; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.getScopeMessage(this._organizationId); } diff --git a/libs/angular/src/tools/export/components/export.component.ts b/libs/angular/src/tools/export/components/export.component.ts index bd36ae3039..987b0a8433 100644 --- a/libs/angular/src/tools/export/components/export.component.ts +++ b/libs/angular/src/tools/export/components/export.component.ts @@ -163,6 +163,8 @@ export class ExportComponent implements OnInit, OnDestroy { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.doExport(); } diff --git a/libs/angular/src/tools/generator/components/generator.component.ts b/libs/angular/src/tools/generator/components/generator.component.ts index 35ec0b2c5a..d1c82a37b3 100644 --- a/libs/angular/src/tools/generator/components/generator.component.ts +++ b/libs/angular/src/tools/generator/components/generator.component.ts @@ -90,6 +90,8 @@ export class GeneratorComponent implements OnInit { ]; this.subaddressOptions = [{ name: i18nService.t("random"), value: "random" }]; this.catchallOptions = [{ name: i18nService.t("random"), value: "random" }]; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.initForwardOptions(); } @@ -152,6 +154,8 @@ export class GeneratorComponent implements OnInit { } async sliderChanged() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.savePasswordOptions(false); await this.passwordGenerationService.addHistory(this.password); } diff --git a/libs/angular/src/tools/send/send.component.ts b/libs/angular/src/tools/send/send.component.ts index 6c894fc167..553f0e6f89 100644 --- a/libs/angular/src/tools/send/send.component.ts +++ b/libs/angular/src/tools/send/send.component.ts @@ -149,6 +149,8 @@ export class SendComponent implements OnInit, OnDestroy { this.actionPromise = this.sendApiService.removePassword(s.id); await this.actionPromise; if (this.onSuccessfulRemovePassword != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulRemovePassword(); } else { // Default actions @@ -181,6 +183,8 @@ export class SendComponent implements OnInit, OnDestroy { await this.actionPromise; if (this.onSuccessfulDelete != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.onSuccessfulDelete(); } else { // Default actions @@ -206,18 +210,24 @@ export class SendComponent implements OnInit, OnDestroy { } searchTextChanged() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.search(200); } selectAll() { this.clearSelections(); this.selectedAll = true; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.applyFilter(null); } selectType(type: SendType) { this.clearSelections(); this.selectedType = type; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.applyFilter((s) => s.type === type); } diff --git a/libs/angular/src/vault/components/add-edit-custom-fields.component.ts b/libs/angular/src/vault/components/add-edit-custom-fields.component.ts index 58119557a2..5335274187 100644 --- a/libs/angular/src/vault/components/add-edit-custom-fields.component.ts +++ b/libs/angular/src/vault/components/add-edit-custom-fields.component.ts @@ -76,6 +76,8 @@ export class AddEditCustomFieldsComponent implements OnChanges { const f = field as any; f.showValue = !f.showValue; if (this.editMode && f.showValue) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledHiddenFieldVisible, this.cipher.id, diff --git a/libs/angular/src/vault/components/add-edit.component.ts b/libs/angular/src/vault/components/add-edit.component.ts index c5ac7a2acd..e2b73a1ccb 100644 --- a/libs/angular/src/vault/components/add-edit.component.ts +++ b/libs/angular/src/vault/components/add-edit.component.ts @@ -292,6 +292,8 @@ export class AddEditComponent implements OnInit, OnDestroy { this.folders$ = this.folderService.folderViews$; if (this.editMode && this.previousCipherId !== this.cipherId) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientViewed, this.cipherId); } this.previousCipherId = this.cipherId; @@ -518,6 +520,8 @@ export class AddEditComponent implements OnInit, OnDestroy { if (this.editMode && this.showPassword) { document.getElementById("loginPassword")?.focus(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledPasswordVisible, this.cipherId, @@ -531,6 +535,8 @@ export class AddEditComponent implements OnInit, OnDestroy { if (this.editMode && this.showTotpSeed) { document.getElementById("loginTotp")?.focus(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledTOTPSeedVisible, this.cipherId, @@ -541,6 +547,8 @@ export class AddEditComponent implements OnInit, OnDestroy { async toggleCardNumber() { this.showCardNumber = !this.showCardNumber; if (this.showCardNumber) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledCardNumberVisible, this.cipherId, @@ -552,6 +560,8 @@ export class AddEditComponent implements OnInit, OnDestroy { this.showCardCode = !this.showCardCode; document.getElementById("cardCode").focus(); if (this.editMode && this.showCardCode) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledCardCodeVisible, this.cipherId, @@ -695,10 +705,16 @@ export class AddEditComponent implements OnInit, OnDestroy { ); if (typeI18nKey === "password") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, this.cipherId); } else if (typeI18nKey === "securityCode") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedCardCode, this.cipherId); } else if (aType === "H_Field") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedHiddenField, this.cipherId); } diff --git a/libs/angular/src/vault/components/view-custom-fields.component.ts b/libs/angular/src/vault/components/view-custom-fields.component.ts index 637b71320d..0250c44c25 100644 --- a/libs/angular/src/vault/components/view-custom-fields.component.ts +++ b/libs/angular/src/vault/components/view-custom-fields.component.ts @@ -25,6 +25,8 @@ export class ViewCustomFieldsComponent { f.showValue = !f.showValue; f.showCount = false; if (f.showValue) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledHiddenFieldVisible, this.cipher.id, diff --git a/libs/angular/src/vault/components/view.component.ts b/libs/angular/src/vault/components/view.component.ts index 57508bcc16..365041010a 100644 --- a/libs/angular/src/vault/components/view.component.ts +++ b/libs/angular/src/vault/components/view.component.ts @@ -103,6 +103,8 @@ export class ViewComponent implements OnDestroy, OnInit { ngOnInit() { this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "syncCompleted": @@ -153,6 +155,8 @@ export class ViewComponent implements OnDestroy, OnInit { } if (this.previousCipherId !== this.cipherId) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientViewed, this.cipherId); } this.previousCipherId = this.cipherId; @@ -253,6 +257,8 @@ export class ViewComponent implements OnDestroy, OnInit { this.showPassword = !this.showPassword; this.showPasswordCount = false; if (this.showPassword) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledPasswordVisible, this.cipherId, @@ -275,6 +281,8 @@ export class ViewComponent implements OnDestroy, OnInit { this.showCardNumber = !this.showCardNumber; if (this.showCardNumber) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledCardNumberVisible, this.cipherId, @@ -289,6 +297,8 @@ export class ViewComponent implements OnDestroy, OnInit { this.showCardCode = !this.showCardCode; if (this.showCardCode) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect( EventType.Cipher_ClientToggledCardCodeVisible, this.cipherId, @@ -325,6 +335,8 @@ export class ViewComponent implements OnDestroy, OnInit { } if (cipherId) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.cipherService.updateLastLaunchedDate(cipherId); } @@ -352,10 +364,16 @@ export class ViewComponent implements OnDestroy, OnInit { ); if (typeI18nKey === "password") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedPassword, this.cipherId); } else if (typeI18nKey === "securityCode") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedCardCode, this.cipherId); } else if (aType === "H_Field") { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.eventCollectionService.collect(EventType.Cipher_ClientCopiedHiddenField, this.cipherId); } diff --git a/libs/auth/src/angular/user-verification/user-verification-form-input.component.ts b/libs/auth/src/angular/user-verification/user-verification-form-input.component.ts index cb4f813f8d..4f216a76e8 100644 --- a/libs/auth/src/angular/user-verification/user-verification-form-input.component.ts +++ b/libs/auth/src/angular/user-verification/user-verification-form-input.component.ts @@ -189,6 +189,8 @@ export class UserVerificationFormInputComponent implements ControlValueAccessor, } else { if (this.userVerificationOptions.server.otp) { // New design requires requesting on load to prevent user from having to click send code + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.requestOTP(); } } @@ -220,6 +222,8 @@ export class UserVerificationFormInputComponent implements ControlValueAccessor, this.activeClientVerificationOption$ .pipe(takeUntil(this.destroy$)) .subscribe((activeClientVerificationOption: ActiveClientVerificationOption) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.handleActiveClientVerificationOptionChange(activeClientVerificationOption); }); } diff --git a/libs/common/spec/fake-account-service.ts b/libs/common/spec/fake-account-service.ts index f80eb99522..fba91014d7 100644 --- a/libs/common/spec/fake-account-service.ts +++ b/libs/common/spec/fake-account-service.ts @@ -48,22 +48,32 @@ export class FakeAccountService implements AccountService { } async addAccount(userId: UserId, accountData: AccountInfo): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.mock.addAccount(userId, accountData); } async setAccountName(userId: UserId, name: string): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.mock.setAccountName(userId, name); } async setAccountEmail(userId: UserId, email: string): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.mock.setAccountEmail(userId, email); } async setAccountStatus(userId: UserId, status: AuthenticationStatus): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.mock.setAccountStatus(userId, status); } async switchAccount(userId: UserId): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.mock.switchAccount(userId); } } diff --git a/libs/common/spec/fake-storage.service.ts b/libs/common/spec/fake-storage.service.ts index 61bb1b94c0..f4817ff581 100644 --- a/libs/common/spec/fake-storage.service.ts +++ b/libs/common/spec/fake-storage.service.ts @@ -51,21 +51,29 @@ export class FakeStorageService implements AbstractStorageService, ObservableSto } get(key: string, options?: StorageOptions): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.mock.get(key, options); const value = this.store[key] as T; return Promise.resolve(value); } has(key: string, options?: StorageOptions): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.mock.has(key, options); return Promise.resolve(this.store[key] != null); } save(key: string, obj: T, options?: StorageOptions): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.mock.save(key, obj, options); this.store[key] = obj; this.updatesSubject.next({ key: key, updateType: "save" }); return Promise.resolve(); } remove(key: string, options?: StorageOptions): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.mock.remove(key, options); delete this.store[key]; this.updatesSubject.next({ key: key, updateType: "remove" }); diff --git a/libs/common/src/admin-console/services/organization-domain/org-domain-api.service.spec.ts b/libs/common/src/admin-console/services/organization-domain/org-domain-api.service.spec.ts index ec9b3dd80a..1b9234b2fc 100644 --- a/libs/common/src/admin-console/services/organization-domain/org-domain-api.service.spec.ts +++ b/libs/common/src/admin-console/services/organization-domain/org-domain-api.service.spec.ts @@ -105,16 +105,22 @@ describe("Org Domain API Service", () => { it("getAllByOrgId retrieves all org domains and calls orgDomainSvc replace", () => { apiService.send.mockResolvedValue(mockedGetAllByOrgIdResponse); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(0); const orgDomainSvcReplaceSpy = jest.spyOn(orgDomainService, "replace"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises orgDomainApiService .getAllByOrgId("fakeOrgId") .then((orgDomainResponses: Array) => { expect(orgDomainResponses).toHaveLength(3); expect(orgDomainSvcReplaceSpy).toHaveBeenCalled(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(3); }); }); @@ -122,16 +128,22 @@ describe("Org Domain API Service", () => { it("getByOrgIdAndOrgDomainId retrieves single org domain and calls orgDomainSvc upsert", () => { apiService.send.mockResolvedValue(mockedOrgDomainServerResponse); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(0); const orgDomainSvcUpsertSpy = jest.spyOn(orgDomainService, "upsert"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises orgDomainApiService .getByOrgIdAndOrgDomainId("fakeOrgId", "fakeDomainId") .then((orgDomain: OrganizationDomainResponse) => { expect(orgDomain.id).toEqual(mockedOrgDomainServerResponse.id); expect(orgDomainSvcUpsertSpy).toHaveBeenCalled(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(1); }); }); @@ -139,16 +151,22 @@ describe("Org Domain API Service", () => { it("post success should call orgDomainSvc upsert", () => { apiService.send.mockResolvedValue(mockedOrgDomainServerResponse); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(0); const orgDomainSvcUpsertSpy = jest.spyOn(orgDomainService, "upsert"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises orgDomainApiService .post("fakeOrgId", mockedOrgDomainResponse) .then((orgDomain: OrganizationDomainResponse) => { expect(orgDomain.id).toEqual(mockedOrgDomainServerResponse.id); expect(orgDomainSvcUpsertSpy).toHaveBeenCalled(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(1); }); }); @@ -156,16 +174,22 @@ describe("Org Domain API Service", () => { it("verify success should call orgDomainSvc upsert", () => { apiService.send.mockResolvedValue(mockedOrgDomainServerResponse); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(0); const orgDomainSvcUpsertSpy = jest.spyOn(orgDomainService, "upsert"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises orgDomainApiService .verify("fakeOrgId", "fakeOrgId") .then((orgDomain: OrganizationDomainResponse) => { expect(orgDomain.id).toEqual(mockedOrgDomainServerResponse.id); expect(orgDomainSvcUpsertSpy).toHaveBeenCalled(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(1); }); }); @@ -173,12 +197,18 @@ describe("Org Domain API Service", () => { it("delete success should call orgDomainSvc delete", () => { apiService.send.mockResolvedValue(true); orgDomainService.upsert([mockedOrgDomainResponse]); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(1); const orgDomainSvcDeleteSpy = jest.spyOn(orgDomainService, "delete"); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises orgDomainApiService.delete("fakeOrgId", "fakeOrgId").then(() => { expect(orgDomainSvcDeleteSpy).toHaveBeenCalled(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(0); }); }); diff --git a/libs/common/src/admin-console/services/organization-domain/org-domain.service.spec.ts b/libs/common/src/admin-console/services/organization-domain/org-domain.service.spec.ts index ca591a4925..6721ea3a80 100644 --- a/libs/common/src/admin-console/services/organization-domain/org-domain.service.spec.ts +++ b/libs/common/src/admin-console/services/organization-domain/org-domain.service.spec.ts @@ -76,6 +76,8 @@ describe("Org Domain Service", () => { it("orgDomains$ public observable exists and instantiates w/ empty array", () => { expect(orgDomainService.orgDomains$).toBeDefined(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toEqual([]); }); @@ -84,10 +86,14 @@ describe("Org Domain Service", () => { orgDomainService.replace(newOrgDomains); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toEqual(newOrgDomains); orgDomainService.clearCache(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toEqual([]); }); @@ -132,10 +138,14 @@ describe("Org Domain Service", () => { verifiedDate: null as any, }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(2); orgDomainService.upsert([newOrgDomain]); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(3); expect(orgDomainService.get(newOrgDomain.id)).toEqual(newOrgDomain); @@ -148,14 +158,20 @@ describe("Org Domain Service", () => { mockedExtraOrgDomainResponse, ]; orgDomainService.replace(orgDomains); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(3); orgDomainService.delete([mockedUnverifiedOrgDomainResponse.id]); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(2); expect(orgDomainService.get(mockedUnverifiedOrgDomainResponse.id)).toEqual(undefined); orgDomainService.delete([mockedVerifiedOrgDomainResponse.id, mockedExtraOrgDomainResponse.id]); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(lastValueFrom(orgDomainService.orgDomains$)).resolves.toHaveLength(0); expect(orgDomainService.get(mockedVerifiedOrgDomainResponse.id)).toEqual(undefined); expect(orgDomainService.get(mockedExtraOrgDomainResponse.id)).toEqual(undefined); diff --git a/libs/common/src/admin-console/services/organization/organization.service.spec.ts b/libs/common/src/admin-console/services/organization/organization.service.spec.ts index 598b24f330..7e9a9b5988 100644 --- a/libs/common/src/admin-console/services/organization/organization.service.spec.ts +++ b/libs/common/src/admin-console/services/organization/organization.service.spec.ts @@ -154,6 +154,8 @@ describe("Organization Service", () => { }); it("does not exist", async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises organizationService.delete("1"); expect(stateService.getOrganizations).toHaveBeenCalledTimes(2); diff --git a/libs/common/src/auth/services/account.service.spec.ts b/libs/common/src/auth/services/account.service.spec.ts index 14ff8724ff..4df1a39d6d 100644 --- a/libs/common/src/auth/services/account.service.spec.ts +++ b/libs/common/src/auth/services/account.service.spec.ts @@ -202,6 +202,8 @@ describe("accountService", () => { }); it("should throw if the account does not exist", () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(sut.switchAccount("unknown" as UserId)).rejects.toThrowError("Account does not exist"); }); }); diff --git a/libs/common/src/auth/services/anonymous-hub.service.ts b/libs/common/src/auth/services/anonymous-hub.service.ts index eb3913f032..594b52806c 100644 --- a/libs/common/src/auth/services/anonymous-hub.service.ts +++ b/libs/common/src/auth/services/anonymous-hub.service.ts @@ -39,12 +39,16 @@ export class AnonymousHubService implements AnonymousHubServiceAbstraction { this.anonHubConnection.start().catch((error) => this.logService.error(error)); this.anonHubConnection.on("AuthRequestResponseRecieved", (data: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ProcessNotification(new NotificationResponse(data)); }); } stopHubConnection() { if (this.anonHubConnection) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.anonHubConnection.stop(); } } diff --git a/libs/common/src/auth/services/key-connector.service.ts b/libs/common/src/auth/services/key-connector.service.ts index 44190da6d3..654caca845 100644 --- a/libs/common/src/auth/services/key-connector.service.ts +++ b/libs/common/src/auth/services/key-connector.service.ts @@ -150,6 +150,8 @@ export class KeyConnectorService implements KeyConnectorServiceAbstraction { private handleKeyConnectorError(e: any) { this.logService.error(e); if (this.logoutCallback != null) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.logoutCallback(false); } throw new Error("Key Connector error"); diff --git a/libs/common/src/platform/services/crypto.service.ts b/libs/common/src/platform/services/crypto.service.ts index 4bee43f175..23f6ba624f 100644 --- a/libs/common/src/platform/services/crypto.service.ts +++ b/libs/common/src/platform/services/crypto.service.ts @@ -181,11 +181,19 @@ export class CryptoService implements CryptoServiceAbstraction { async clearStoredUserKey(keySuffix: KeySuffixOptions, userId?: UserId): Promise { if (keySuffix === KeySuffixOptions.Auto) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setUserKeyAutoUnlock(null, { userId: userId }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.clearDeprecatedKeys(KeySuffixOptions.Auto, userId); } if (keySuffix === KeySuffixOptions.Pin) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setPinKeyEncryptedUserKeyEphemeral(null, { userId: userId }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.clearDeprecatedKeys(KeySuffixOptions.Pin, userId); } } @@ -351,6 +359,8 @@ export class CryptoService implements CryptoServiceAbstraction { orgs: ProfileOrganizationResponse[] = [], providerOrgs: ProfileProviderOrganizationResponse[] = [], ): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.activeUserEncryptedOrgKeysState.update((_) => { const encOrgKeyData: { [orgId: string]: EncryptedOrganizationKeyData } = {}; @@ -411,6 +421,8 @@ export class CryptoService implements CryptoServiceAbstraction { } async setProviderKeys(providers: ProfileProviderResponse[]): Promise { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.activeUserEncryptedProviderKeysState.update((_) => { const encProviderKeys: { [providerId: ProviderId]: EncryptedString } = {}; diff --git a/libs/common/src/platform/state/implementations/default-active-user-state.spec.ts b/libs/common/src/platform/state/implementations/default-active-user-state.spec.ts index d9dddc9fc2..e0e3542269 100644 --- a/libs/common/src/platform/state/implementations/default-active-user-state.spec.ts +++ b/libs/common/src/platform/state/implementations/default-active-user-state.spec.ts @@ -382,6 +382,8 @@ describe("DefaultActiveUserState", () => { await changeActiveUser(undefined); // Act + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises expect(async () => await userState.update(() => null)).rejects.toThrow( "No active user at this time.", ); @@ -619,6 +621,8 @@ describe("DefaultActiveUserState", () => { expect(diskStorageService["updatesSubject"]["observers"]).toHaveLength(1); // Still be listening to storage updates + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises diskStorageService.save(userKey, newData); await awaitAsync(); // storage updates are behind a promise expect(sub2Emissions).toEqual([null, newData]); diff --git a/libs/common/src/platform/state/implementations/default-global-state.spec.ts b/libs/common/src/platform/state/implementations/default-global-state.spec.ts index 7bcac23ffc..f592d35ab5 100644 --- a/libs/common/src/platform/state/implementations/default-global-state.spec.ts +++ b/libs/common/src/platform/state/implementations/default-global-state.spec.ts @@ -340,6 +340,8 @@ describe("DefaultGlobalState", () => { expect(diskStorageService["updatesSubject"]["observers"]).toHaveLength(1); // Still be listening to storage updates + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises diskStorageService.save(globalKey, newData); await awaitAsync(); // storage updates are behind a promise expect(sub2Emissions).toEqual([null, newData]); @@ -362,6 +364,8 @@ describe("DefaultGlobalState", () => { const emissions = trackEmissions(globalState.state$); await awaitAsync(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises diskStorageService.save(globalKey, newData); await awaitAsync(); diff --git a/libs/common/src/platform/state/implementations/default-single-user-state.spec.ts b/libs/common/src/platform/state/implementations/default-single-user-state.spec.ts index 0a8412742d..30b732d271 100644 --- a/libs/common/src/platform/state/implementations/default-single-user-state.spec.ts +++ b/libs/common/src/platform/state/implementations/default-single-user-state.spec.ts @@ -392,6 +392,8 @@ describe("DefaultSingleUserState", () => { expect(diskStorageService["updatesSubject"]["observers"]).toHaveLength(1); // Still be listening to storage updates + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises diskStorageService.save(userKey, newData); await awaitAsync(); // storage updates are behind a promise expect(sub2Emissions).toEqual([null, newData]); @@ -414,6 +416,8 @@ describe("DefaultSingleUserState", () => { const emissions = trackEmissions(userState.state$); await awaitAsync(); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises diskStorageService.save(userKey, newData); await awaitAsync(); diff --git a/libs/common/src/platform/state/implementations/util.spec.ts b/libs/common/src/platform/state/implementations/util.spec.ts index 15737b0c8c..266e517702 100644 --- a/libs/common/src/platform/state/implementations/util.spec.ts +++ b/libs/common/src/platform/state/implementations/util.spec.ts @@ -19,6 +19,8 @@ describe("getStoredValue", () => { }); it("should deserialize", async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises storageService.save(key, value); const result = await getStoredValue(key, storageService, deserializer); @@ -32,6 +34,8 @@ describe("getStoredValue", () => { }); it("should not deserialize", async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises storageService.save(key, value); const result = await getStoredValue(key, storageService, deserializer); @@ -40,6 +44,8 @@ describe("getStoredValue", () => { }); it("should convert undefined to null", async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises storageService.save(key, undefined); const result = await getStoredValue(key, storageService, deserializer); diff --git a/libs/common/src/services/account/avatar-update.service.ts b/libs/common/src/services/account/avatar-update.service.ts index c5076d737c..d7dee793bd 100644 --- a/libs/common/src/services/account/avatar-update.service.ts +++ b/libs/common/src/services/account/avatar-update.service.ts @@ -14,6 +14,8 @@ export class AvatarUpdateService implements AvatarUpdateServiceAbstraction { private apiService: ApiService, private stateService: StateService, ) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.loadColorFromState(); } @@ -26,6 +28,8 @@ export class AvatarUpdateService implements AvatarUpdateServiceAbstraction { pushUpdate(color: string | null): Promise { return this.apiService.putAvatar(new UpdateAvatarRequest(color)).then((response) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.stateService.setAvatarColor(response.avatarColor); this._avatarUpdate$.next(response.avatarColor); }); diff --git a/libs/common/src/services/event/event-upload.service.ts b/libs/common/src/services/event/event-upload.service.ts index d6cfc1f3e6..75c7a7a193 100644 --- a/libs/common/src/services/event/event-upload.service.ts +++ b/libs/common/src/services/event/event-upload.service.ts @@ -19,6 +19,8 @@ export class EventUploadService implements EventUploadServiceAbstraction { this.inited = true; if (checkOnInterval) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.uploadEvents(); setInterval(() => this.uploadEvents(), 60 * 1000); // check every 60 seconds } @@ -43,6 +45,8 @@ export class EventUploadService implements EventUploadServiceAbstraction { }); try { await this.apiService.postEventsCollect(request); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.clearEvents(userId); } catch (e) { this.logService.error(e); diff --git a/libs/common/src/services/notifications.service.ts b/libs/common/src/services/notifications.service.ts index ba2a5dafb2..31f8cde5b0 100644 --- a/libs/common/src/services/notifications.service.ts +++ b/libs/common/src/services/notifications.service.ts @@ -43,6 +43,8 @@ export class NotificationsService implements NotificationsServiceAbstraction { return; } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.init(); }); } @@ -84,6 +86,8 @@ export class NotificationsService implements NotificationsServiceAbstraction { }); this.signalrConnection.onclose(() => { this.connected = false; + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.reconnect(true); }); this.inited = true; @@ -172,6 +176,8 @@ export class NotificationsService implements NotificationsServiceAbstraction { break; case NotificationType.LogOut: if (isAuthenticated) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.logoutCallback(true); } break; diff --git a/libs/common/src/services/vault-timeout/vault-timeout.service.ts b/libs/common/src/services/vault-timeout/vault-timeout.service.ts index ac05602fac..584f9713d9 100644 --- a/libs/common/src/services/vault-timeout/vault-timeout.service.ts +++ b/libs/common/src/services/vault-timeout/vault-timeout.service.ts @@ -47,6 +47,8 @@ export class VaultTimeoutService implements VaultTimeoutServiceAbstraction { } startCheck() { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.checkVaultTimeout(); setInterval(() => this.checkVaultTimeout(), 10 * 1000); // check every 10 seconds } diff --git a/libs/common/src/state-migrations/migrate.ts b/libs/common/src/state-migrations/migrate.ts index bbd003def8..8ea1a3c95b 100644 --- a/libs/common/src/state-migrations/migrate.ts +++ b/libs/common/src/state-migrations/migrate.ts @@ -36,6 +36,7 @@ export async function migrate( await storageService.save("stateVersion", CURRENT_VERSION); return; } + await MigrationBuilder.create() .with(MinVersionMigrator) .with(FixPremiumMigrator, 2, 3) diff --git a/libs/common/src/state-migrations/migrations/4-remove-ever-been-unlocked.ts b/libs/common/src/state-migrations/migrations/4-remove-ever-been-unlocked.ts index cfa45958d0..5cb9190337 100644 --- a/libs/common/src/state-migrations/migrations/4-remove-ever-been-unlocked.ts +++ b/libs/common/src/state-migrations/migrations/4-remove-ever-been-unlocked.ts @@ -14,6 +14,8 @@ export class RemoveEverBeenUnlockedMigrator extends Migrator<3, 4> { } } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises Promise.all(accounts.map(({ userId, account }) => removeEverBeenUnlocked(userId, account))); } diff --git a/libs/common/src/state-migrations/migrations/5-add-key-type-to-org-keys.ts b/libs/common/src/state-migrations/migrations/5-add-key-type-to-org-keys.ts index ab1550c52e..2eb11f0698 100644 --- a/libs/common/src/state-migrations/migrations/5-add-key-type-to-org-keys.ts +++ b/libs/common/src/state-migrations/migrations/5-add-key-type-to-org-keys.ts @@ -31,6 +31,8 @@ export class AddKeyTypeToOrgKeysMigrator extends Migrator<4, 5> { await helper.set(userId, account); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises Promise.all(accounts.map(({ userId, account }) => updateOrgKey(userId, account))); } @@ -53,6 +55,8 @@ export class AddKeyTypeToOrgKeysMigrator extends Migrator<4, 5> { await helper.set(userId, account); } + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises Promise.all(accounts.map(async ({ userId, account }) => updateOrgKey(userId, account))); } diff --git a/libs/common/src/tools/send/services/send.service.spec.ts b/libs/common/src/tools/send/services/send.service.spec.ts index 85c49ae078..a25bfc80f2 100644 --- a/libs/common/src/tools/send/services/send.service.spec.ts +++ b/libs/common/src/tools/send/services/send.service.spec.ts @@ -110,6 +110,8 @@ describe("SendService", () => { }); it("returns null if there are no sends", async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sendService.replace(null); const newUserKey = new SymmetricCryptoKey(new Uint8Array(32)) as UserKey; @@ -157,6 +159,8 @@ describe("SendService", () => { }); it("does not exist", async () => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises sendService.delete("1"); expect(stateService.getEncryptedSends).toHaveBeenCalledTimes(2); diff --git a/libs/common/src/vault/services/cipher.service.spec.ts b/libs/common/src/vault/services/cipher.service.spec.ts index b347c79fda..1d018110f7 100644 --- a/libs/common/src/vault/services/cipher.service.spec.ts +++ b/libs/common/src/vault/services/cipher.service.spec.ts @@ -160,6 +160,8 @@ describe("Cipher Service", () => { const spy = jest .spyOn(apiService, "postCipherAdmin") .mockImplementation(() => Promise.resolve(cipherObj)); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises cipherService.createWithServer(cipherObj, true); const expectedObj = new CipherCreateRequest(cipherObj); @@ -171,6 +173,8 @@ describe("Cipher Service", () => { const spy = jest .spyOn(apiService, "postCipher") .mockImplementation(() => Promise.resolve(cipherObj)); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises cipherService.createWithServer(cipherObj, true); const expectedObj = new CipherRequest(cipherObj); @@ -183,6 +187,8 @@ describe("Cipher Service", () => { const spy = jest .spyOn(apiService, "postCipherCreate") .mockImplementation(() => Promise.resolve(cipherObj)); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises cipherService.createWithServer(cipherObj); const expectedObj = new CipherCreateRequest(cipherObj); @@ -194,6 +200,8 @@ describe("Cipher Service", () => { const spy = jest .spyOn(apiService, "postCipher") .mockImplementation(() => Promise.resolve(cipherObj)); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises cipherService.createWithServer(cipherObj); const expectedObj = new CipherRequest(cipherObj); @@ -207,6 +215,8 @@ describe("Cipher Service", () => { const spy = jest .spyOn(apiService, "putCipherAdmin") .mockImplementation(() => Promise.resolve(cipherObj)); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises cipherService.updateWithServer(cipherObj, true, true); const expectedObj = new CipherRequest(cipherObj); @@ -219,6 +229,8 @@ describe("Cipher Service", () => { const spy = jest .spyOn(apiService, "putCipher") .mockImplementation(() => Promise.resolve(cipherObj)); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises cipherService.updateWithServer(cipherObj); const expectedObj = new CipherRequest(cipherObj); @@ -231,6 +243,8 @@ describe("Cipher Service", () => { const spy = jest .spyOn(apiService, "putPartialCipher") .mockImplementation(() => Promise.resolve(cipherObj)); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises cipherService.updateWithServer(cipherObj); const expectedObj = new CipherPartialRequest(cipherObj); diff --git a/libs/common/src/vault/services/folder/folder.service.ts b/libs/common/src/vault/services/folder/folder.service.ts index 3ee06d2bdc..60463aed6b 100644 --- a/libs/common/src/vault/services/folder/folder.service.ts +++ b/libs/common/src/vault/services/folder/folder.service.ts @@ -163,6 +163,8 @@ export class FolderService implements InternalFolderServiceAbstraction { } } if (updates.length > 0) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.cipherService.upsert(updates); } } diff --git a/libs/common/src/vault/services/sync/sync.service.ts b/libs/common/src/vault/services/sync/sync.service.ts index 6187d234e5..13ec0a9c3c 100644 --- a/libs/common/src/vault/services/sync/sync.service.ts +++ b/libs/common/src/vault/services/sync/sync.service.ts @@ -331,6 +331,8 @@ export class SyncService implements SyncServiceAbstraction { await this.keyConnectorService.setConvertAccountRequired(true); this.messagingService.send("convertAccountToKeyConnector"); } else { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.keyConnectorService.removeConvertAccountRequired(); } } diff --git a/libs/components/src/button/button.component.spec.ts b/libs/components/src/button/button.component.spec.ts index bf958da54e..a0b9c1e7a5 100644 --- a/libs/components/src/button/button.component.spec.ts +++ b/libs/components/src/button/button.component.spec.ts @@ -17,6 +17,8 @@ describe("Button", () => { declarations: [TestApp], }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.compileComponents(); fixture = TestBed.createComponent(TestApp); testAppComponent = fixture.debugElement.componentInstance; diff --git a/libs/components/src/dialog/directives/dialog-title-container.directive.ts b/libs/components/src/dialog/directives/dialog-title-container.directive.ts index 96664a5f94..3aa699d39e 100644 --- a/libs/components/src/dialog/directives/dialog-title-container.directive.ts +++ b/libs/components/src/dialog/directives/dialog-title-container.directive.ts @@ -18,6 +18,8 @@ export class DialogTitleContainerDirective implements OnInit { // Based on angular/components, licensed under MIT // https://github.com/angular/components/blob/14.2.0/src/material/dialog/dialog-content-directives.ts#L121-L128 if (this.dialogRef) { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises Promise.resolve().then(() => { const container = this.dialogRef.containerInstance as CdkDialogContainer; diff --git a/libs/components/src/menu/menu.component.spec.ts b/libs/components/src/menu/menu.component.spec.ts index 29f3a86069..d931991f40 100644 --- a/libs/components/src/menu/menu.component.spec.ts +++ b/libs/components/src/menu/menu.component.spec.ts @@ -22,6 +22,8 @@ describe("Menu", () => { declarations: [TestApp], }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.compileComponents(); fixture = TestBed.createComponent(TestApp); diff --git a/libs/components/src/radio-button/radio-button.component.spec.ts b/libs/components/src/radio-button/radio-button.component.spec.ts index 3b67b3e3bd..c7344f1bd3 100644 --- a/libs/components/src/radio-button/radio-button.component.spec.ts +++ b/libs/components/src/radio-button/radio-button.component.spec.ts @@ -27,6 +27,8 @@ describe("RadioButton", () => { ], }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.compileComponents(); fixture = TestBed.createComponent(TestApp); fixture.detectChanges(); diff --git a/libs/components/src/radio-button/radio-group.component.spec.ts b/libs/components/src/radio-button/radio-group.component.spec.ts index fd0e612a5c..d2b9e6cbf2 100644 --- a/libs/components/src/radio-button/radio-group.component.spec.ts +++ b/libs/components/src/radio-button/radio-group.component.spec.ts @@ -23,6 +23,8 @@ describe("RadioGroupComponent", () => { providers: [{ provide: I18nService, useValue: new I18nMockService({}) }], }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.compileComponents(); fixture = TestBed.createComponent(TestApp); fixture.detectChanges(); diff --git a/libs/components/src/tabs/tab-group/tab-group.component.ts b/libs/components/src/tabs/tab-group/tab-group.component.ts index 76859976dc..59154d18ca 100644 --- a/libs/components/src/tabs/tab-group/tab-group.component.ts +++ b/libs/components/src/tabs/tab-group/tab-group.component.ts @@ -106,6 +106,8 @@ export class TabGroupComponent // These values need to be updated after change detection as // the checked content may have references to them. + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises Promise.resolve().then(() => { this.tabs.forEach((tab, index) => (tab.isActive = index === indexToSelect)); diff --git a/libs/components/src/toggle-group/toggle-group.component.spec.ts b/libs/components/src/toggle-group/toggle-group.component.spec.ts index 3bce3472e8..0fe863fcb9 100644 --- a/libs/components/src/toggle-group/toggle-group.component.spec.ts +++ b/libs/components/src/toggle-group/toggle-group.component.spec.ts @@ -17,6 +17,8 @@ describe("Button", () => { declarations: [TestApp], }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.compileComponents(); fixture = TestBed.createComponent(TestApp); testAppComponent = fixture.debugElement.componentInstance; diff --git a/libs/components/src/toggle-group/toggle.component.spec.ts b/libs/components/src/toggle-group/toggle.component.spec.ts index 37c2e2ac10..73809a97f7 100644 --- a/libs/components/src/toggle-group/toggle.component.spec.ts +++ b/libs/components/src/toggle-group/toggle.component.spec.ts @@ -20,6 +20,8 @@ describe("Button", () => { providers: [{ provide: ToggleGroupComponent, useValue: mockGroupComponent }], }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises TestBed.compileComponents(); fixture = TestBed.createComponent(TestApp); testAppComponent = fixture.debugElement.componentInstance; diff --git a/libs/importer/src/components/import.component.ts b/libs/importer/src/components/import.component.ts index ceb21fd516..796f02c776 100644 --- a/libs/importer/src/components/import.component.ts +++ b/libs/importer/src/components/import.component.ts @@ -367,6 +367,8 @@ export class ImportComponent implements OnInit, OnDestroy { data: result, }); + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.syncService.fullSync(true); this.onSuccessfulImport.emit(this._organizationId); } catch (e) { diff --git a/libs/importer/src/components/lastpass/lastpass-direct-import.service.ts b/libs/importer/src/components/lastpass/lastpass-direct-import.service.ts index a2dd5383a9..4b002061e0 100644 --- a/libs/importer/src/components/lastpass/lastpass-direct-import.service.ts +++ b/libs/importer/src/components/lastpass/lastpass-direct-import.service.ts @@ -48,6 +48,8 @@ export class LastPassDirectImportService { /** TODO: remove this in favor of dedicated service */ this.broadcasterService.subscribe("LastPassDirectImportService", (message: any) => { + // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling. + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.ngZone.run(async () => { switch (message.command) { case "importCallbackLastPass":