From 838bbdb5ecf05a6b39a7915c32c6e7fcb555604d Mon Sep 17 00:00:00 2001 From: Hampus Date: Fri, 25 Sep 2026 16:44:58 +0200 Subject: [PATCH] fix(app): only start the domain migration when the app opens (#2956) --- .../app/domain_migration/DomainMigrationTrigger.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fluxer_app/src/features/app/domain_migration/DomainMigrationTrigger.ts b/fluxer_app/src/features/app/domain_migration/DomainMigrationTrigger.ts index c391835cb..e7265bab2 100644 --- a/fluxer_app/src/features/app/domain_migration/DomainMigrationTrigger.ts +++ b/fluxer_app/src/features/app/domain_migration/DomainMigrationTrigger.ts @@ -17,11 +17,13 @@ import { writeDomainMigrationIntent, } from '@app/features/app/domain_migration/DomainMigrationCore'; import DomainMigrationRollout from '@app/features/app/domain_migration/DomainMigrationRollout'; +import ExperimentAssignments from '@app/features/experiment/state/ExperimentAssignments'; import {getProtectedLocalStorage, getProtectedSessionStorage} from '@app/features/platform/state/ProtectedWebStorage'; import {Logger} from '@app/features/platform/utils/AppLogger'; import * as NagbarCommands from '@app/features/ui/commands/NagbarCommands'; import MediaEngine from '@app/features/voice/engine/MediaEngineFacade'; -import {compareShallow, reaction} from 'mobx'; +import {INERT_EXPERIMENT_ASSIGNMENTS_RESPONSE} from '@fluxer/schema/src/domains/experiment/ExperimentSchemas'; +import {when} from 'mobx'; const logger = new Logger('DomainMigrationTrigger'); @@ -107,13 +109,12 @@ export function startDomainMigrationTrigger(): void { setTimeout(offerNotificationReenable, 0); return; } - reaction( - () => ({enabled: DomainMigrationRollout.enabled, voiceActive: isVoiceActive()}), - ({enabled}) => { - evaluateSource(side, enabled).catch((err) => { + when( + () => ExperimentAssignments.response !== INERT_EXPERIMENT_ASSIGNMENTS_RESPONSE, + () => { + evaluateSource(side, DomainMigrationRollout.enabled).catch((err) => { logger.warn('Domain migration trigger failed:', err); }); }, - {fireImmediately: true, equals: compareShallow}, ); }