From fb759a0848612f7a74cd66aaa99eaef185290542 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Tue, 27 Jan 2026 22:19:01 +0100 Subject: [PATCH] fix: lint --- .../clean-slate/clean-slate.service.spec.ts | 22 ++++++++----------- .../sync/server-migration.service.spec.ts | 4 ++-- .../op-log/sync/server-migration.service.ts | 2 +- .../sync/sync-import-filter.service.spec.ts | 4 ---- .../performance.integration.spec.ts | 2 +- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/app/op-log/clean-slate/clean-slate.service.spec.ts b/src/app/op-log/clean-slate/clean-slate.service.spec.ts index 62f661b515..788b7503de 100644 --- a/src/app/op-log/clean-slate/clean-slate.service.spec.ts +++ b/src/app/op-log/clean-slate/clean-slate.service.spec.ts @@ -5,7 +5,7 @@ import { VectorClockService } from '../sync/vector-clock.service'; import { OperationLogStoreService } from '../persistence/operation-log-store.service'; import { ClientIdService } from '../../core/util/client-id.service'; import { PreMigrationBackupService } from './pre-migration-backup.service'; -import { OpType, Operation } from '../core/operation.types'; +import { Operation, OpType } from '../core/operation.types'; import { ActionType } from '../core/action-types.enum'; import { CURRENT_SCHEMA_VERSION } from '../persistence/schema-migration.service'; @@ -66,7 +66,7 @@ describe('CleanSlateService', () => { // Setup default mock responses mockStateSnapshotService.getStateSnapshotAsync.and.resolveTo(mockState as any); mockVectorClockService.getCurrentVectorClock.and.resolveTo(mockVectorClock); - mockClientIdService.generateNewClientId.and.resolveTo('E_newC'); + mockClientIdService.generateNewClientId.and.resolveTo('eNewC'); mockPreMigrationBackupService.createPreMigrationBackup.and.resolveTo(); mockOpLogStore.clearAllOperations.and.resolveTo(); mockOpLogStore.append.and.resolveTo(1); @@ -100,21 +100,18 @@ describe('CleanSlateService', () => { expect(appendedOp.opType).toBe(OpType.SyncImport); expect(appendedOp.entityType).toBe('ALL'); expect(appendedOp.payload).toBe(mockState); - expect(appendedOp.clientId).toBe('E_newC'); - // eslint-disable-next-line @typescript-eslint/naming-convention - expect(appendedOp.vectorClock).toEqual({ E_newC: 1 }); + expect(appendedOp.clientId).toBe('eNewC'); + expect(appendedOp.vectorClock).toEqual({ eNewC: 1 }); expect(appendedOp.schemaVersion).toBe(CURRENT_SCHEMA_VERSION); // Should update vector clock - // eslint-disable-next-line @typescript-eslint/naming-convention - expect(mockOpLogStore.setVectorClock).toHaveBeenCalledWith({ E_newC: 1 }); + expect(mockOpLogStore.setVectorClock).toHaveBeenCalledWith({ eNewC: 1 }); // Should save snapshot expect(mockOpLogStore.saveStateCache).toHaveBeenCalledWith({ state: mockState, lastAppliedOpSeq: 0, - // eslint-disable-next-line @typescript-eslint/naming-convention - vectorClock: { E_newC: 1 }, + vectorClock: { eNewC: 1 }, compactedAt: jasmine.any(Number), schemaVersion: CURRENT_SCHEMA_VERSION, }); @@ -153,8 +150,7 @@ describe('CleanSlateService', () => { await service.createCleanSlate('ENCRYPTION_CHANGE'); const appendedOp = mockOpLogStore.append.calls.mostRecent().args[0] as Operation; - // eslint-disable-next-line @typescript-eslint/naming-convention - expect(appendedOp.vectorClock).toEqual({ E_newC: 1 }); + expect(appendedOp.vectorClock).toEqual({ eNewC: 1 }); }); it('should create operation with valid UUIDv7', async () => { @@ -264,8 +260,8 @@ describe('CleanSlateService', () => { // The protected IDs should include ALL keys from the SYNC_IMPORT's vector clock // The new clock will be: { ...multiClientClock, E_newC: increment } - const protectedIds = - mockOpLogStore.setProtectedClientIds.calls.mostRecent().args[0] as string[]; + const protectedIds = mockOpLogStore.setProtectedClientIds.calls.mostRecent() + .args[0] as string[]; // Should contain the new client ID expect(protectedIds).toContain('E_newC'); diff --git a/src/app/op-log/sync/server-migration.service.spec.ts b/src/app/op-log/sync/server-migration.service.spec.ts index 3dbcacdb0a..957e3fae02 100644 --- a/src/app/op-log/sync/server-migration.service.spec.ts +++ b/src/app/op-log/sync/server-migration.service.spec.ts @@ -613,8 +613,8 @@ describe('ServerMigrationService', () => { // The protected IDs should include ALL keys from the SYNC_IMPORT's vector clock: // merged clock = { test-client: 5, client-A: 1, client-B: 50, client-C: 100 } // then incremented = { test-client: 6, client-A: 1, client-B: 50, client-C: 100 } - const protectedIds = - opLogStoreSpy.setProtectedClientIds.calls.mostRecent().args[0] as string[]; + const protectedIds = opLogStoreSpy.setProtectedClientIds.calls.mostRecent() + .args[0] as string[]; expect(protectedIds).toContain('test-client'); expect(protectedIds).toContain('client-A'); expect(protectedIds).toContain('client-B'); diff --git a/src/app/op-log/sync/server-migration.service.ts b/src/app/op-log/sync/server-migration.service.ts index 2ced910bf6..75cef20bf2 100644 --- a/src/app/op-log/sync/server-migration.service.ts +++ b/src/app/op-log/sync/server-migration.service.ts @@ -10,7 +10,7 @@ import { SnackService } from '../../core/snack/snack.service'; import { T } from '../../t.const'; import { loadAllData } from '../../root-store/meta/load-all-data.action'; import { CURRENT_SCHEMA_VERSION } from '../persistence/schema-migration.service'; -import { Operation, OpType, ActionType } from '../core/operation.types'; +import { ActionType, Operation, OpType } from '../core/operation.types'; import { uuidv7 } from '../../util/uuid-v7'; import { OpLog } from '../../core/log'; import { SYSTEM_TAG_IDS } from '../../features/tag/tag.const'; diff --git a/src/app/op-log/sync/sync-import-filter.service.spec.ts b/src/app/op-log/sync/sync-import-filter.service.spec.ts index f17bb3876a..b913c571fd 100644 --- a/src/app/op-log/sync/sync-import-filter.service.spec.ts +++ b/src/app/op-log/sync/sync-import-filter.service.spec.ts @@ -1301,7 +1301,6 @@ describe('SyncImportFilterService', () => { const syncImportClock = { // eslint-disable-next-line @typescript-eslint/naming-convention A_3Xx3: 5, - // eslint-disable-next-line @typescript-eslint/naming-convention A_AMT3: 81, // eslint-disable-next-line @typescript-eslint/naming-convention A_EemJ: 1, @@ -1336,7 +1335,6 @@ describe('SyncImportFilterService', () => { // All entries from import are preserved // eslint-disable-next-line @typescript-eslint/naming-convention A_3Xx3: 5, - // eslint-disable-next-line @typescript-eslint/naming-convention A_AMT3: 81, // eslint-disable-next-line @typescript-eslint/naming-convention A_EemJ: 1, @@ -1368,7 +1366,6 @@ describe('SyncImportFilterService', () => { const syncImportClock = { // eslint-disable-next-line @typescript-eslint/naming-convention A_3Xx3: 5, - // eslint-disable-next-line @typescript-eslint/naming-convention A_AMT3: 81, // eslint-disable-next-line @typescript-eslint/naming-convention A_EemJ: 1, @@ -1403,7 +1400,6 @@ describe('SyncImportFilterService', () => { vectorClock: { // Only kept the highest counter entries (pruned to ~8 entries) // Missing: A_3Xx3, A_EemJ, A_wU5p, A_ypDK, B_bC8O (all with low counters) - // eslint-disable-next-line @typescript-eslint/naming-convention A_AMT3: 81, // eslint-disable-next-line @typescript-eslint/naming-convention A_Jxm0: 36, // Incremented from 35 diff --git a/src/app/op-log/testing/integration/performance.integration.spec.ts b/src/app/op-log/testing/integration/performance.integration.spec.ts index a9b8d6e81e..d2bc4b611d 100644 --- a/src/app/op-log/testing/integration/performance.integration.spec.ts +++ b/src/app/op-log/testing/integration/performance.integration.spec.ts @@ -321,7 +321,7 @@ describe('Performance Integration', () => { expect(compactDuration).toBeLessThan(10000); // < 10 seconds console.log(`Compaction: ${compactDuration}ms for ${operationCount} ops`); - }); + }, 15000); }); describe('Concurrent operation handling', () => {