diff --git a/package.json b/package.json index fbc4156ad36..111c881fdcc 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@mediapipe/tasks-vision": "0.10.14", "@wireapp/avs": "9.7.15", "@wireapp/commons": "5.2.8", - "@wireapp/core": "46.0.17", + "@wireapp/core": "46.0.18", "@wireapp/react-ui-kit": "9.18.0", "@wireapp/store-engine-dexie": "2.1.10", "@wireapp/webapp-events": "0.22.0", diff --git a/src/script/main/app.ts b/src/script/main/app.ts index a96db8eb402..2650428b057 100644 --- a/src/script/main/app.ts +++ b/src/script/main/app.ts @@ -372,6 +372,11 @@ export class App { onProgress(2.5); telemetry.timeStep(AppInitTimingsStep.RECEIVED_ACCESS_TOKEN); + const selfUser = await this.repository.user.getSelf([{position: 'App.initiateSelfUser', vendor: 'webapp'}]); + + await initializeDataDog(this.config, selfUser.qualifiedId); + onProgress(5, t('initReceivedSelfUser', selfUser.name())); + try { await this.core.init(clientType); } catch (error) { @@ -384,7 +389,7 @@ export class App { userRepository.addClientToUser(userId, newClient, true); }); - const selfUser = await this.initiateSelfUser(); + await this.initiateSelfUser(selfUser); const localClient = await this.core.getLocalClient(); if (!localClient) { @@ -403,8 +408,6 @@ export class App { }, }); - await initializeDataDog(this.config, selfUser.qualifiedId); - // Setup all event middleware const eventStorageMiddleware = new EventStorageMiddleware(this.service.event, selfUser); const serviceMiddleware = new ServiceMiddleware(conversationRepository, userRepository, selfUser); @@ -423,7 +426,6 @@ export class App { const federationEventProcessor = new FederationEventProcessor(eventRepository, serverTimeHandler, selfUser); eventRepository.setEventProcessors([federationEventProcessor]); - onProgress(5, t('initReceivedSelfUser', selfUser.name())); telemetry.timeStep(AppInitTimingsStep.RECEIVED_SELF_USER); const clientEntity = await this._initiateSelfUserClients(selfUser, clientRepository); callingRepository.initAvs(selfUser, clientEntity.id); @@ -612,20 +614,18 @@ export class App { * Initiate the self user by getting it from the backend. * @returns Resolves with the self user entity */ - private async initiateSelfUser() { - const userEntity = await this.repository.user.getSelf([{position: 'App.initiateSelfUser', vendor: 'webapp'}]); - - if (!userEntity.hasActivatedIdentity()) { - if (!userEntity.isTemporaryGuest()) { + private async initiateSelfUser(selfUser: User) { + if (!selfUser.hasActivatedIdentity()) { + if (!selfUser.isTemporaryGuest()) { throw new Error('User does not have an activated identity'); } } container.resolve(StorageService).init(this.core.storage); - this.repository.client.init(userEntity); - await this.repository.properties.init(userEntity); + this.repository.client.init(selfUser); + await this.repository.properties.init(selfUser); - return userEntity; + return selfUser; } /** diff --git a/yarn.lock b/yarn.lock index cb521f04c49..7155e8476ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4846,9 +4846,9 @@ __metadata: languageName: node linkType: hard -"@wireapp/core@npm:46.0.17": - version: 46.0.17 - resolution: "@wireapp/core@npm:46.0.17" +"@wireapp/core@npm:46.0.18": + version: 46.0.18 + resolution: "@wireapp/core@npm:46.0.18" dependencies: "@wireapp/api-client": "npm:^27.0.10" "@wireapp/commons": "npm:^5.2.8" @@ -4868,7 +4868,7 @@ __metadata: long: "npm:^5.2.0" uuid: "npm:9.0.1" zod: "npm:3.23.8" - checksum: 10/56aa7cd0afceb860475733935a3a3614cbd2a38cf2daffcf53d5a9f9b9dec875c49a7d3c7cb965c78df7be31ae33fbc41fff4eccd1096e2bdb136962af9289a7 + checksum: 10/5bd51eeb83f0a82583ff19d9b2781985f05dd77815702fac0ae5953cfac1ec1eb6bd514aab57af7f8913b36192f5f5f22f7b1007cd646a22d06f5d19a7ab5551 languageName: node linkType: hard @@ -17500,7 +17500,7 @@ __metadata: "@wireapp/avs": "npm:9.7.15" "@wireapp/commons": "npm:5.2.8" "@wireapp/copy-config": "npm:2.2.2" - "@wireapp/core": "npm:46.0.17" + "@wireapp/core": "npm:46.0.18" "@wireapp/eslint-config": "npm:3.0.7" "@wireapp/prettier-config": "npm:0.6.4" "@wireapp/react-ui-kit": "npm:9.18.0"