diff --git a/src/app/op-log/persistence/operation-log-store.service.ts b/src/app/op-log/persistence/operation-log-store.service.ts index e14d1a5151..b3b6160993 100644 --- a/src/app/op-log/persistence/operation-log-store.service.ts +++ b/src/app/op-log/persistence/operation-log-store.service.ts @@ -3,9 +3,9 @@ import { DBSchema, IDBPDatabase, openDB } from 'idb'; import { Operation, OperationLogEntry, - OpType, VectorClock, isFullStateOpType, + FULL_STATE_OP_TYPES, } from '../core/operation.types'; import { StorageQuotaExceededError } from '../core/errors/sync-errors'; import { toEntityKey } from '../util/entity-key.util'; @@ -1334,12 +1334,7 @@ export class OperationLogStoreService { // Using the import's clock as the base (REPLACE) instead of the current clock (MERGE) // prevents clock bloat that causes server-side pruning to drop the import's entry, // which would make subsequent ops appear CONCURRENT with the import. - const fullStateOp = ops.find( - (op) => - op.opType === OpType.SyncImport || - op.opType === OpType.BackupImport || - op.opType === OpType.Repair, - ); + const fullStateOp = ops.find((op) => FULL_STATE_OP_TYPES.has(op.opType)); const mergedClock = fullStateOp ? { ...fullStateOp.vectorClock } diff --git a/src/app/op-log/persistence/sync-hydration.service.ts b/src/app/op-log/persistence/sync-hydration.service.ts index 2d80a597ba..38613d3e53 100644 --- a/src/app/op-log/persistence/sync-hydration.service.ts +++ b/src/app/op-log/persistence/sync-hydration.service.ts @@ -278,7 +278,7 @@ export class SyncHydrationService { await this.opLogStore.setVectorClock(clockForStorage); OpLog.normal('SyncHydrationService: Updated vector clock store after sync'); - // 10. Dispatch loadAllData to update NgRx + // 11. Dispatch loadAllData to update NgRx this.store.dispatch(loadAllData({ appDataComplete: dataToLoad })); OpLog.normal('SyncHydrationService: Dispatched loadAllData with synced data'); } catch (e) {