mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-21 21:11:35 +01:00
[PM-11290] Enable SDK (#11378)
Follow up PR to #10974, flips the compile time flags to enabled and includes some debug logic to detect if users encounter issues with the WASM bundle in preparation for active consumption of the SDK.
This commit is contained in:
parent
c88c5bf1ef
commit
9ea9c3a932
@ -3,6 +3,6 @@
|
|||||||
"flags": {
|
"flags": {
|
||||||
"showPasswordless": true,
|
"showPasswordless": true,
|
||||||
"accountSwitching": false,
|
"accountSwitching": false,
|
||||||
"sdk": false
|
"sdk": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -732,6 +732,7 @@ export default class MainBackground {
|
|||||||
sdkClientFactory,
|
sdkClientFactory,
|
||||||
this.environmentService,
|
this.environmentService,
|
||||||
this.platformUtilsService,
|
this.platformUtilsService,
|
||||||
|
this.apiService,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.passwordStrengthService = new PasswordStrengthService();
|
this.passwordStrengthService = new PasswordStrengthService();
|
||||||
@ -1330,6 +1331,20 @@ export default class MainBackground {
|
|||||||
|
|
||||||
await this.initOverlayAndTabsBackground();
|
await this.initOverlayAndTabsBackground();
|
||||||
|
|
||||||
|
if (flagEnabled("sdk")) {
|
||||||
|
// Warn if the SDK for some reason can't be initialized
|
||||||
|
let supported = false;
|
||||||
|
try {
|
||||||
|
supported = await firstValueFrom(this.sdkService.supported$);
|
||||||
|
} catch (e) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!supported) {
|
||||||
|
this.sdkService.failedToInitialize().catch(this.logService.error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return new Promise<void>((resolve) => {
|
return new Promise<void>((resolve) => {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
await this.refreshBadge();
|
await this.refreshBadge();
|
||||||
|
@ -28,6 +28,11 @@ if (supported) {
|
|||||||
import("./fallback");
|
import("./fallback");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SDK client factory with a js fallback for when WASM is not supported.
|
||||||
|
*
|
||||||
|
* Works both in popup and service worker.
|
||||||
|
*/
|
||||||
export class BrowserSdkClientFactory implements SdkClientFactory {
|
export class BrowserSdkClientFactory implements SdkClientFactory {
|
||||||
async createSdkClient(
|
async createSdkClient(
|
||||||
...args: ConstructorParameters<typeof BitwardenClient>
|
...args: ConstructorParameters<typeof BitwardenClient>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, inject } from "@angular/core";
|
import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, inject } from "@angular/core";
|
||||||
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||||
import { NavigationEnd, Router, RouterOutlet } from "@angular/router";
|
import { NavigationEnd, Router, RouterOutlet } from "@angular/router";
|
||||||
import { Subject, takeUntil, firstValueFrom, concatMap, filter, tap } from "rxjs";
|
import { Subject, takeUntil, firstValueFrom, concatMap, filter, tap, catchError, of } from "rxjs";
|
||||||
|
|
||||||
import { LogoutReason } from "@bitwarden/auth/common";
|
import { LogoutReason } from "@bitwarden/auth/common";
|
||||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
@ -8,7 +9,9 @@ import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
|||||||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
|
||||||
import { AnimationControlService } from "@bitwarden/common/platform/abstractions/animation-control.service";
|
import { AnimationControlService } from "@bitwarden/common/platform/abstractions/animation-control.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
|
import { SdkService } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { MessageListener } from "@bitwarden/common/platform/messaging";
|
import { MessageListener } from "@bitwarden/common/platform/messaging";
|
||||||
import { UserId } from "@bitwarden/common/types/guid";
|
import { UserId } from "@bitwarden/common/types/guid";
|
||||||
@ -20,6 +23,7 @@ import {
|
|||||||
ToastService,
|
ToastService,
|
||||||
} from "@bitwarden/components";
|
} from "@bitwarden/components";
|
||||||
|
|
||||||
|
import { flagEnabled } from "../platform/flags";
|
||||||
import { PopupViewCacheService } from "../platform/popup/view-cache/popup-view-cache.service";
|
import { PopupViewCacheService } from "../platform/popup/view-cache/popup-view-cache.service";
|
||||||
import { initPopupClosedListener } from "../platform/services/popup-view-cache-background.service";
|
import { initPopupClosedListener } from "../platform/services/popup-view-cache-background.service";
|
||||||
import { BrowserSendStateService } from "../tools/popup/services/browser-send-state.service";
|
import { BrowserSendStateService } from "../tools/popup/services/browser-send-state.service";
|
||||||
@ -62,7 +66,28 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private accountService: AccountService,
|
private accountService: AccountService,
|
||||||
private animationControlService: AnimationControlService,
|
private animationControlService: AnimationControlService,
|
||||||
) {}
|
private logService: LogService,
|
||||||
|
private sdkService: SdkService,
|
||||||
|
) {
|
||||||
|
if (flagEnabled("sdk")) {
|
||||||
|
// Warn if the SDK for some reason can't be initialized
|
||||||
|
this.sdkService.supported$
|
||||||
|
.pipe(
|
||||||
|
takeUntilDestroyed(),
|
||||||
|
catchError(() => {
|
||||||
|
return of(false);
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.subscribe((supported) => {
|
||||||
|
if (!supported) {
|
||||||
|
this.logService.debug("SDK is not supported");
|
||||||
|
this.sdkService.failedToInitialize().catch(this.logService.error);
|
||||||
|
} else {
|
||||||
|
this.logService.debug("SDK is supported");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
initPopupClosedListener();
|
initPopupClosedListener();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"flags": {
|
"flags": {
|
||||||
"sdk": false
|
"sdk": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -535,6 +535,7 @@ export class ServiceContainer {
|
|||||||
sdkClientFactory,
|
sdkClientFactory,
|
||||||
this.environmentService,
|
this.environmentService,
|
||||||
this.platformUtilsService,
|
this.platformUtilsService,
|
||||||
|
this.apiService,
|
||||||
customUserAgent,
|
customUserAgent,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -846,5 +847,19 @@ export class ServiceContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.inited = true;
|
this.inited = true;
|
||||||
|
|
||||||
|
if (flagEnabled("sdk")) {
|
||||||
|
// Warn if the SDK for some reason can't be initialized
|
||||||
|
let supported = false;
|
||||||
|
try {
|
||||||
|
supported = await firstValueFrom(this.sdkService.supported$);
|
||||||
|
} catch (e) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!supported) {
|
||||||
|
this.sdkService.failedToInitialize().catch(this.logService.error);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"flags": {
|
"flags": {
|
||||||
"sdk": false
|
"sdk": true
|
||||||
},
|
},
|
||||||
"devFlags": {}
|
"devFlags": {}
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,9 @@ import {
|
|||||||
ViewChild,
|
ViewChild,
|
||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
import { filter, firstValueFrom, map, Subject, takeUntil, timeout } from "rxjs";
|
import { catchError, filter, firstValueFrom, map, of, Subject, takeUntil, timeout } from "rxjs";
|
||||||
|
|
||||||
import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref";
|
import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref";
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
||||||
@ -21,7 +22,6 @@ import { SearchService } from "@bitwarden/common/abstractions/search.service";
|
|||||||
import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service";
|
import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service";
|
||||||
import { VaultTimeoutService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout.service";
|
import { VaultTimeoutService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout.service";
|
||||||
import { InternalPolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
import { InternalPolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||||
import { ProviderService } from "@bitwarden/common/admin-console/abstractions/provider.service";
|
|
||||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||||
import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service";
|
import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service";
|
||||||
@ -38,6 +38,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
|
|||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
|
import { SdkService } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { SystemService } from "@bitwarden/common/platform/abstractions/system.service";
|
import { SystemService } from "@bitwarden/common/platform/abstractions/system.service";
|
||||||
import { clearCaches } from "@bitwarden/common/platform/misc/sequentialize";
|
import { clearCaches } from "@bitwarden/common/platform/misc/sequentialize";
|
||||||
@ -56,6 +57,7 @@ import { BiometricStateService } from "@bitwarden/key-management";
|
|||||||
import { DeleteAccountComponent } from "../auth/delete-account.component";
|
import { DeleteAccountComponent } from "../auth/delete-account.component";
|
||||||
import { LoginApprovalComponent } from "../auth/login/login-approval.component";
|
import { LoginApprovalComponent } from "../auth/login/login-approval.component";
|
||||||
import { MenuAccount, MenuUpdateRequest } from "../main/menu/menu.updater";
|
import { MenuAccount, MenuUpdateRequest } from "../main/menu/menu.updater";
|
||||||
|
import { flagEnabled } from "../platform/flags";
|
||||||
import { PremiumComponent } from "../vault/app/accounts/premium.component";
|
import { PremiumComponent } from "../vault/app/accounts/premium.component";
|
||||||
import { FolderAddEditComponent } from "../vault/app/vault/folder-add-edit.component";
|
import { FolderAddEditComponent } from "../vault/app/vault/folder-add-edit.component";
|
||||||
|
|
||||||
@ -150,9 +152,28 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
private dialogService: DialogService,
|
private dialogService: DialogService,
|
||||||
private biometricStateService: BiometricStateService,
|
private biometricStateService: BiometricStateService,
|
||||||
private stateEventRunnerService: StateEventRunnerService,
|
private stateEventRunnerService: StateEventRunnerService,
|
||||||
private providerService: ProviderService,
|
|
||||||
private accountService: AccountService,
|
private accountService: AccountService,
|
||||||
) {}
|
private sdkService: SdkService,
|
||||||
|
) {
|
||||||
|
if (flagEnabled("sdk")) {
|
||||||
|
// Warn if the SDK for some reason can't be initialized
|
||||||
|
this.sdkService.supported$
|
||||||
|
.pipe(
|
||||||
|
takeUntilDestroyed(),
|
||||||
|
catchError(() => {
|
||||||
|
return of(false);
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.subscribe((supported) => {
|
||||||
|
if (!supported) {
|
||||||
|
this.logService.debug("SDK is not supported");
|
||||||
|
this.sdkService.failedToInitialize().catch(this.logService.error);
|
||||||
|
} else {
|
||||||
|
this.logService.debug("SDK is supported");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.accountService.activeAccount$.pipe(takeUntil(this.destroy$)).subscribe((account) => {
|
this.accountService.activeAccount$.pipe(takeUntil(this.destroy$)).subscribe((account) => {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"flags": {
|
"flags": {
|
||||||
"showPasswordless": false,
|
"showPasswordless": false,
|
||||||
"sdk": false
|
"sdk": true
|
||||||
},
|
},
|
||||||
"devFlags": {}
|
"devFlags": {}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { DOCUMENT } from "@angular/common";
|
import { DOCUMENT } from "@angular/common";
|
||||||
import { Component, Inject, NgZone, OnDestroy, OnInit } from "@angular/core";
|
import { Component, Inject, NgZone, OnDestroy, OnInit } from "@angular/core";
|
||||||
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||||
import { NavigationEnd, Router } from "@angular/router";
|
import { NavigationEnd, Router } from "@angular/router";
|
||||||
import * as jq from "jquery";
|
import * as jq from "jquery";
|
||||||
import { Subject, filter, firstValueFrom, map, takeUntil, timeout } from "rxjs";
|
import { Subject, filter, firstValueFrom, map, takeUntil, timeout, catchError, of } from "rxjs";
|
||||||
|
|
||||||
import { LogoutReason } from "@bitwarden/auth/common";
|
import { LogoutReason } from "@bitwarden/auth/common";
|
||||||
import { EventUploadService } from "@bitwarden/common/abstractions/event/event-upload.service";
|
import { EventUploadService } from "@bitwarden/common/abstractions/event/event-upload.service";
|
||||||
@ -19,7 +20,9 @@ import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broa
|
|||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||||
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
|
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
|
import { SdkService } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { StateEventRunnerService } from "@bitwarden/common/platform/state";
|
import { StateEventRunnerService } from "@bitwarden/common/platform/state";
|
||||||
import { SyncService } from "@bitwarden/common/platform/sync";
|
import { SyncService } from "@bitwarden/common/platform/sync";
|
||||||
@ -30,6 +33,8 @@ import { DialogService, ToastOptions, ToastService } from "@bitwarden/components
|
|||||||
import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legacy";
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legacy";
|
||||||
import { BiometricStateService } from "@bitwarden/key-management";
|
import { BiometricStateService } from "@bitwarden/key-management";
|
||||||
|
|
||||||
|
import { flagEnabled } from "../utils/flags";
|
||||||
|
|
||||||
import { PolicyListService } from "./admin-console/core/policy-list.service";
|
import { PolicyListService } from "./admin-console/core/policy-list.service";
|
||||||
import {
|
import {
|
||||||
DisableSendPolicy,
|
DisableSendPolicy,
|
||||||
@ -85,7 +90,28 @@ export class AppComponent implements OnDestroy, OnInit {
|
|||||||
private stateEventRunnerService: StateEventRunnerService,
|
private stateEventRunnerService: StateEventRunnerService,
|
||||||
private organizationService: InternalOrganizationServiceAbstraction,
|
private organizationService: InternalOrganizationServiceAbstraction,
|
||||||
private accountService: AccountService,
|
private accountService: AccountService,
|
||||||
) {}
|
private logService: LogService,
|
||||||
|
private sdkService: SdkService,
|
||||||
|
) {
|
||||||
|
if (flagEnabled("sdk")) {
|
||||||
|
// Warn if the SDK for some reason can't be initialized
|
||||||
|
this.sdkService.supported$
|
||||||
|
.pipe(
|
||||||
|
takeUntilDestroyed(),
|
||||||
|
catchError(() => {
|
||||||
|
return of(false);
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.subscribe((supported) => {
|
||||||
|
if (!supported) {
|
||||||
|
this.logService.debug("SDK is not supported");
|
||||||
|
this.sdkService.failedToInitialize().catch(this.logService.error);
|
||||||
|
} else {
|
||||||
|
this.logService.debug("SDK is supported");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.i18nService.locale$.pipe(takeUntil(this.destroy$)).subscribe((locale) => {
|
this.i18nService.locale$.pipe(takeUntil(this.destroy$)).subscribe((locale) => {
|
||||||
|
@ -1330,7 +1330,12 @@ const safeProviders: SafeProvider[] = [
|
|||||||
safeProvider({
|
safeProvider({
|
||||||
provide: SdkService,
|
provide: SdkService,
|
||||||
useClass: DefaultSdkService,
|
useClass: DefaultSdkService,
|
||||||
deps: [SdkClientFactory, EnvironmentService, PlatformUtilsServiceAbstraction],
|
deps: [
|
||||||
|
SdkClientFactory,
|
||||||
|
EnvironmentService,
|
||||||
|
PlatformUtilsServiceAbstraction,
|
||||||
|
ApiServiceAbstraction,
|
||||||
|
],
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -5,4 +5,6 @@ import { BitwardenClient } from "@bitwarden/sdk-internal";
|
|||||||
export abstract class SdkService {
|
export abstract class SdkService {
|
||||||
client$: Observable<BitwardenClient>;
|
client$: Observable<BitwardenClient>;
|
||||||
supported$: Observable<boolean>;
|
supported$: Observable<boolean>;
|
||||||
|
|
||||||
|
abstract failedToInitialize(): Promise<void>;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { concatMap, shareReplay } from "rxjs";
|
import { concatMap, firstValueFrom, shareReplay } from "rxjs";
|
||||||
|
|
||||||
import { LogLevel, DeviceType as SdkDeviceType } from "@bitwarden/sdk-internal";
|
import { LogLevel, DeviceType as SdkDeviceType } from "@bitwarden/sdk-internal";
|
||||||
|
|
||||||
|
import { ApiService } from "../../../abstractions/api.service";
|
||||||
import { DeviceType } from "../../../enums/device-type.enum";
|
import { DeviceType } from "../../../enums/device-type.enum";
|
||||||
import { EnvironmentService } from "../../abstractions/environment.service";
|
import { EnvironmentService } from "../../abstractions/environment.service";
|
||||||
import { PlatformUtilsService } from "../../abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "../../abstractions/platform-utils.service";
|
||||||
@ -33,9 +34,24 @@ export class DefaultSdkService implements SdkService {
|
|||||||
private sdkClientFactory: SdkClientFactory,
|
private sdkClientFactory: SdkClientFactory,
|
||||||
private environmentService: EnvironmentService,
|
private environmentService: EnvironmentService,
|
||||||
private platformUtilsService: PlatformUtilsService,
|
private platformUtilsService: PlatformUtilsService,
|
||||||
|
private apiService: ApiService, // Yes we shouldn't import ApiService, but it's temporary
|
||||||
private userAgent: string = null,
|
private userAgent: string = null,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
async failedToInitialize(): Promise<void> {
|
||||||
|
// Only log on cloud instances
|
||||||
|
if (
|
||||||
|
this.platformUtilsService.isDev() ||
|
||||||
|
!(await firstValueFrom(this.environmentService.environment$)).isCloud
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.apiService.send("POST", "/wasm-debug", null, false, false, null, (headers) => {
|
||||||
|
headers.append("SDK-Version", "1.0.0");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private toDevice(device: DeviceType): SdkDeviceType {
|
private toDevice(device: DeviceType): SdkDeviceType {
|
||||||
switch (device) {
|
switch (device) {
|
||||||
case DeviceType.Android:
|
case DeviceType.Android:
|
||||||
|
Loading…
Reference in New Issue
Block a user