diff --git a/ts/components/leftpane/ActionsPanel.tsx b/ts/components/leftpane/ActionsPanel.tsx index 5cf331ee2..ad015a663 100644 --- a/ts/components/leftpane/ActionsPanel.tsx +++ b/ts/components/leftpane/ActionsPanel.tsx @@ -45,7 +45,7 @@ import { import { isDarkTheme } from '../../state/selectors/theme'; import { ThemeStateType } from '../../themes/constants/colors'; import { switchThemeTo } from '../../themes/switchTheme'; -import { ConfigurationSync } from '../../session/utils/job_runners/jobs/ConfigurationSyncJob'; +import { UserSync } from '../../session/utils/job_runners/jobs/UserSyncJob'; const Section = (props: { type: SectionType }) => { const ourNumber = useSelector(getOurNumber); @@ -212,7 +212,7 @@ const doAppStartUp = async () => { global.setTimeout(() => { // Schedule a confSyncJob in some time to let anything incoming from the network be applied and see if there is a push needed - void ConfigurationSync.queueNewJobIfNeeded(); + void UserSync.queueNewJobIfNeeded(); }, 20000); }; diff --git a/ts/components/settings/section/CategoryPrivacy.tsx b/ts/components/settings/section/CategoryPrivacy.tsx index 4e0f5be3b..9ad89969c 100644 --- a/ts/components/settings/section/CategoryPrivacy.tsx +++ b/ts/components/settings/section/CategoryPrivacy.tsx @@ -10,7 +10,7 @@ import { SpacerLG } from '../../basic/Text'; import { TypingBubble } from '../../conversation/TypingBubble'; import { UserUtils } from '../../../session/utils'; -import { ConfigurationSync } from '../../../session/utils/job_runners/jobs/ConfigurationSyncJob'; +import { UserSync } from '../../../session/utils/job_runners/jobs/UserSyncJob'; import { SessionUtilUserProfile } from '../../../session/utils/libsession/libsession_utils_user_profile'; import { useHasBlindedMsgRequestsEnabled, @@ -98,7 +98,7 @@ export const SettingsCategoryPrivacy = (props: { await SessionUtilUserProfile.insertUserProfileIntoWrapper( UserUtils.getOurPubKeyStrFromCache() ); - await ConfigurationSync.queueNewJobIfNeeded(); + await UserSync.queueNewJobIfNeeded(); forceUpdate(); }} title={window.i18n('blindedMsgReqsSettingTitle')} diff --git a/ts/interactions/conversationInteractions.ts b/ts/interactions/conversationInteractions.ts index b6aa0c90d..7210a3513 100644 --- a/ts/interactions/conversationInteractions.ts +++ b/ts/interactions/conversationInteractions.ts @@ -15,7 +15,7 @@ import { getSodiumRenderer } from '../session/crypto'; import { getDecryptedMediaUrl } from '../session/crypto/DecryptedAttachmentsManager'; import { perfEnd, perfStart } from '../session/utils/Performance'; import { fromHexToArray, toHex } from '../session/utils/String'; -import { ConfigurationSync } from '../session/utils/job_runners/jobs/ConfigurationSyncJob'; +import { UserSync } from '../session/utils/job_runners/jobs/UserSyncJob'; import { SessionUtilContact } from '../session/utils/libsession/libsession_utils_contacts'; import { forceSyncConfigurationNowIfNeeded } from '../session/utils/sync/syncUtils'; import { @@ -466,7 +466,7 @@ export async function uploadOurAvatar(newAvatarDecrypted?: ArrayBuffer) { if (newAvatarDecrypted) { await setLastProfileUpdateTimestamp(Date.now()); - await ConfigurationSync.queueNewJobIfNeeded(); + await UserSync.queueNewJobIfNeeded(); const userConfigLibsession = await ReleasedFeatures.checkIsUserConfigFeatureReleased(); if (!userConfigLibsession) { diff --git a/ts/mains/main_renderer.tsx b/ts/mains/main_renderer.tsx index ca3ec64e0..52af0ea8f 100644 --- a/ts/mains/main_renderer.tsx +++ b/ts/mains/main_renderer.tsx @@ -114,8 +114,8 @@ async function startJobRunners() { // start the job runners await runners.avatarDownloadRunner.loadJobsFromDb(); runners.avatarDownloadRunner.startProcessing(); - await runners.configurationSyncRunner.loadJobsFromDb(); - runners.configurationSyncRunner.startProcessing(); + await runners.userSyncRunner.loadJobsFromDb(); + runners.userSyncRunner.startProcessing(); await runners.groupSyncRunner.loadJobsFromDb(); runners.groupSyncRunner.startProcessing(); } diff --git a/ts/models/conversation.ts b/ts/models/conversation.ts index de11d99ed..0d72b4768 100644 --- a/ts/models/conversation.ts +++ b/ts/models/conversation.ts @@ -78,7 +78,7 @@ import { MessageRequestResponseParams, } from '../session/messages/outgoing/controlMessage/MessageRequestResponse'; import { ed25519Str } from '../session/onions/onionPath'; -import { ConfigurationSync } from '../session/utils/job_runners/jobs/ConfigurationSyncJob'; +import { UserSync } from '../session/utils/job_runners/jobs/UserSyncJob'; import { SessionUtilContact } from '../session/utils/libsession/libsession_utils_contacts'; import { SessionUtilConvoInfoVolatile } from '../session/utils/libsession/libsession_utils_convo_info_volatile'; import { SessionUtilUserGroups } from '../session/utils/libsession/libsession_utils_user_groups'; @@ -2386,7 +2386,7 @@ async function commitConversationAndRefreshWrapper(id: string) { if (Registration.isDone()) { // save the new dump if needed to the DB asap // this call throttled so we do not run this too often (and not for every .commit()) - await ConfigurationSync.queueNewJobIfNeeded(); + await UserSync.queueNewJobIfNeeded(); } convo.triggerUIRefresh(); } diff --git a/ts/receiver/configMessage.ts b/ts/receiver/configMessage.ts index 920ccd988..dd3997080 100644 --- a/ts/receiver/configMessage.ts +++ b/ts/receiver/configMessage.ts @@ -16,7 +16,7 @@ import { ProfileManager } from '../session/profile_manager/ProfileManager'; import { PubKey } from '../session/types'; import { StringUtils, UserUtils } from '../session/utils'; import { toHex } from '../session/utils/String'; -import { ConfigurationSync } from '../session/utils/job_runners/jobs/ConfigurationSyncJob'; +import { UserSync } from '../session/utils/job_runners/jobs/UserSyncJob'; import { LibSessionUtil } from '../session/utils/libsession/libsession_utils'; import { SessionUtilContact } from '../session/utils/libsession/libsession_utils_contacts'; import { SessionUtilConvoInfoVolatile } from '../session/utils/libsession/libsession_utils_convo_info_volatile'; @@ -910,7 +910,7 @@ async function processUserMergingResults(results: Map( @@ -15,8 +15,8 @@ export function persistedJobFromData( } switch (data.jobType) { - case 'ConfigurationSyncJobType': - return new ConfigurationSync.ConfigurationSyncJob(data) as unknown as PersistedJob; + case 'UserSyncJobType': + return new UserSync.UserSyncJob(data) as unknown as PersistedJob; case 'AvatarDownloadJobType': return new AvatarDownload.AvatarDownloadJob(data) as unknown as PersistedJob; case 'FakeSleepForJobType': diff --git a/ts/session/utils/job_runners/JobRunner.ts b/ts/session/utils/job_runners/JobRunner.ts index cc6b2a812..9f470d864 100644 --- a/ts/session/utils/job_runners/JobRunner.ts +++ b/ts/session/utils/job_runners/JobRunner.ts @@ -1,17 +1,17 @@ import { cloneDeep, compact, isArray, isString } from 'lodash'; import { Data } from '../../../data/data'; +import { Storage } from '../../../util/storage'; import { timeout } from '../Promise'; import { persistedJobFromData } from './JobDeserialization'; -import { JobRunnerType } from './jobs/JobRunnerType'; import { AvatarDownloadPersistedData, - ConfigurationSyncPersistedData, GroupSyncPersistedData, PersistedJob, RunJobResult, TypeOfPersistedData, + UserSyncPersistedData, } from './PersistedJob'; -import { Storage } from '../../../util/storage'; +import { JobRunnerType } from './jobs/JobRunnerType'; /** * 'job_in_progress' if there is already a job in progress @@ -351,10 +351,7 @@ export class PersistedJobRunner { } } -const configurationSyncRunner = new PersistedJobRunner( - 'ConfigurationSyncJob', - null -); +const userSyncRunner = new PersistedJobRunner('UserSyncJob', null); const groupSyncRunner = new PersistedJobRunner('GroupSyncJob', null); const avatarDownloadRunner = new PersistedJobRunner( @@ -363,7 +360,7 @@ const avatarDownloadRunner = new PersistedJobRunner ); export const runners = { - configurationSyncRunner, + userSyncRunner, groupSyncRunner, avatarDownloadRunner, }; diff --git a/ts/session/utils/job_runners/PersistedJob.ts b/ts/session/utils/job_runners/PersistedJob.ts index ffba8fd12..4bc3513d1 100644 --- a/ts/session/utils/job_runners/PersistedJob.ts +++ b/ts/session/utils/job_runners/PersistedJob.ts @@ -1,7 +1,7 @@ import { cloneDeep, isEmpty } from 'lodash'; export type PersistedJobType = - | 'ConfigurationSyncJobType' + | 'UserSyncJobType' | 'GroupSyncJobType' | 'AvatarDownloadJobType' | 'FakeSleepForJobType' @@ -32,15 +32,15 @@ export interface AvatarDownloadPersistedData extends PersistedJobData { conversationId: string; } -export interface ConfigurationSyncPersistedData extends PersistedJobData { - jobType: 'ConfigurationSyncJobType'; +export interface UserSyncPersistedData extends PersistedJobData { + jobType: 'UserSyncJobType'; } export interface GroupSyncPersistedData extends PersistedJobData { jobType: 'GroupSyncJobType'; } export type TypeOfPersistedData = - | ConfigurationSyncPersistedData + | UserSyncPersistedData | AvatarDownloadPersistedData | FakeSleepJobData | FakeSleepForMultiJobData diff --git a/ts/session/utils/job_runners/jobs/GroupSyncJob.ts b/ts/session/utils/job_runners/jobs/GroupSyncJob.ts index fcd2cdc6d..f00b56564 100644 --- a/ts/session/utils/job_runners/jobs/GroupSyncJob.ts +++ b/ts/session/utils/job_runners/jobs/GroupSyncJob.ts @@ -162,7 +162,7 @@ class GroupSyncJob extends PersistedJob { } catch (e) { throw e; } finally { - window.log.debug(`ConfigurationSyncJob run() took ${Date.now() - start}ms`); + window.log.debug(`UserSyncJob run() took ${Date.now() - start}ms`); // this is a simple way to make sure whatever happens here, we update the lastest timestamp. // (a finally statement is always executed (no matter if exception or returns in other try/catch block) diff --git a/ts/session/utils/job_runners/jobs/JobRunnerType.ts b/ts/session/utils/job_runners/jobs/JobRunnerType.ts index 438d90832..56b3b2756 100644 --- a/ts/session/utils/job_runners/jobs/JobRunnerType.ts +++ b/ts/session/utils/job_runners/jobs/JobRunnerType.ts @@ -1,5 +1,5 @@ export type JobRunnerType = - | 'ConfigurationSyncJob' + | 'UserSyncJob' | 'GroupSyncJob' | 'FakeSleepForJob' | 'FakeSleepForMultiJob' diff --git a/ts/session/utils/job_runners/jobs/ConfigurationSyncJob.ts b/ts/session/utils/job_runners/jobs/UserSyncJob.ts similarity index 84% rename from ts/session/utils/job_runners/jobs/ConfigurationSyncJob.ts rename to ts/session/utils/job_runners/jobs/UserSyncJob.ts index 78da695fb..bbb5ff64f 100644 --- a/ts/session/utils/job_runners/jobs/ConfigurationSyncJob.ts +++ b/ts/session/utils/job_runners/jobs/UserSyncJob.ts @@ -4,7 +4,7 @@ import { isArray, isEmpty, isNumber } from 'lodash'; import { v4 } from 'uuid'; import { UserUtils } from '../..'; import { ConfigDumpData } from '../../../../data/configDump/configDump'; -import { ConfigurationSyncJobDone } from '../../../../shims/events'; +import { UserSyncJobDone } from '../../../../shims/events'; import { isSignInByLinking } from '../../../../util/storage'; import { GenericWrapperActions } from '../../../../webworker/workers/browser/libsession_worker_interface'; import { StoreOnNodeData } from '../../../apis/snode_api/SnodeRequestTypes'; @@ -17,7 +17,7 @@ import { LibSessionUtil, UserSuccessfulChange } from '../../libsession/libsessio import { runners } from '../JobRunner'; import { AddJobCheckReturn, - ConfigurationSyncPersistedData, + UserSyncPersistedData, PersistedJob, RunJobResult, } from '../PersistedJob'; @@ -58,7 +58,7 @@ async function confirmPushedAndDump( } function triggerConfSyncJobDone() { - window.Whisper.events.trigger(ConfigurationSyncJobDone); + window.Whisper.events.trigger(UserSyncJobDone); } function isPubkey(us: string): us is PubkeyType { @@ -98,7 +98,7 @@ async function pushChangesToUserSwarmIfNeeded() { // we do a sequence call here. If we do not have the right expected number of results, consider it a failure if (!isArray(result) || result.length !== expectedReplyLength) { window.log.info( - `ConfigurationSyncJob: unexpected result length: expected ${expectedReplyLength} but got ${result?.length}` + `UserSyncJob: unexpected result length: expected ${expectedReplyLength} but got ${result?.length}` ); // this might be a 421 error (already handled) so let's retry this request a little bit later return RunJobResult.RetryJobIfPossible; @@ -116,7 +116,7 @@ async function pushChangesToUserSwarmIfNeeded() { return RunJobResult.Success; } -class ConfigurationSyncJob extends PersistedJob { +class UserSyncJob extends PersistedJob { constructor({ identifier, nextAttemptTimestamp, @@ -124,12 +124,12 @@ class ConfigurationSyncJob extends PersistedJob currentRetry, }: Partial< Pick< - ConfigurationSyncPersistedData, + UserSyncPersistedData, 'identifier' | 'nextAttemptTimestamp' | 'currentRetry' | 'maxAttempts' > >) { super({ - jobType: 'ConfigurationSyncJobType', + jobType: 'UserSyncJobType', identifier: identifier || v4(), delayBetweenRetries: defaultMsBetweenRetries, maxAttempts: isNumber(maxAttempts) ? maxAttempts : defaultMaxAttempts, @@ -142,7 +142,7 @@ class ConfigurationSyncJob extends PersistedJob const start = Date.now(); try { - window.log.debug(`ConfigurationSyncJob starting ${this.persistedData.identifier}`); + window.log.debug(`UserSyncJob starting ${this.persistedData.identifier}`); const us = UserUtils.getOurPubKeyStrFromCache(); const ed25519Key = await UserUtils.getUserED25519KeyPairBytes(); @@ -158,7 +158,7 @@ class ConfigurationSyncJob extends PersistedJob } catch (e) { throw e; } finally { - window.log.debug(`ConfigurationSyncJob run() took ${Date.now() - start}ms`); + window.log.debug(`UserSyncJob run() took ${Date.now() - start}ms`); // this is a simple way to make sure whatever happens here, we update the lastest timestamp. // (a finally statement is always executed (no matter if exception or returns in other try/catch block) @@ -166,12 +166,12 @@ class ConfigurationSyncJob extends PersistedJob } } - public serializeJob(): ConfigurationSyncPersistedData { + public serializeJob(): UserSyncPersistedData { const fromParent = super.serializeBase(); return fromParent; } - public addJobCheck(jobs: Array): AddJobCheckReturn { + public addJobCheck(jobs: Array): AddJobCheckReturn { return this.addJobCheckSameTypePresent(jobs); } @@ -180,7 +180,7 @@ class ConfigurationSyncJob extends PersistedJob * We never want to add a new sync configuration job if there is already one in the queue. * This is done by the `addJobCheck` method above */ - public nonRunningJobsToRemove(_jobs: Array) { + public nonRunningJobsToRemove(_jobs: Array) { return []; } @@ -195,7 +195,7 @@ class ConfigurationSyncJob extends PersistedJob /** * Queue a new Sync Configuration if needed job. - * A ConfigurationSyncJob can only be added if there is none of the same type queued already. + * A UserSyncJob can only be added if there is none of the same type queued already. */ async function queueNewJobIfNeeded() { if (isSignInByLinking()) { @@ -210,8 +210,8 @@ async function queueNewJobIfNeeded() { // window.log.debug('Scheduling ConfSyncJob: ASAP'); // we postpone by 1000ms to make sure whoever is adding this job is done with what is needs to do first // this call will make sure that there is only one configuration sync job at all times - await runners.configurationSyncRunner.addJob( - new ConfigurationSyncJob({ nextAttemptTimestamp: Date.now() + 1000 }) + await runners.userSyncRunner.addJob( + new UserSyncJob({ nextAttemptTimestamp: Date.now() + 1000 }) ); } else { // if we did run at t=100, and it is currently t=110, the difference is 10 @@ -220,14 +220,13 @@ async function queueNewJobIfNeeded() { const leftBeforeNextTick = Math.max(defaultMsBetweenRetries - diff, 1000); // window.log.debug('Scheduling ConfSyncJob: LATER'); - await runners.configurationSyncRunner.addJob( - new ConfigurationSyncJob({ nextAttemptTimestamp: Date.now() + leftBeforeNextTick }) + await runners.userSyncRunner.addJob( + new UserSyncJob({ nextAttemptTimestamp: Date.now() + leftBeforeNextTick }) ); } } -export const ConfigurationSync = { - ConfigurationSyncJob, - queueNewJobIfNeeded: () => - allowOnlyOneAtATime('ConfigurationSyncJob-oneAtAtTime', queueNewJobIfNeeded), +export const UserSync = { + UserSyncJob, + queueNewJobIfNeeded: () => allowOnlyOneAtATime('UserSyncJob-oneAtAtTime', queueNewJobIfNeeded), }; diff --git a/ts/session/utils/libsession/libsession_utils.ts b/ts/session/utils/libsession/libsession_utils.ts index bd59fadd7..5c3b014bf 100644 --- a/ts/session/utils/libsession/libsession_utils.ts +++ b/ts/session/utils/libsession/libsession_utils.ts @@ -19,7 +19,7 @@ import { import { SnodeNamespaces, UserConfigNamespaces } from '../../apis/snode_api/namespaces'; import { ed25519Str } from '../../onions/onionPath'; import { PubKey } from '../../types'; -import { ConfigurationSync } from '../job_runners/jobs/ConfigurationSyncJob'; +import { UserSync } from '../job_runners/jobs/UserSyncJob'; import { BatchResultEntry, NotEmptyArrayOfBatchResults, @@ -39,7 +39,7 @@ async function initializeLibSessionUtilWrappers() { } const privateKeyEd25519 = keypair.privKeyBytes; // let's plan a sync on start with some room for the app to be ready - setTimeout(() => ConfigurationSync.queueNewJobIfNeeded, 20000); + setTimeout(() => UserSync.queueNewJobIfNeeded, 20000); // fetch the dumps we already have from the database const dumps = await ConfigDumpData.getAllDumpsWithData(); diff --git a/ts/session/utils/libsession/libsession_utils_contacts.ts b/ts/session/utils/libsession/libsession_utils_contacts.ts index 8364e62ce..a360a7523 100644 --- a/ts/session/utils/libsession/libsession_utils_contacts.ts +++ b/ts/session/utils/libsession/libsession_utils_contacts.ts @@ -18,7 +18,7 @@ import { PubKey } from '../../types'; * * Also, to make sure that our wrapper is up to date, we schedule jobs to be run and fetch all contacts and update all the wrappers entries. * This is done in the - * - `ConfigurationSyncJob` (sending data to the network) and the + * - `UserSyncJob` (sending data to the network) and the * */ const mappedContactWrapperValues = new Map(); diff --git a/ts/session/utils/sync/syncUtils.ts b/ts/session/utils/sync/syncUtils.ts index b7ddaf215..eb06837de 100644 --- a/ts/session/utils/sync/syncUtils.ts +++ b/ts/session/utils/sync/syncUtils.ts @@ -7,7 +7,7 @@ import { OpenGroupData } from '../../../data/opengroups'; import { ConversationModel } from '../../../models/conversation'; import { SignalService } from '../../../protobuf'; import { ECKeyPair } from '../../../receiver/keypairs'; -import { ConfigurationSyncJobDone } from '../../../shims/events'; +import { UserSyncJobDone } from '../../../shims/events'; import { ReleasedFeatures } from '../../../util/releaseFeature'; import { Storage } from '../../../util/storage'; import { getCompleteUrlFromRoom } from '../../apis/open_group_api/utils/OpenGroupUtils'; @@ -30,7 +30,7 @@ import { } from '../../messages/outgoing/visibleMessage/VisibleMessage'; import { PubKey } from '../../types'; import { fromBase64ToArray, fromHexToArray } from '../String'; -import { ConfigurationSync } from '../job_runners/jobs/ConfigurationSyncJob'; +import { UserSync } from '../job_runners/jobs/UserSyncJob'; const ITEM_ID_LAST_SYNC_TIMESTAMP = 'lastSyncedTimestamp'; @@ -44,7 +44,7 @@ const writeLastSyncTimestampToDb = async (timestamp: number) => * Conditionally Syncs user configuration with other devices linked. */ export const syncConfigurationIfNeeded = async () => { - await ConfigurationSync.queueNewJobIfNeeded(); + await UserSync.queueNewJobIfNeeded(); const userConfigLibsession = await ReleasedFeatures.checkIsUserConfigFeatureReleased(); if (!userConfigLibsession) { @@ -84,16 +84,16 @@ export const forceSyncConfigurationNowIfNeeded = async (waitForMessageSent = fal resolve(false); }, 20000); - // the ConfigurationSync also handles dumping in to the DB if we do not need to push the data, but the dumping needs to be done even before the feature flag is true. - void ConfigurationSync.queueNewJobIfNeeded().catch(e => { + // the UserSync also handles dumping in to the DB if we do not need to push the data, but the dumping needs to be done even before the feature flag is true. + void UserSync.queueNewJobIfNeeded().catch(e => { window.log.warn( - 'forceSyncConfigurationNowIfNeeded scheduling of jobs ConfigurationSync.queueNewJobIfNeeded failed with: ', + 'forceSyncConfigurationNowIfNeeded scheduling of jobs UserSync.queueNewJobIfNeeded failed with: ', e.message ); }); if (ReleasedFeatures.isUserConfigFeatureReleasedCached()) { if (waitForMessageSent) { - window.Whisper.events.once(ConfigurationSyncJobDone, () => { + window.Whisper.events.once(UserSyncJobDone, () => { resolve(true); }); return; diff --git a/ts/shims/events.ts b/ts/shims/events.ts index 2ab75b3c8..45cdf4cd7 100644 --- a/ts/shims/events.ts +++ b/ts/shims/events.ts @@ -3,4 +3,4 @@ export function trigger(name: string, param1?: any, param2?: any) { } export const configurationMessageReceived = 'configurationMessageReceived'; -export const ConfigurationSyncJobDone = 'ConfigurationSyncJobDone'; +export const UserSyncJobDone = 'UserSyncJobDone'; diff --git a/ts/test/session/unit/swarm_polling/SwarmPolling_pollForAllKeys_test.ts b/ts/test/session/unit/swarm_polling/SwarmPolling_pollForAllKeys_test.ts index e8ac3a542..675ca91cc 100644 --- a/ts/test/session/unit/swarm_polling/SwarmPolling_pollForAllKeys_test.ts +++ b/ts/test/session/unit/swarm_polling/SwarmPolling_pollForAllKeys_test.ts @@ -13,7 +13,7 @@ import { ConvoHub } from '../../../../session/conversations'; import { PubKey } from '../../../../session/types'; import { UserUtils } from '../../../../session/utils'; import { sleepFor } from '../../../../session/utils/Promise'; -import { ConfigurationSync } from '../../../../session/utils/job_runners/jobs/ConfigurationSyncJob'; +import { UserSync } from '../../../../session/utils/job_runners/jobs/UserSyncJob'; import { TestUtils } from '../../../test-utils'; import { generateFakeSnodes, stubData } from '../../../test-utils/utils'; @@ -52,7 +52,7 @@ describe('SwarmPolling:pollForAllKeys', () => { ConvoHub.use().reset(); TestUtils.stubWindowFeatureFlags(); TestUtils.stubWindowLog(); - Sinon.stub(ConfigurationSync, 'queueNewJobIfNeeded').resolves(); + Sinon.stub(UserSync, 'queueNewJobIfNeeded').resolves(); // Utils Stubs Sinon.stub(UserUtils, 'getOurPubKeyStrFromCache').returns(ourNumber); diff --git a/ts/util/releaseFeature.ts b/ts/util/releaseFeature.ts index 76f2e972d..6f3c4b762 100644 --- a/ts/util/releaseFeature.ts +++ b/ts/util/releaseFeature.ts @@ -1,5 +1,5 @@ import { GetNetworkTime } from '../session/apis/snode_api/getNetworkTime'; -import { ConfigurationSync } from '../session/utils/job_runners/jobs/ConfigurationSyncJob'; +import { UserSync } from '../session/utils/job_runners/jobs/UserSyncJob'; import { assertUnreachable } from '../types/sqlSharedTypes'; import { Storage } from './storage'; @@ -87,7 +87,7 @@ async function checkIsFeatureReleased(featureName: FeatureNameTracked): Promise< await Storage.put(featureStorageItemId(featureName), true); setIsFeatureReleasedCached(featureName, true); // trigger a sync right away so our user data is online - await ConfigurationSync.queueNewJobIfNeeded(); + await UserSync.queueNewJobIfNeeded(); } const isReleased = Boolean(getIsFeatureReleasedCached(featureName));