From d6dcc86ca0777cc5a16082c742a15e485502a660 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sat, 27 Dec 2025 17:52:11 +0100 Subject: [PATCH] refactor: reorganize operation-log files into src/app/op-log/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move operation-log from src/app/core/persistence/operation-log/ to src/app/op-log/ with improved subdirectory organization: - core/: Types, constants, errors, entity registry - capture/: Write path (Actions → Operations) - operation-capture.meta-reducer.ts - operation-capture.service.ts - operation-log.effects.ts - apply/: Read path (Operations → State) - bulk-hydration.action.ts/.meta-reducer.ts - operation-applier.service.ts - operation-converter.util.ts - hydration-state.service.ts - archive-operation-handler.service.ts/.effects.ts - store/: IndexedDB persistence - operation-log-store.service.ts - operation-log-hydrator.service.ts - operation-log-compaction.service.ts - schema-migration.service.ts - sync/: Server sync (SuperSync) - operation-log-sync.service.ts - operation-log-upload.service.ts - operation-log-download.service.ts - conflict-resolution.service.ts - sync-import-filter.service.ts - vector-clock.service.ts - operation-encryption.service.ts - validation/: State validation - validate-state.service.ts - validate-operation-payload.ts - util/: Shared utilities - entity-key.util.ts - client-id.provider.ts - testing/: Integration tests and benchmarks This reorganization: - Places op-log at the same level as pfapi for better visibility - Groups files by responsibility (write path vs read path) - Makes the sync architecture more discoverable - Improves navigation for developers new to the codebase --- docs/ai/adding-new-entity-type-checklist.md | 12 ++-- .../long-term-plans/e2e-encryption-plan.md | 34 +++++----- .../hybrid-manifest-architecture.md | 2 +- .../replace-pfapi-with-oplog-plan.md | 10 +-- .../operation-log-architecture.md | 6 +- docs/sync-and-op-log/quick-reference.md | 45 +++++++++---- .../supersync-encryption-architecture.md | 6 +- src/app/core/data-init/data-init.service.ts | 2 +- .../store/android-focus-mode.effects.ts | 2 +- .../android-foreground-tracking.effects.ts | 2 +- .../features/boards/store/boards.actions.ts | 4 +- .../config/store/global-config.actions.ts | 4 +- .../issue/store/issue-provider.actions.ts | 4 +- ...-all-tasks-on-provider-deletion.effects.ts | 2 +- .../menu-tree/store/menu-tree.actions.ts | 4 +- .../features/metric/store/metric.actions.ts | 4 +- src/app/features/note/store/note.actions.ts | 4 +- .../features/planner/store/planner.actions.ts | 4 +- .../features/project/store/project.actions.ts | 4 +- .../store/simple-counter.actions.ts | 4 +- .../store/simple-counter.reducer.spec.ts | 2 +- .../store/simple-counter.reducer.ts | 2 +- src/app/features/tag/store/tag.actions.ts | 4 +- .../features/tag/store/tag.effects.spec.ts | 2 +- .../store/task-repeat-cfg.actions.ts | 4 +- .../features/tasks/store/task-due.effects.ts | 2 +- .../store/task-related-model.effects.spec.ts | 2 +- .../tasks/store/task-related-model.effects.ts | 2 +- src/app/features/tasks/store/task.actions.ts | 4 +- src/app/features/tasks/store/task.reducer.ts | 2 +- .../task-attachment.actions.ts | 4 +- .../time-tracking/store/archive.actions.ts | 4 +- .../store/time-tracking.actions.ts | 4 +- .../store/work-context-meta.actions.ts | 4 +- ...encryption-password-change.service.spec.ts | 6 +- .../encryption-password-change.service.ts | 10 +-- src/app/imex/sync/sync-wrapper.service.ts | 4 +- .../archive-operation-handler.effects.spec.ts | 16 ++--- .../archive-operation-handler.effects.ts | 12 ++-- .../archive-operation-handler.service.spec.ts | 22 +++---- .../archive-operation-handler.service.ts | 32 ++++----- .../apply}/bulk-hydration.action.ts | 2 +- .../bulk-hydration.meta-reducer.spec.ts | 16 ++--- .../apply}/bulk-hydration.meta-reducer.ts | 0 .../apply}/hydration-state.service.spec.ts | 2 +- .../apply}/hydration-state.service.ts | 4 +- .../apply}/operation-applier.service.spec.ts | 10 +-- .../apply}/operation-applier.service.ts | 12 ++-- .../apply}/operation-converter.util.spec.ts | 2 +- .../apply}/operation-converter.util.ts | 4 +- .../operation-capture.meta-reducer.spec.ts | 6 +- .../operation-capture.meta-reducer.ts | 7 +- .../operation-capture.service.spec.ts | 4 +- .../capture}/operation-capture.service.ts | 6 +- .../capture}/operation-log.effects.spec.ts | 22 +++---- .../capture}/operation-log.effects.ts | 45 +++++++------ .../core}/entity-registry.spec.ts | 0 .../core}/entity-registry.ts | 65 +++++++++---------- .../core}/operation-log.const.ts | 0 .../core}/operation.types.ts | 2 +- .../core}/persistent-action-types.spec.ts | 18 ++--- .../core}/persistent-action.interface.spec.ts | 0 .../core}/persistent-action.interface.ts | 0 .../core}/sync-state-corrupted.error.spec.ts | 0 .../core}/sync-state-corrupted.error.ts | 0 .../operation-log-compaction.service.spec.ts | 10 +-- .../store/operation-log-compaction.service.ts | 10 +-- .../operation-log-hydrator.service.spec.ts | 20 +++--- .../store/operation-log-hydrator.service.ts | 32 ++++----- .../operation-log-migration.service.spec.ts | 6 +- .../store/operation-log-migration.service.ts | 14 ++-- .../store/operation-log-store.service.spec.ts | 4 +- .../store/operation-log-store.service.ts | 9 ++- .../store/schema-migration.service.spec.ts | 2 +- .../store/schema-migration.service.ts | 4 +- .../sync/conflict-resolution.service.spec.ts | 12 ++-- .../sync/conflict-resolution.service.ts | 33 +++++----- .../sync/immediate-upload.service.spec.ts | 4 +- .../sync/immediate-upload.service.ts | 6 +- .../sync/lock.service.spec.ts | 0 .../sync/lock.service.ts | 6 +- .../sync/operation-encryption.service.spec.ts | 4 +- .../sync/operation-encryption.service.ts | 6 +- .../operation-log-download.service.spec.ts | 14 ++-- .../sync/operation-log-download.service.ts | 26 ++++---- .../sync/operation-log-sync.service.spec.ts | 20 +++--- .../sync/operation-log-sync.service.ts | 26 ++++---- .../sync/operation-log-upload.service.spec.ts | 8 +-- .../sync/operation-log-upload.service.ts | 14 ++-- .../sync/operation-sync.util.spec.ts | 6 +- .../sync/operation-sync.util.ts | 6 +- .../operation-write-flush.service.spec.ts | 0 .../sync/operation-write-flush.service.ts | 6 +- .../sync/server-migration.service.spec.ts | 18 ++--- .../sync/server-migration.service.ts | 28 ++++---- .../sync/stale-operation-resolver.service.ts | 16 ++--- .../sync/super-sync-status.service.spec.ts | 0 .../sync/super-sync-status.service.ts | 0 .../sync/sync-import-filter.service.spec.ts | 2 +- .../sync/sync-import-filter.service.ts | 6 +- .../sync/vector-clock.service.spec.ts | 9 ++- .../sync/vector-clock.service.ts | 6 +- .../benchmarks/operation-log-stress.spec.ts | 8 +-- .../archive-subtask-sync.integration.spec.ts | 26 ++++---- .../bulk-hydration.integration.spec.ts | 10 +-- .../compaction.integration.spec.ts | 14 ++-- .../cross-entity-sync.integration.spec.ts | 8 +-- .../helpers/mock-sync-server.helper.ts | 2 +- .../helpers/operation-factory.helper.ts | 2 +- .../helpers/simulated-client.helper.ts | 6 +- .../integration/helpers/test-client.helper.ts | 11 +++- .../import-sync.integration.spec.ts | 8 +-- .../large-batch-sync.integration.spec.ts | 4 +- ...egacy-archive-subtasks.integration.spec.ts | 8 +-- .../legacy-data-migration.integration.spec.ts | 8 +-- ...ww-conflict-resolution.integration.spec.ts | 6 +- ...date-store-application.integration.spec.ts | 6 +- .../meta-reducer-ordering.integration.spec.ts | 8 +-- .../migration-handling.integration.spec.ts | 32 ++++----- .../multi-client-sync.integration.spec.ts | 8 +-- ...multi-entity-atomicity.integration.spec.ts | 9 ++- .../network-failure.integration.spec.ts | 6 +- .../performance.integration.spec.ts | 12 ++-- .../provider-switch.integration.spec.ts | 4 +- .../repair-sync.integration.spec.ts | 9 ++- .../repeat-task-sync.integration.spec.ts | 8 +-- .../server-migration.integration.spec.ts | 4 +- .../service-logic.integration.spec.ts | 51 ++++++++------- .../state-consistency.integration.spec.ts | 8 +-- .../sync-scenarios.integration.spec.ts | 4 +- .../vector-clock-sync.integration.spec.ts | 8 +-- .../util}/client-id.provider.ts | 2 +- .../util}/entity-key.util.spec.ts | 2 +- .../util}/entity-key.util.ts | 2 +- .../repair-operation.service.spec.ts | 2 +- .../validation}/repair-operation.service.ts | 14 ++-- .../validate-operation-payload.spec.ts | 2 +- .../validation}/validate-operation-payload.ts | 6 +- .../validate-state.service.spec.ts | 8 +-- .../validation}/validate-state.service.ts | 18 ++--- src/app/pfapi/api/pfapi.const.ts | 4 +- src/app/pfapi/api/pfapi.ts | 2 +- src/app/pfapi/api/sync/sync.service.spec.ts | 2 +- src/app/pfapi/api/sync/sync.service.ts | 2 +- .../pfapi/migrate/cross-model-migrations.ts | 2 +- src/app/pfapi/pfapi.service.spec.ts | 4 +- src/app/pfapi/pfapi.service.ts | 8 +-- src/app/plugins/plugin-bridge.service.ts | 2 +- src/app/plugins/store/plugin.actions.ts | 4 +- src/app/root-store/feature-stores.module.ts | 4 +- .../root-store/meta/meta-reducer-registry.ts | 4 +- .../meta/task-shared-meta-reducers/index.ts | 2 +- .../lww-update.meta-reducer.ts | 7 +- .../root-store/meta/task-shared.actions.ts | 4 +- .../util/skip-during-sync-window.operator.ts | 2 +- src/app/util/skip-during-sync.operator.ts | 2 +- src/main.ts | 4 +- 157 files changed, 693 insertions(+), 643 deletions(-) rename src/app/{core/persistence/operation-log/processing => op-log/apply}/archive-operation-handler.effects.spec.ts (93%) rename src/app/{core/persistence/operation-log/processing => op-log/apply}/archive-operation-handler.effects.ts (91%) rename src/app/{core/persistence/operation-log/processing => op-log/apply}/archive-operation-handler.service.spec.ts (98%) rename src/app/{core/persistence/operation-log/processing => op-log/apply}/archive-operation-handler.service.ts (93%) rename src/app/{core/persistence/operation-log => op-log/apply}/bulk-hydration.action.ts (94%) rename src/app/{core/persistence/operation-log => op-log/apply}/bulk-hydration.meta-reducer.spec.ts (96%) rename src/app/{core/persistence/operation-log => op-log/apply}/bulk-hydration.meta-reducer.ts (100%) rename src/app/{core/persistence/operation-log/processing => op-log/apply}/hydration-state.service.spec.ts (98%) rename src/app/{core/persistence/operation-log/processing => op-log/apply}/hydration-state.service.ts (96%) rename src/app/{core/persistence/operation-log/processing => op-log/apply}/operation-applier.service.spec.ts (98%) rename src/app/{core/persistence/operation-log/processing => op-log/apply}/operation-applier.service.ts (94%) rename src/app/{core/persistence/operation-log => op-log/apply}/operation-converter.util.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log/apply}/operation-converter.util.ts (95%) rename src/app/{core/persistence/operation-log/processing => op-log/capture}/operation-capture.meta-reducer.spec.ts (98%) rename src/app/{core/persistence/operation-log/processing => op-log/capture}/operation-capture.meta-reducer.ts (98%) rename src/app/{core/persistence/operation-log/processing => op-log/capture}/operation-capture.service.spec.ts (98%) rename src/app/{core/persistence/operation-log/processing => op-log/capture}/operation-capture.service.ts (97%) rename src/app/{core/persistence/operation-log => op-log/capture}/operation-log.effects.spec.ts (97%) rename src/app/{core/persistence/operation-log => op-log/capture}/operation-log.effects.ts (91%) rename src/app/{core/persistence/operation-log => op-log/core}/entity-registry.spec.ts (100%) rename src/app/{core/persistence/operation-log => op-log/core}/entity-registry.ts (84%) rename src/app/{core/persistence/operation-log => op-log/core}/operation-log.const.ts (100%) rename src/app/{core/persistence/operation-log => op-log/core}/operation.types.ts (99%) rename src/app/{core/persistence/operation-log => op-log/core}/persistent-action-types.spec.ts (84%) rename src/app/{core/persistence/operation-log => op-log/core}/persistent-action.interface.spec.ts (100%) rename src/app/{core/persistence/operation-log => op-log/core}/persistent-action.interface.ts (100%) rename src/app/{core/persistence/operation-log => op-log/core}/sync-state-corrupted.error.spec.ts (100%) rename src/app/{core/persistence/operation-log => op-log/core}/sync-state-corrupted.error.ts (100%) rename src/app/{core/persistence/operation-log => op-log}/store/operation-log-compaction.service.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/store/operation-log-compaction.service.ts (96%) rename src/app/{core/persistence/operation-log => op-log}/store/operation-log-hydrator.service.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log}/store/operation-log-hydrator.service.ts (97%) rename src/app/{core/persistence/operation-log => op-log}/store/operation-log-migration.service.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log}/store/operation-log-migration.service.ts (92%) rename src/app/{core/persistence/operation-log => op-log}/store/operation-log-store.service.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/store/operation-log-store.service.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/store/schema-migration.service.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/store/schema-migration.service.ts (98%) rename src/app/{core/persistence/operation-log => op-log}/sync/conflict-resolution.service.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/sync/conflict-resolution.service.ts (97%) rename src/app/{core/persistence/operation-log => op-log}/sync/immediate-upload.service.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log}/sync/immediate-upload.service.ts (97%) rename src/app/{core/persistence/operation-log => op-log}/sync/lock.service.spec.ts (100%) rename src/app/{core/persistence/operation-log => op-log}/sync/lock.service.ts (94%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-encryption.service.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-encryption.service.ts (92%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-log-download.service.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-log-download.service.ts (94%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-log-sync.service.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-log-sync.service.ts (98%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-log-upload.service.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-log-upload.service.ts (97%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-sync.util.spec.ts (97%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-sync.util.ts (85%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-write-flush.service.spec.ts (100%) rename src/app/{core/persistence/operation-log => op-log}/sync/operation-write-flush.service.ts (96%) rename src/app/{core/persistence/operation-log => op-log}/sync/server-migration.service.spec.ts (96%) rename src/app/{core/persistence/operation-log => op-log}/sync/server-migration.service.ts (90%) rename src/app/{core/persistence/operation-log => op-log}/sync/stale-operation-resolver.service.ts (94%) rename src/app/{core/persistence/operation-log => op-log}/sync/super-sync-status.service.spec.ts (100%) rename src/app/{core/persistence/operation-log => op-log}/sync/super-sync-status.service.ts (100%) rename src/app/{core/persistence/operation-log => op-log}/sync/sync-import-filter.service.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/sync/sync-import-filter.service.ts (97%) rename src/app/{core/persistence/operation-log => op-log}/sync/vector-clock.service.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log}/sync/vector-clock.service.ts (97%) rename src/app/{core/persistence/operation-log => op-log/testing}/benchmarks/operation-log-stress.spec.ts (94%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/archive-subtask-sync.integration.spec.ts (96%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/bulk-hydration.integration.spec.ts (96%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/compaction.integration.spec.ts (97%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/cross-entity-sync.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/helpers/mock-sync-server.helper.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/helpers/operation-factory.helper.ts (99%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/helpers/simulated-client.helper.ts (96%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/helpers/test-client.helper.ts (92%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/import-sync.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/large-batch-sync.integration.spec.ts (96%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/legacy-archive-subtasks.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/legacy-data-migration.integration.spec.ts (97%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/lww-conflict-resolution.integration.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/lww-update-store-application.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log/processing => op-log/testing/integration}/meta-reducer-ordering.integration.spec.ts (97%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/migration-handling.integration.spec.ts (86%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/multi-client-sync.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/multi-entity-atomicity.integration.spec.ts (97%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/network-failure.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/performance.integration.spec.ts (97%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/provider-switch.integration.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/repair-sync.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/repeat-task-sync.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/server-migration.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/service-logic.integration.spec.ts (92%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/state-consistency.integration.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/sync-scenarios.integration.spec.ts (99%) rename src/app/{core/persistence/operation-log => op-log/testing}/integration/vector-clock-sync.integration.spec.ts (97%) rename src/app/{core/persistence/operation-log => op-log/util}/client-id.provider.ts (96%) rename src/app/{core/persistence/operation-log => op-log/util}/entity-key.util.spec.ts (98%) rename src/app/{core/persistence/operation-log => op-log/util}/entity-key.util.ts (94%) rename src/app/{core/persistence/operation-log/processing => op-log/validation}/repair-operation.service.spec.ts (99%) rename src/app/{core/persistence/operation-log/processing => op-log/validation}/repair-operation.service.ts (93%) rename src/app/{core/persistence/operation-log/processing => op-log/validation}/validate-operation-payload.spec.ts (99%) rename src/app/{core/persistence/operation-log/processing => op-log/validation}/validate-operation-payload.ts (99%) rename src/app/{core/persistence/operation-log/processing => op-log/validation}/validate-state.service.spec.ts (91%) rename src/app/{core/persistence/operation-log/processing => op-log/validation}/validate-state.service.ts (94%) diff --git a/docs/ai/adding-new-entity-type-checklist.md b/docs/ai/adding-new-entity-type-checklist.md index 5a1076df5..ef5e06be3 100644 --- a/docs/ai/adding-new-entity-type-checklist.md +++ b/docs/ai/adding-new-entity-type-checklist.md @@ -4,11 +4,11 @@ This checklist ensures new entity types integrate properly with the operation lo ## When adding a new entity type: -### 1. Type Definition (`src/app/core/persistence/operation-log/operation.types.ts`) +### 1. Type Definition (`src/app/op-log/core/operation.types.ts`) - [ ] Add to `EntityType` union (line ~15) -### 2. Entity Registry (`src/app/core/persistence/operation-log/entity-registry.ts`) +### 2. Entity Registry (`src/app/op-log/core/entity-registry.ts`) - [ ] Add entry to `ENTITY_CONFIGS` with: - `storagePattern`: 'adapter' | 'singleton' | 'map' | 'array' | 'virtual' @@ -21,7 +21,7 @@ This checklist ensures new entity types integrate properly with the operation lo - **array**: `selectState`, `arrayKey` - **virtual**: just `payloadKey` -### 3. Test Arrays (`src/app/core/persistence/operation-log/entity-registry.spec.ts`) +### 3. Test Arrays (`src/app/op-log/core/entity-registry.spec.ts`) - [ ] Add to `REGULAR_ENTITY_TYPES` array (line ~17) OR `SPECIAL_OPERATION_TYPES` if special - [ ] Add to appropriate category array: @@ -64,11 +64,11 @@ updateTasks: (taskProps: { tasks: Update[] }) => ({ ```bash # Check the modified files -npm run checkFile src/app/core/persistence/operation-log/entity-registry.ts -npm run checkFile src/app/core/persistence/operation-log/operation.types.ts +npm run checkFile src/app/op-log/core/entity-registry.ts +npm run checkFile src/app/op-log/core/operation.types.ts # Run the entity registry tests -npm run test:file src/app/core/persistence/operation-log/entity-registry.spec.ts +npm run test:file src/app/op-log/core/entity-registry.spec.ts ``` ## Why this matters diff --git a/docs/sync-and-op-log/long-term-plans/e2e-encryption-plan.md b/docs/sync-and-op-log/long-term-plans/e2e-encryption-plan.md index d8c92b3ce..13fa04538 100644 --- a/docs/sync-and-op-log/long-term-plans/e2e-encryption-plan.md +++ b/docs/sync-and-op-log/long-term-plans/e2e-encryption-plan.md @@ -5,7 +5,7 @@ > This plan has been fully implemented. For the current implementation details, see: > > - [supersync-encryption-architecture.md](../supersync-encryption-architecture.md) - Implementation documentation with diagrams -> - `src/app/core/persistence/operation-log/sync/operation-encryption.service.ts` - Core encryption service +> - `src/app/op-log/sync/operation-encryption.service.ts` - Core encryption service ## Summary @@ -86,7 +86,7 @@ export interface SuperSyncPrivateCfg extends SyncProviderPrivateCfgBase { ### Phase 2: Client-Side Encryption Service -**New file:** `src/app/core/persistence/operation-log/sync/operation-encryption.service.ts` +**New file:** `src/app/op-log/sync/operation-encryption.service.ts` ```typescript import { inject, Injectable } from '@angular/core'; @@ -154,7 +154,7 @@ export class OperationEncryptionService { ### Phase 3: Upload Integration -**File:** `src/app/core/persistence/operation-log/sync/operation-log-upload.service.ts` +**File:** `src/app/op-log/sync/operation-log-upload.service.ts` Modify `_uploadPendingOpsViaApi()`: @@ -188,7 +188,7 @@ if (response.newOps && response.newOps.length > 0) { ### Phase 4: Download Integration -**File:** `src/app/core/persistence/operation-log/sync/operation-log-download.service.ts` +**File:** `src/app/op-log/sync/operation-log-download.service.ts` Modify `_downloadRemoteOpsViaApi()`: @@ -304,22 +304,22 @@ Simple dialog to prompt for encryption password when needed: ### New Files -| File | Purpose | -| ----------------------------------------------------------------------------- | -------------------------- | -| `src/app/core/persistence/operation-log/sync/operation-encryption.service.ts` | Encrypt/decrypt operations | -| `src/app/imex/sync/dialog-encryption-password/` | Password prompt dialog | +| File | Purpose | +| ----------------------------------------------------- | -------------------------- | +| `src/app/op-log/sync/operation-encryption.service.ts` | Encrypt/decrypt operations | +| `src/app/imex/sync/dialog-encryption-password/` | Password prompt dialog | ### Modified Files -| File | Changes | -| ------------------------------------------------------------------------------- | ----------------------------------------- | -| `src/app/pfapi/api/sync/sync-provider.interface.ts` | Add `isPayloadEncrypted` to SyncOperation | -| `src/app/pfapi/api/sync/providers/super-sync/super-sync.model.ts` | Add `isEncryptionEnabled` flag | -| `src/app/core/persistence/operation-log/sync/operation-log-upload.service.ts` | Encrypt before upload | -| `src/app/core/persistence/operation-log/sync/operation-log-download.service.ts` | Decrypt after download | -| `src/app/features/config/form-cfgs/sync-form.const.ts` | Add encryption toggle + password field | -| `src/app/t.const.ts` | Add translation keys | -| `src/assets/i18n/en.json` | Add translation strings | +| File | Changes | +| ----------------------------------------------------------------- | ----------------------------------------- | +| `src/app/pfapi/api/sync/sync-provider.interface.ts` | Add `isPayloadEncrypted` to SyncOperation | +| `src/app/pfapi/api/sync/providers/super-sync/super-sync.model.ts` | Add `isEncryptionEnabled` flag | +| `src/app/op-log/sync/operation-log-upload.service.ts` | Encrypt before upload | +| `src/app/op-log/sync/operation-log-download.service.ts` | Decrypt after download | +| `src/app/features/config/form-cfgs/sync-form.const.ts` | Add encryption toggle + password field | +| `src/app/t.const.ts` | Add translation keys | +| `src/assets/i18n/en.json` | Add translation strings | ### No Server Changes Required diff --git a/docs/sync-and-op-log/long-term-plans/hybrid-manifest-architecture.md b/docs/sync-and-op-log/long-term-plans/hybrid-manifest-architecture.md index 1f9d6b119..eaaa4ce63 100644 --- a/docs/sync-and-op-log/long-term-plans/hybrid-manifest-architecture.md +++ b/docs/sync-and-op-log/long-term-plans/hybrid-manifest-architecture.md @@ -615,7 +615,7 @@ The following questions were resolved during implementation: ### Code Files ``` -src/app/core/persistence/operation-log/ +src/app/op-log/ ├── operation.types.ts # HybridManifest, SnapshotReference types ├── store/ │ └── operation-log-manifest.service.ts # Manifest management diff --git a/docs/sync-and-op-log/long-term-plans/replace-pfapi-with-oplog-plan.md b/docs/sync-and-op-log/long-term-plans/replace-pfapi-with-oplog-plan.md index 2e5222973..15b2a97f8 100644 --- a/docs/sync-and-op-log/long-term-plans/replace-pfapi-with-oplog-plan.md +++ b/docs/sync-and-op-log/long-term-plans/replace-pfapi-with-oplog-plan.md @@ -38,7 +38,7 @@ Simplify the codebase by removing PFAPI's model-by-model sync and using operatio **New file:** -- `src/app/core/persistence/operation-log/migration/pfapi-migration.service.ts` +- `src/app/op-log/migration/pfapi-migration.service.ts` **Migration flow:** @@ -93,10 +93,10 @@ src/app/pfapi/api/sync/providers/local-file-sync/local-file-sync-base.ts ### Operation Log Sync ``` -src/app/core/persistence/operation-log/sync/operation-log-upload.service.ts -src/app/core/persistence/operation-log/sync/operation-log-download.service.ts -src/app/core/persistence/operation-log/sync/operation-log-manifest.service.ts -src/app/core/persistence/operation-log/sync/operation-log-sync.service.ts +src/app/op-log/sync/operation-log-upload.service.ts +src/app/op-log/sync/operation-log-download.service.ts +src/app/op-log/sync/operation-log-manifest.service.ts +src/app/op-log/sync/operation-log-sync.service.ts ``` ### PFAPI (to simplify/remove) diff --git a/docs/sync-and-op-log/operation-log-architecture.md b/docs/sync-and-op-log/operation-log-architecture.md index db9453d41..ef2b2da52 100644 --- a/docs/sync-and-op-log/operation-log-architecture.md +++ b/docs/sync-and-op-log/operation-log-architecture.md @@ -556,7 +556,7 @@ When Super Productivity's data model changes (new fields, renamed properties, re ### Configuration -`CURRENT_SCHEMA_VERSION` is defined in `src/app/core/persistence/operation-log/schema-migration.service.ts`: +`CURRENT_SCHEMA_VERSION` is defined in `src/app/op-log/store/schema-migration.service.ts`: ```typescript export const CURRENT_SCHEMA_VERSION = 1; @@ -730,7 +730,7 @@ async handleFullStateImport(payload: { appDataComplete: AppDataComplete }): Prom ### A.7.5 Migration Implementation -Migrations are defined in `src/app/core/persistence/operation-log/schema-migration.service.ts`. +Migrations are defined in `src/app/op-log/store/schema-migration.service.ts`. **How to Create a New Migration:** @@ -1986,7 +1986,7 @@ When adding new entities or relationships: # File Reference ``` -src/app/core/persistence/operation-log/ +src/app/op-log/ ├── operation.types.ts # Type definitions (Operation, OpType, EntityType) ├── operation-log.const.ts # Constants (thresholds, timeouts, limits) ├── operation-log.effects.ts # Action capture + META_MODEL bridge diff --git a/docs/sync-and-op-log/quick-reference.md b/docs/sync-and-op-log/quick-reference.md index 1f5abf838..3a0216bed 100644 --- a/docs/sync-and-op-log/quick-reference.md +++ b/docs/sync-and-op-log/quick-reference.md @@ -719,24 +719,43 @@ Remote Storage (WebDAV/Dropbox folder): ## File Reference ``` -src/app/core/persistence/operation-log/ -├── operation.types.ts # Type definitions -├── operation-log.const.ts # Constants -├── operation-log.effects.ts # Write path effect -├── store/ +src/app/op-log/ +├── core/ # Types, constants, errors +│ ├── operation.types.ts # Type definitions +│ ├── operation-log.const.ts # Constants +│ ├── persistent-action.interface.ts # Action interface +│ └── entity-registry.ts # Entity type registry +├── capture/ # Write path: Actions → Operations +│ ├── operation-capture.meta-reducer.ts # Captures persistent actions +│ ├── operation-capture.service.ts # FIFO queue +│ └── operation-log.effects.ts # Writes to IndexedDB +├── apply/ # Read path: Operations → State +│ ├── bulk-hydration.action.ts # Bulk apply action +│ ├── bulk-hydration.meta-reducer.ts # Applies ops in single pass +│ ├── operation-applier.service.ts # Apply ops to NgRx +│ ├── operation-converter.util.ts # Op → Action conversion +│ ├── hydration-state.service.ts # Tracks hydration state +│ └── archive-operation-handler.service.ts # Archive side effects +├── store/ # IndexedDB persistence │ ├── operation-log-store.service.ts # IndexedDB wrapper -│ ├── operation-log-hydrator.service.ts # Hydration +│ ├── operation-log-hydrator.service.ts # Startup hydration +│ ├── operation-log-compaction.service.ts # Snapshot + GC │ └── schema-migration.service.ts # Schema migrations -├── sync/ +├── sync/ # Server sync (SuperSync) │ ├── operation-log-sync.service.ts # Sync orchestration │ ├── operation-log-upload.service.ts # Upload logic │ ├── operation-log-download.service.ts # Download logic │ ├── conflict-resolution.service.ts # LWW resolution │ ├── sync-import-filter.service.ts # SYNC_IMPORT filtering -│ └── vector-clock.service.ts # Clock management -└── processing/ - ├── operation-applier.service.ts # Apply ops to NgRx - ├── operation-capture.meta-reducer.ts # Capture actions - ├── operation-capture.service.ts # FIFO queue - └── archive-operation-handler.service.ts # Archive side effects +│ ├── vector-clock.service.ts # Clock management +│ └── operation-encryption.service.ts # E2E encryption +├── validation/ # State validation +│ ├── validate-state.service.ts # State consistency checks +│ └── validate-operation-payload.ts # Operation validation +├── util/ # Shared utilities +│ ├── entity-key.util.ts # Entity key helpers +│ └── client-id.provider.ts # Client ID management +└── testing/ # Test infrastructure + ├── integration/ # Integration tests + └── benchmarks/ # Performance tests ``` diff --git a/docs/sync-and-op-log/supersync-encryption-architecture.md b/docs/sync-and-op-log/supersync-encryption-architecture.md index b78c55e72..c8d20c88a 100644 --- a/docs/sync-and-op-log/supersync-encryption-architecture.md +++ b/docs/sync-and-op-log/supersync-encryption-architecture.md @@ -159,7 +159,7 @@ SuperSync uses **AES-256-GCM** encryption with **Argon2id** key derivation for e ### 1. OperationEncryptionService -**Location**: `src/app/core/persistence/operation-log/sync/operation-encryption.service.ts` +**Location**: `src/app/op-log/sync/operation-encryption.service.ts` ```typescript // Encrypt before upload @@ -189,7 +189,7 @@ async decryptOperation(op: SyncOperation, encryptKey: string): Promise ({ ...tagProps, diff --git a/src/app/features/tag/store/tag.effects.spec.ts b/src/app/features/tag/store/tag.effects.spec.ts index 16020eb96..65adbedff 100644 --- a/src/app/features/tag/store/tag.effects.spec.ts +++ b/src/app/features/tag/store/tag.effects.spec.ts @@ -6,7 +6,7 @@ import { TagEffects } from './tag.effects'; import { updateTag } from './tag.actions'; import { TODAY_TAG } from '../tag.const'; import { selectTodayTagRepair } from '../../work-context/store/work-context.selectors'; -import { HydrationStateService } from '../../../core/persistence/operation-log/processing/hydration-state.service'; +import { HydrationStateService } from '../../../op-log/apply/hydration-state.service'; import { SnackService } from '../../../core/snack/snack.service'; import { TagService } from '../tag.service'; import { WorkContextService } from '../../work-context/work-context.service'; diff --git a/src/app/features/task-repeat-cfg/store/task-repeat-cfg.actions.ts b/src/app/features/task-repeat-cfg/store/task-repeat-cfg.actions.ts index fc72ae62f..516243b86 100644 --- a/src/app/features/task-repeat-cfg/store/task-repeat-cfg.actions.ts +++ b/src/app/features/task-repeat-cfg/store/task-repeat-cfg.actions.ts @@ -1,8 +1,8 @@ import { createAction, props } from '@ngrx/store'; import { Update } from '@ngrx/entity'; import { TaskRepeatCfg } from '../task-repeat-cfg.model'; -import { PersistentActionMeta } from '../../../core/persistence/operation-log/persistent-action.interface'; -import { OpType } from '../../../core/persistence/operation-log/operation.types'; +import { PersistentActionMeta } from '../../../op-log/core/persistent-action.interface'; +import { OpType } from '../../../op-log/core/operation.types'; export const addTaskRepeatCfgToTask = createAction( '[TaskRepeatCfg][Task] Add TaskRepeatCfg to Task', diff --git a/src/app/features/tasks/store/task-due.effects.ts b/src/app/features/tasks/store/task-due.effects.ts index 73c7ac1dd..956645769 100644 --- a/src/app/features/tasks/store/task-due.effects.ts +++ b/src/app/features/tasks/store/task-due.effects.ts @@ -21,7 +21,7 @@ import { getDbDateStr } from '../../../util/get-db-date-str'; import { TaskLog } from '../../../core/log'; import { SyncTriggerService } from '../../../imex/sync/sync-trigger.service'; import { environment } from '../../../../environments/environment'; -import { HydrationStateService } from '../../../core/persistence/operation-log/processing/hydration-state.service'; +import { HydrationStateService } from '../../../op-log/apply/hydration-state.service'; @Injectable() export class TaskDueEffects { diff --git a/src/app/features/tasks/store/task-related-model.effects.spec.ts b/src/app/features/tasks/store/task-related-model.effects.spec.ts index a1d15c8e6..859afc2c9 100644 --- a/src/app/features/tasks/store/task-related-model.effects.spec.ts +++ b/src/app/features/tasks/store/task-related-model.effects.spec.ts @@ -7,7 +7,7 @@ import { Action } from '@ngrx/store'; import { TaskRelatedModelEffects } from './task-related-model.effects'; import { TaskService } from '../task.service'; import { GlobalConfigService } from '../../config/global-config.service'; -import { HydrationStateService } from '../../../core/persistence/operation-log/processing/hydration-state.service'; +import { HydrationStateService } from '../../../op-log/apply/hydration-state.service'; import { LOCAL_ACTIONS } from '../../../util/local-actions.token'; import { TaskSharedActions } from '../../../root-store/meta/task-shared.actions'; import { DEFAULT_TASK, Task } from '../task.model'; diff --git a/src/app/features/tasks/store/task-related-model.effects.ts b/src/app/features/tasks/store/task-related-model.effects.ts index ac5f098af..78327a559 100644 --- a/src/app/features/tasks/store/task-related-model.effects.ts +++ b/src/app/features/tasks/store/task-related-model.effects.ts @@ -12,7 +12,7 @@ import { TimeTrackingActions } from '../../time-tracking/store/time-tracking.act import { Store } from '@ngrx/store'; import { selectTodayTaskIds } from '../../work-context/store/work-context.selectors'; import { LOCAL_ACTIONS } from '../../../util/local-actions.token'; -import { HydrationStateService } from '../../../core/persistence/operation-log/processing/hydration-state.service'; +import { HydrationStateService } from '../../../op-log/apply/hydration-state.service'; import { getDbDateStr } from '../../../util/get-db-date-str'; @Injectable() diff --git a/src/app/features/tasks/store/task.actions.ts b/src/app/features/tasks/store/task.actions.ts index e19b78833..8612d3ded 100644 --- a/src/app/features/tasks/store/task.actions.ts +++ b/src/app/features/tasks/store/task.actions.ts @@ -2,8 +2,8 @@ import { createAction, props } from '@ngrx/store'; import { Update } from '@ngrx/entity'; import { Task, TaskDetailTargetPanel } from '../task.model'; import { RoundTimeOption } from '../../project/project.model'; -import { PersistentActionMeta } from '../../../core/persistence/operation-log/persistent-action.interface'; -import { OpType } from '../../../core/persistence/operation-log/operation.types'; +import { PersistentActionMeta } from '../../../op-log/core/persistent-action.interface'; +import { OpType } from '../../../op-log/core/operation.types'; export const setCurrentTask = createAction( '[Task] SetCurrentTask', diff --git a/src/app/features/tasks/store/task.reducer.ts b/src/app/features/tasks/store/task.reducer.ts index d1e4890b2..22b833063 100644 --- a/src/app/features/tasks/store/task.reducer.ts +++ b/src/app/features/tasks/store/task.reducer.ts @@ -1,4 +1,4 @@ -import { PersistentActionMeta } from '../../../core/persistence/operation-log/persistent-action.interface'; +import { PersistentActionMeta } from '../../../op-log/core/persistent-action.interface'; import { __updateMultipleTaskSimple, addSubTask, diff --git a/src/app/features/tasks/task-attachment/task-attachment.actions.ts b/src/app/features/tasks/task-attachment/task-attachment.actions.ts index 842c99866..32a7bc1ca 100644 --- a/src/app/features/tasks/task-attachment/task-attachment.actions.ts +++ b/src/app/features/tasks/task-attachment/task-attachment.actions.ts @@ -1,8 +1,8 @@ import { Update } from '@ngrx/entity'; import { TaskAttachment } from './task-attachment.model'; import { createAction } from '@ngrx/store'; -import { PersistentActionMeta } from '../../../core/persistence/operation-log/persistent-action.interface'; -import { OpType } from '../../../core/persistence/operation-log/operation.types'; +import { PersistentActionMeta } from '../../../op-log/core/persistent-action.interface'; +import { OpType } from '../../../op-log/core/operation.types'; // NOTE: all is handled in task reducer too export const addTaskAttachment = createAction( diff --git a/src/app/features/time-tracking/store/archive.actions.ts b/src/app/features/time-tracking/store/archive.actions.ts index 0b3c9d9c3..dd2a21e94 100644 --- a/src/app/features/time-tracking/store/archive.actions.ts +++ b/src/app/features/time-tracking/store/archive.actions.ts @@ -1,6 +1,6 @@ import { createAction } from '@ngrx/store'; -import { PersistentActionMeta } from '../../../core/persistence/operation-log/persistent-action.interface'; -import { OpType } from '../../../core/persistence/operation-log/operation.types'; +import { PersistentActionMeta } from '../../../op-log/core/persistent-action.interface'; +import { OpType } from '../../../op-log/core/operation.types'; /** * Non-persistent action dispatched after remote archive-affecting operations diff --git a/src/app/features/time-tracking/store/time-tracking.actions.ts b/src/app/features/time-tracking/store/time-tracking.actions.ts index ca0e1c74b..87db66b10 100644 --- a/src/app/features/time-tracking/store/time-tracking.actions.ts +++ b/src/app/features/time-tracking/store/time-tracking.actions.ts @@ -3,8 +3,8 @@ import { createAction, createActionGroup, props } from '@ngrx/store'; import { WorkContextType } from '../../work-context/work-context.model'; import { TimeTrackingState, TTWorkContextData } from '../time-tracking.model'; import { Task } from '../../tasks/task.model'; -import { PersistentActionMeta } from '../../../core/persistence/operation-log/persistent-action.interface'; -import { OpType } from '../../../core/persistence/operation-log/operation.types'; +import { PersistentActionMeta } from '../../../op-log/core/persistent-action.interface'; +import { OpType } from '../../../op-log/core/operation.types'; // Standalone persistent action for updating work context data (manual worklog edits) export const updateWorkContextData = createAction( diff --git a/src/app/features/work-context/store/work-context-meta.actions.ts b/src/app/features/work-context/store/work-context-meta.actions.ts index d762bb6fd..db7b48048 100644 --- a/src/app/features/work-context/store/work-context-meta.actions.ts +++ b/src/app/features/work-context/store/work-context-meta.actions.ts @@ -2,8 +2,8 @@ import { createAction } from '@ngrx/store'; import { DropListModelSource } from '../../tasks/task.model'; import { WorkContextType } from '../work-context.model'; -import { PersistentActionMeta } from '../../../core/persistence/operation-log/persistent-action.interface'; -import { OpType } from '../../../core/persistence/operation-log/operation.types'; +import { PersistentActionMeta } from '../../../op-log/core/persistent-action.interface'; +import { OpType } from '../../../op-log/core/operation.types'; export const moveTaskInTodayList = createAction( '[WorkContextMeta] Move Task in Today', diff --git a/src/app/imex/sync/encryption-password-change.service.spec.ts b/src/app/imex/sync/encryption-password-change.service.spec.ts index 78d7da8e8..2317a2ef0 100644 --- a/src/app/imex/sync/encryption-password-change.service.spec.ts +++ b/src/app/imex/sync/encryption-password-change.service.spec.ts @@ -2,9 +2,9 @@ import { TestBed } from '@angular/core/testing'; import { EncryptionPasswordChangeService } from './encryption-password-change.service'; import { PfapiService } from '../../pfapi/pfapi.service'; import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; -import { OperationEncryptionService } from '../../core/persistence/operation-log/sync/operation-encryption.service'; -import { VectorClockService } from '../../core/persistence/operation-log/sync/vector-clock.service'; -import { CLIENT_ID_PROVIDER } from '../../core/persistence/operation-log/client-id.provider'; +import { OperationEncryptionService } from '../../op-log/sync/operation-encryption.service'; +import { VectorClockService } from '../../op-log/sync/vector-clock.service'; +import { CLIENT_ID_PROVIDER } from '../../op-log/util/client-id.provider'; import { SyncProviderId } from '../../pfapi/api/pfapi.const'; describe('EncryptionPasswordChangeService', () => { diff --git a/src/app/imex/sync/encryption-password-change.service.ts b/src/app/imex/sync/encryption-password-change.service.ts index 16f3b16f6..d2cbb21af 100644 --- a/src/app/imex/sync/encryption-password-change.service.ts +++ b/src/app/imex/sync/encryption-password-change.service.ts @@ -1,16 +1,16 @@ import { inject, Injectable } from '@angular/core'; import { PfapiService } from '../../pfapi/pfapi.service'; import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; -import { OperationEncryptionService } from '../../core/persistence/operation-log/sync/operation-encryption.service'; -import { VectorClockService } from '../../core/persistence/operation-log/sync/vector-clock.service'; +import { OperationEncryptionService } from '../../op-log/sync/operation-encryption.service'; +import { VectorClockService } from '../../op-log/sync/vector-clock.service'; import { CLIENT_ID_PROVIDER, ClientIdProvider, -} from '../../core/persistence/operation-log/client-id.provider'; -import { isOperationSyncCapable } from '../../core/persistence/operation-log/sync/operation-sync.util'; +} from '../../op-log/util/client-id.provider'; +import { isOperationSyncCapable } from '../../op-log/sync/operation-sync.util'; import { SyncProviderId } from '../../pfapi/api/pfapi.const'; import { SuperSyncPrivateCfg } from '../../pfapi/api/sync/providers/super-sync/super-sync.model'; -import { CURRENT_SCHEMA_VERSION } from '../../core/persistence/operation-log/store/schema-migration.service'; +import { CURRENT_SCHEMA_VERSION } from '../../op-log/store/schema-migration.service'; import { SyncLog } from '../../core/log'; /** diff --git a/src/app/imex/sync/sync-wrapper.service.ts b/src/app/imex/sync/sync-wrapper.service.ts index 9a928a130..ac7737fab 100644 --- a/src/app/imex/sync/sync-wrapper.service.ts +++ b/src/app/imex/sync/sync-wrapper.service.ts @@ -49,9 +49,9 @@ import { devError } from '../../util/dev-error'; import { UserInputWaitStateService } from './user-input-wait-state.service'; import { LegacySyncProvider } from './legacy-sync-provider.model'; import { SYNC_WAIT_TIMEOUT_MS, SYNC_REINIT_DELAY_MS } from './sync.const'; -import { SuperSyncStatusService } from '../../core/persistence/operation-log/sync/super-sync-status.service'; +import { SuperSyncStatusService } from '../../op-log/sync/super-sync-status.service'; import { IS_ELECTRON } from '../../app.constants'; -import { OperationLogStoreService } from '../../core/persistence/operation-log/store/operation-log-store.service'; +import { OperationLogStoreService } from '../../op-log/store/operation-log-store.service'; /** * Converts LegacySyncProvider to SyncProviderId. diff --git a/src/app/core/persistence/operation-log/processing/archive-operation-handler.effects.spec.ts b/src/app/op-log/apply/archive-operation-handler.effects.spec.ts similarity index 93% rename from src/app/core/persistence/operation-log/processing/archive-operation-handler.effects.spec.ts rename to src/app/op-log/apply/archive-operation-handler.effects.spec.ts index bb1b92c67..f68b74e27 100644 --- a/src/app/core/persistence/operation-log/processing/archive-operation-handler.effects.spec.ts +++ b/src/app/op-log/apply/archive-operation-handler.effects.spec.ts @@ -6,15 +6,15 @@ import { ArchiveOperationHandler, isArchiveAffectingAction, } from './archive-operation-handler.service'; -import { LOCAL_ACTIONS } from '../../../../util/local-actions.token'; -import { TaskSharedActions } from '../../../../root-store/meta/task-shared.actions'; -import { flushYoungToOld } from '../../../../features/time-tracking/store/archive.actions'; -import { deleteTag } from '../../../../features/tag/store/tag.actions'; +import { LOCAL_ACTIONS } from '../../util/local-actions.token'; +import { TaskSharedActions } from '../../root-store/meta/task-shared.actions'; +import { flushYoungToOld } from '../../features/time-tracking/store/archive.actions'; +import { deleteTag } from '../../features/tag/store/tag.actions'; import { Action } from '@ngrx/store'; -import { Task, TaskWithSubTasks } from '../../../../features/tasks/task.model'; -import { WorkContextType } from '../../../../features/work-context/work-context.model'; -import { SnackService } from '../../../snack/snack.service'; -import { WorklogService } from '../../../../features/worklog/worklog.service'; +import { Task, TaskWithSubTasks } from '../../features/tasks/task.model'; +import { WorkContextType } from '../../features/work-context/work-context.model'; +import { SnackService } from '../../core/snack/snack.service'; +import { WorklogService } from '../../features/worklog/worklog.service'; describe('ArchiveOperationHandlerEffects', () => { let effects: ArchiveOperationHandlerEffects; diff --git a/src/app/core/persistence/operation-log/processing/archive-operation-handler.effects.ts b/src/app/op-log/apply/archive-operation-handler.effects.ts similarity index 91% rename from src/app/core/persistence/operation-log/processing/archive-operation-handler.effects.ts rename to src/app/op-log/apply/archive-operation-handler.effects.ts index 9b9dd25a8..5468b670b 100644 --- a/src/app/core/persistence/operation-log/processing/archive-operation-handler.effects.ts +++ b/src/app/op-log/apply/archive-operation-handler.effects.ts @@ -1,16 +1,16 @@ import { inject, Injectable } from '@angular/core'; import { Actions, createEffect, ofType } from '@ngrx/effects'; -import { LOCAL_ACTIONS } from '../../../../util/local-actions.token'; +import { LOCAL_ACTIONS } from '../../util/local-actions.token'; import { concatMap, filter, tap } from 'rxjs/operators'; import { ArchiveOperationHandler, isArchiveAffectingAction, } from './archive-operation-handler.service'; -import { devError } from '../../../../util/dev-error'; -import { SnackService } from '../../../snack/snack.service'; -import { T } from '../../../../t.const'; -import { remoteArchiveDataApplied } from '../../../../features/time-tracking/store/archive.actions'; -import { WorklogService } from '../../../../features/worklog/worklog.service'; +import { devError } from '../../util/dev-error'; +import { SnackService } from '../../core/snack/snack.service'; +import { T } from '../../t.const'; +import { remoteArchiveDataApplied } from '../../features/time-tracking/store/archive.actions'; +import { WorklogService } from '../../features/worklog/worklog.service'; /** * Unified effect for all archive-affecting operations. diff --git a/src/app/core/persistence/operation-log/processing/archive-operation-handler.service.spec.ts b/src/app/op-log/apply/archive-operation-handler.service.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/processing/archive-operation-handler.service.spec.ts rename to src/app/op-log/apply/archive-operation-handler.service.spec.ts index fc3ab0c37..9ecd9d0c4 100644 --- a/src/app/core/persistence/operation-log/processing/archive-operation-handler.service.spec.ts +++ b/src/app/op-log/apply/archive-operation-handler.service.spec.ts @@ -3,17 +3,17 @@ import { ArchiveOperationHandler, isArchiveAffectingAction, } from './archive-operation-handler.service'; -import { PersistentAction } from '../persistent-action.interface'; -import { ArchiveService } from '../../../../features/time-tracking/archive.service'; -import { TaskArchiveService } from '../../../../features/time-tracking/task-archive.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { Task, TaskWithSubTasks } from '../../../../features/tasks/task.model'; -import { ArchiveModel } from '../../../../features/time-tracking/time-tracking.model'; -import { TaskSharedActions } from '../../../../root-store/meta/task-shared.actions'; -import { flushYoungToOld } from '../../../../features/time-tracking/store/archive.actions'; -import { deleteTag, deleteTags } from '../../../../features/tag/store/tag.actions'; -import { TimeTrackingService } from '../../../../features/time-tracking/time-tracking.service'; -import { loadAllData } from '../../../../root-store/meta/load-all-data.action'; +import { PersistentAction } from '../core/persistent-action.interface'; +import { ArchiveService } from '../../features/time-tracking/archive.service'; +import { TaskArchiveService } from '../../features/time-tracking/task-archive.service'; +import { PfapiService } from '../../pfapi/pfapi.service'; +import { Task, TaskWithSubTasks } from '../../features/tasks/task.model'; +import { ArchiveModel } from '../../features/time-tracking/time-tracking.model'; +import { TaskSharedActions } from '../../root-store/meta/task-shared.actions'; +import { flushYoungToOld } from '../../features/time-tracking/store/archive.actions'; +import { deleteTag, deleteTags } from '../../features/tag/store/tag.actions'; +import { TimeTrackingService } from '../../features/time-tracking/time-tracking.service'; +import { loadAllData } from '../../root-store/meta/load-all-data.action'; describe('isArchiveAffectingAction', () => { it('should return true for moveToArchive action', () => { diff --git a/src/app/core/persistence/operation-log/processing/archive-operation-handler.service.ts b/src/app/op-log/apply/archive-operation-handler.service.ts similarity index 93% rename from src/app/core/persistence/operation-log/processing/archive-operation-handler.service.ts rename to src/app/op-log/apply/archive-operation-handler.service.ts index a8b2bd455..ce5c51988 100644 --- a/src/app/core/persistence/operation-log/processing/archive-operation-handler.service.ts +++ b/src/app/op-log/apply/archive-operation-handler.service.ts @@ -1,25 +1,25 @@ import { inject, Injectable, Injector } from '@angular/core'; import { Update } from '@ngrx/entity'; import { Action } from '@ngrx/store'; -import { PersistentAction } from '../persistent-action.interface'; -import { Task } from '../../../../features/tasks/task.model'; -import { TaskSharedActions } from '../../../../root-store/meta/task-shared.actions'; +import { PersistentAction } from '../core/persistent-action.interface'; +import { Task } from '../../features/tasks/task.model'; +import { TaskSharedActions } from '../../root-store/meta/task-shared.actions'; import { compressArchive, flushYoungToOld, -} from '../../../../features/time-tracking/store/archive.actions'; -import { ArchiveService } from '../../../../features/time-tracking/archive.service'; -import { TaskArchiveService } from '../../../../features/time-tracking/task-archive.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { sortTimeTrackingAndTasksFromArchiveYoungToOld } from '../../../../features/time-tracking/sort-data-to-flush'; -import { ARCHIVE_TASK_YOUNG_TO_OLD_THRESHOLD } from '../../../../features/time-tracking/archive.service'; -import { OpLog } from '../../../log'; -import { lazyInject } from '../../../../util/lazy-inject'; -import { deleteTag, deleteTags } from '../../../../features/tag/store/tag.actions'; -import { TimeTrackingService } from '../../../../features/time-tracking/time-tracking.service'; -import { ArchiveCompressionService } from '../../../../features/time-tracking/archive-compression.service'; -import { loadAllData } from '../../../../root-store/meta/load-all-data.action'; -import { ArchiveModel } from '../../../../features/time-tracking/time-tracking.model'; +} from '../../features/time-tracking/store/archive.actions'; +import { ArchiveService } from '../../features/time-tracking/archive.service'; +import { TaskArchiveService } from '../../features/time-tracking/task-archive.service'; +import { PfapiService } from '../../pfapi/pfapi.service'; +import { sortTimeTrackingAndTasksFromArchiveYoungToOld } from '../../features/time-tracking/sort-data-to-flush'; +import { ARCHIVE_TASK_YOUNG_TO_OLD_THRESHOLD } from '../../features/time-tracking/archive.service'; +import { OpLog } from '../../core/log'; +import { lazyInject } from '../../util/lazy-inject'; +import { deleteTag, deleteTags } from '../../features/tag/store/tag.actions'; +import { TimeTrackingService } from '../../features/time-tracking/time-tracking.service'; +import { ArchiveCompressionService } from '../../features/time-tracking/archive-compression.service'; +import { loadAllData } from '../../root-store/meta/load-all-data.action'; +import { ArchiveModel } from '../../features/time-tracking/time-tracking.model'; /** * Action types that affect archive storage and require special handling. diff --git a/src/app/core/persistence/operation-log/bulk-hydration.action.ts b/src/app/op-log/apply/bulk-hydration.action.ts similarity index 94% rename from src/app/core/persistence/operation-log/bulk-hydration.action.ts rename to src/app/op-log/apply/bulk-hydration.action.ts index 5bc542921..ad2a12a7d 100644 --- a/src/app/core/persistence/operation-log/bulk-hydration.action.ts +++ b/src/app/op-log/apply/bulk-hydration.action.ts @@ -1,5 +1,5 @@ import { createAction, props } from '@ngrx/store'; -import { Operation } from './operation.types'; +import { Operation } from '../core/operation.types'; /** * Action to bulk-apply operations in a single NgRx dispatch. diff --git a/src/app/core/persistence/operation-log/bulk-hydration.meta-reducer.spec.ts b/src/app/op-log/apply/bulk-hydration.meta-reducer.spec.ts similarity index 96% rename from src/app/core/persistence/operation-log/bulk-hydration.meta-reducer.spec.ts rename to src/app/op-log/apply/bulk-hydration.meta-reducer.spec.ts index 5d5ca497e..8e4684eb8 100644 --- a/src/app/core/persistence/operation-log/bulk-hydration.meta-reducer.spec.ts +++ b/src/app/op-log/apply/bulk-hydration.meta-reducer.spec.ts @@ -1,14 +1,14 @@ import { Action } from '@ngrx/store'; import { bulkHydrationMetaReducer } from './bulk-hydration.meta-reducer'; import { bulkApplyHydrationOperations } from './bulk-hydration.action'; -import { Operation, OpType } from './operation.types'; -import { RootState } from '../../../root-store/root-state'; -import { TASK_FEATURE_NAME } from '../../../features/tasks/store/task.reducer'; -import { PROJECT_FEATURE_NAME } from '../../../features/project/store/project.reducer'; -import { TAG_FEATURE_NAME } from '../../../features/tag/store/tag.reducer'; -import { Task } from '../../../features/tasks/task.model'; -import { Project } from '../../../features/project/project.model'; -import { Tag } from '../../../features/tag/tag.model'; +import { Operation, OpType } from '../core/operation.types'; +import { RootState } from '../../root-store/root-state'; +import { TASK_FEATURE_NAME } from '../../features/tasks/store/task.reducer'; +import { PROJECT_FEATURE_NAME } from '../../features/project/store/project.reducer'; +import { TAG_FEATURE_NAME } from '../../features/tag/store/tag.reducer'; +import { Task } from '../../features/tasks/task.model'; +import { Project } from '../../features/project/project.model'; +import { Tag } from '../../features/tag/tag.model'; describe('bulkHydrationMetaReducer', () => { // Track all reducer calls for verification diff --git a/src/app/core/persistence/operation-log/bulk-hydration.meta-reducer.ts b/src/app/op-log/apply/bulk-hydration.meta-reducer.ts similarity index 100% rename from src/app/core/persistence/operation-log/bulk-hydration.meta-reducer.ts rename to src/app/op-log/apply/bulk-hydration.meta-reducer.ts diff --git a/src/app/core/persistence/operation-log/processing/hydration-state.service.spec.ts b/src/app/op-log/apply/hydration-state.service.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/processing/hydration-state.service.spec.ts rename to src/app/op-log/apply/hydration-state.service.spec.ts index 186e20d5c..48909ae2a 100644 --- a/src/app/core/persistence/operation-log/processing/hydration-state.service.spec.ts +++ b/src/app/op-log/apply/hydration-state.service.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { HydrationStateService } from './hydration-state.service'; -import { getIsApplyingRemoteOps } from './operation-capture.meta-reducer'; +import { getIsApplyingRemoteOps } from '../capture/operation-capture.meta-reducer'; describe('HydrationStateService', () => { let service: HydrationStateService; diff --git a/src/app/core/persistence/operation-log/processing/hydration-state.service.ts b/src/app/op-log/apply/hydration-state.service.ts similarity index 96% rename from src/app/core/persistence/operation-log/processing/hydration-state.service.ts rename to src/app/op-log/apply/hydration-state.service.ts index 03defaa84..d09e52c7b 100644 --- a/src/app/core/persistence/operation-log/processing/hydration-state.service.ts +++ b/src/app/op-log/apply/hydration-state.service.ts @@ -1,6 +1,6 @@ import { Injectable, signal } from '@angular/core'; -import { setIsApplyingRemoteOps } from './operation-capture.meta-reducer'; -import { POST_SYNC_COOLDOWN_MS } from '../operation-log.const'; +import { setIsApplyingRemoteOps } from '../capture/operation-capture.meta-reducer'; +import { POST_SYNC_COOLDOWN_MS } from '../core/operation-log.const'; /** * Tracks whether the application is currently applying remote operations diff --git a/src/app/core/persistence/operation-log/processing/operation-applier.service.spec.ts b/src/app/op-log/apply/operation-applier.service.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/processing/operation-applier.service.spec.ts rename to src/app/op-log/apply/operation-applier.service.spec.ts index 387d4f9e6..4d4a52a51 100644 --- a/src/app/core/persistence/operation-log/processing/operation-applier.service.spec.ts +++ b/src/app/op-log/apply/operation-applier.service.spec.ts @@ -1,13 +1,13 @@ import { TestBed } from '@angular/core/testing'; import { Store } from '@ngrx/store'; import { OperationApplierService } from './operation-applier.service'; -import { Operation, OpType, EntityType } from '../operation.types'; +import { Operation, OpType, EntityType } from '../core/operation.types'; import { ArchiveOperationHandler } from './archive-operation-handler.service'; import { HydrationStateService } from './hydration-state.service'; -import { TaskSharedActions } from '../../../../root-store/meta/task-shared.actions'; -import { remoteArchiveDataApplied } from '../../../../features/time-tracking/store/archive.actions'; -import { bulkApplyOperations } from '../bulk-hydration.action'; -import { OperationLogEffects } from '../operation-log.effects'; +import { TaskSharedActions } from '../../root-store/meta/task-shared.actions'; +import { remoteArchiveDataApplied } from '../../features/time-tracking/store/archive.actions'; +import { bulkApplyOperations } from './bulk-hydration.action'; +import { OperationLogEffects } from '../capture/operation-log.effects'; describe('OperationApplierService', () => { let service: OperationApplierService; diff --git a/src/app/core/persistence/operation-log/processing/operation-applier.service.ts b/src/app/op-log/apply/operation-applier.service.ts similarity index 94% rename from src/app/core/persistence/operation-log/processing/operation-applier.service.ts rename to src/app/op-log/apply/operation-applier.service.ts index 3ad0591c8..9d98c9690 100644 --- a/src/app/core/persistence/operation-log/processing/operation-applier.service.ts +++ b/src/app/op-log/apply/operation-applier.service.ts @@ -1,16 +1,16 @@ import { inject, Injectable, Injector } from '@angular/core'; import { Store } from '@ngrx/store'; -import { Operation } from '../operation.types'; -import { convertOpToAction } from '../operation-converter.util'; -import { OpLog } from '../../../log'; +import { Operation } from '../core/operation.types'; +import { convertOpToAction } from './operation-converter.util'; +import { OpLog } from '../../core/log'; import { ArchiveOperationHandler, isArchiveAffectingAction, } from './archive-operation-handler.service'; import { HydrationStateService } from './hydration-state.service'; -import { remoteArchiveDataApplied } from '../../../../features/time-tracking/store/archive.actions'; -import { bulkApplyOperations } from '../bulk-hydration.action'; -import { OperationLogEffects } from '../operation-log.effects'; +import { remoteArchiveDataApplied } from '../../features/time-tracking/store/archive.actions'; +import { bulkApplyOperations } from './bulk-hydration.action'; +import { OperationLogEffects } from '../capture/operation-log.effects'; /** * Result of applying operations to the NgRx store. diff --git a/src/app/core/persistence/operation-log/operation-converter.util.spec.ts b/src/app/op-log/apply/operation-converter.util.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/operation-converter.util.spec.ts rename to src/app/op-log/apply/operation-converter.util.spec.ts index 551e44dae..850ca68e3 100644 --- a/src/app/core/persistence/operation-log/operation-converter.util.spec.ts +++ b/src/app/op-log/apply/operation-converter.util.spec.ts @@ -1,5 +1,5 @@ import { convertOpToAction, ACTION_TYPE_ALIASES } from './operation-converter.util'; -import { Operation, OpType } from './operation.types'; +import { Operation, OpType } from '../core/operation.types'; describe('operation-converter utility', () => { const createMockOperation = (overrides: Partial = {}): Operation => ({ diff --git a/src/app/core/persistence/operation-log/operation-converter.util.ts b/src/app/op-log/apply/operation-converter.util.ts similarity index 95% rename from src/app/core/persistence/operation-log/operation-converter.util.ts rename to src/app/op-log/apply/operation-converter.util.ts index 2aa6e7869..ef944e8f0 100644 --- a/src/app/core/persistence/operation-log/operation-converter.util.ts +++ b/src/app/op-log/apply/operation-converter.util.ts @@ -1,5 +1,5 @@ -import { extractActionPayload, Operation, OpType } from './operation.types'; -import { PersistentAction } from './persistent-action.interface'; +import { extractActionPayload, Operation, OpType } from '../core/operation.types'; +import { PersistentAction } from '../core/persistent-action.interface'; /** * Maps old/renamed action types to their current names. diff --git a/src/app/core/persistence/operation-log/processing/operation-capture.meta-reducer.spec.ts b/src/app/op-log/capture/operation-capture.meta-reducer.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/processing/operation-capture.meta-reducer.spec.ts rename to src/app/op-log/capture/operation-capture.meta-reducer.spec.ts index ef5dc9763..efeecc240 100644 --- a/src/app/core/persistence/operation-log/processing/operation-capture.meta-reducer.spec.ts +++ b/src/app/op-log/capture/operation-capture.meta-reducer.spec.ts @@ -10,9 +10,9 @@ import { } from './operation-capture.meta-reducer'; import { OperationCaptureService } from './operation-capture.service'; import { Action } from '@ngrx/store'; -import { PersistentAction } from '../persistent-action.interface'; -import { EntityType, OpType } from '../operation.types'; -import { RootState } from '../../../../root-store/root-state'; +import { PersistentAction } from '../core/persistent-action.interface'; +import { EntityType, OpType } from '../core/operation.types'; +import { RootState } from '../../root-store/root-state'; describe('operationCaptureMetaReducer', () => { let mockCaptureService: jasmine.SpyObj; diff --git a/src/app/core/persistence/operation-log/processing/operation-capture.meta-reducer.ts b/src/app/op-log/capture/operation-capture.meta-reducer.ts similarity index 98% rename from src/app/core/persistence/operation-log/processing/operation-capture.meta-reducer.ts rename to src/app/op-log/capture/operation-capture.meta-reducer.ts index 251d54e26..8ff9231d2 100644 --- a/src/app/core/persistence/operation-log/processing/operation-capture.meta-reducer.ts +++ b/src/app/op-log/capture/operation-capture.meta-reducer.ts @@ -1,7 +1,10 @@ import { Action, ActionReducer } from '@ngrx/store'; -import { isPersistentAction, PersistentAction } from '../persistent-action.interface'; +import { + isPersistentAction, + PersistentAction, +} from '../core/persistent-action.interface'; import { OperationCaptureService } from './operation-capture.service'; -import { OpLog } from '../../../log'; +import { OpLog } from '../../core/log'; // ═══════════════════════════════════════════════════════════════════════════ // ARCHITECTURAL DEBT: Module-Level State for Meta-Reducer Service Injection diff --git a/src/app/core/persistence/operation-log/processing/operation-capture.service.spec.ts b/src/app/op-log/capture/operation-capture.service.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/processing/operation-capture.service.spec.ts rename to src/app/op-log/capture/operation-capture.service.spec.ts index c0a089b5a..116bb8cc5 100644 --- a/src/app/core/persistence/operation-log/processing/operation-capture.service.spec.ts +++ b/src/app/op-log/capture/operation-capture.service.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { OperationCaptureService } from './operation-capture.service'; -import { OpType, EntityType } from '../operation.types'; -import { PersistentAction } from '../persistent-action.interface'; +import { OpType, EntityType } from '../core/operation.types'; +import { PersistentAction } from '../core/persistent-action.interface'; describe('OperationCaptureService', () => { let service: OperationCaptureService; diff --git a/src/app/core/persistence/operation-log/processing/operation-capture.service.ts b/src/app/op-log/capture/operation-capture.service.ts similarity index 97% rename from src/app/core/persistence/operation-log/processing/operation-capture.service.ts rename to src/app/op-log/capture/operation-capture.service.ts index daa6f8efe..5898ff0e2 100644 --- a/src/app/core/persistence/operation-log/processing/operation-capture.service.ts +++ b/src/app/op-log/capture/operation-capture.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -import { EntityChange, OpType } from '../operation.types'; -import { PersistentAction } from '../persistent-action.interface'; -import { OpLog } from '../../../log'; +import { EntityChange, OpType } from '../core/operation.types'; +import { PersistentAction } from '../core/persistent-action.interface'; +import { OpLog } from '../../core/log'; /** * Captures action payloads and queues them for persistence using a simple FIFO queue. diff --git a/src/app/core/persistence/operation-log/operation-log.effects.spec.ts b/src/app/op-log/capture/operation-log.effects.spec.ts similarity index 97% rename from src/app/core/persistence/operation-log/operation-log.effects.spec.ts rename to src/app/op-log/capture/operation-log.effects.spec.ts index bc1dc830b..0848574b8 100644 --- a/src/app/core/persistence/operation-log/operation-log.effects.spec.ts +++ b/src/app/op-log/capture/operation-log.effects.spec.ts @@ -3,21 +3,21 @@ import { provideMockActions } from '@ngrx/effects/testing'; import { Action, Store } from '@ngrx/store'; import { Observable, of } from 'rxjs'; import { OperationLogEffects } from './operation-log.effects'; -import { OperationLogStoreService } from './store/operation-log-store.service'; -import { LockService } from './sync/lock.service'; -import { VectorClockService } from './sync/vector-clock.service'; -import { OperationLogCompactionService } from './store/operation-log-compaction.service'; -import { SnackService } from '../../snack/snack.service'; +import { OperationLogStoreService } from '../store/operation-log-store.service'; +import { LockService } from '../sync/lock.service'; +import { VectorClockService } from '../sync/vector-clock.service'; +import { OperationLogCompactionService } from '../store/operation-log-compaction.service'; +import { SnackService } from '../../core/snack/snack.service'; import { Injector } from '@angular/core'; -import { ImmediateUploadService } from './sync/immediate-upload.service'; -import { HydrationStateService } from './processing/hydration-state.service'; -import { OpType } from './operation.types'; -import { PersistentAction } from './persistent-action.interface'; -import { COMPACTION_THRESHOLD } from './operation-log.const'; +import { ImmediateUploadService } from '../sync/immediate-upload.service'; +import { HydrationStateService } from '../apply/hydration-state.service'; +import { OpType } from '../core/operation.types'; +import { PersistentAction } from '../core/persistent-action.interface'; +import { COMPACTION_THRESHOLD } from '../core/operation-log.const'; import { bufferDeferredAction, clearDeferredActions, -} from './processing/operation-capture.meta-reducer'; +} from './operation-capture.meta-reducer'; describe('OperationLogEffects', () => { let effects: OperationLogEffects; diff --git a/src/app/core/persistence/operation-log/operation-log.effects.ts b/src/app/op-log/capture/operation-log.effects.ts similarity index 91% rename from src/app/core/persistence/operation-log/operation-log.effects.ts rename to src/app/op-log/capture/operation-log.effects.ts index bacd6c581..9ba9c4a81 100644 --- a/src/app/core/persistence/operation-log/operation-log.effects.ts +++ b/src/app/op-log/capture/operation-log.effects.ts @@ -1,31 +1,34 @@ import { inject, Injectable, Injector } from '@angular/core'; import { createEffect } from '@ngrx/effects'; -import { ALL_ACTIONS } from '../../../util/local-actions.token'; +import { ALL_ACTIONS } from '../../util/local-actions.token'; import { concatMap, filter } from 'rxjs/operators'; -import { LockService } from './sync/lock.service'; -import { OperationLogStoreService } from './store/operation-log-store.service'; -import { isPersistentAction, PersistentAction } from './persistent-action.interface'; -import { uuidv7 } from '../../../util/uuid-v7'; -import { devError } from '../../../util/dev-error'; -import { incrementVectorClock } from '../../../pfapi/api/util/vector-clock'; -import { MultiEntityPayload, Operation } from './operation.types'; -import { PfapiService } from '../../../pfapi/pfapi.service'; -import { OperationLogCompactionService } from './store/operation-log-compaction.service'; -import { OpLog } from '../../log'; -import { SnackService } from '../../snack/snack.service'; -import { T } from '../../../t.const'; -import { validateOperationPayload } from './processing/validate-operation-payload'; -import { VectorClockService } from './sync/vector-clock.service'; +import { LockService } from '../sync/lock.service'; +import { OperationLogStoreService } from '../store/operation-log-store.service'; +import { + isPersistentAction, + PersistentAction, +} from '../core/persistent-action.interface'; +import { uuidv7 } from '../../util/uuid-v7'; +import { devError } from '../../util/dev-error'; +import { incrementVectorClock } from '../../pfapi/api/util/vector-clock'; +import { MultiEntityPayload, Operation } from '../core/operation.types'; +import { PfapiService } from '../../pfapi/pfapi.service'; +import { OperationLogCompactionService } from '../store/operation-log-compaction.service'; +import { OpLog } from '../../core/log'; +import { SnackService } from '../../core/snack/snack.service'; +import { T } from '../../t.const'; +import { validateOperationPayload } from '../validation/validate-operation-payload'; +import { VectorClockService } from '../sync/vector-clock.service'; import { COMPACTION_THRESHOLD, LOCK_NAMES, MAX_COMPACTION_FAILURES, -} from './operation-log.const'; -import { CURRENT_SCHEMA_VERSION } from './store/schema-migration.service'; -import { OperationCaptureService } from './processing/operation-capture.service'; -import { ImmediateUploadService } from './sync/immediate-upload.service'; -import { HydrationStateService } from './processing/hydration-state.service'; -import { getDeferredActions } from './processing/operation-capture.meta-reducer'; +} from '../core/operation-log.const'; +import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; +import { OperationCaptureService } from './operation-capture.service'; +import { ImmediateUploadService } from '../sync/immediate-upload.service'; +import { HydrationStateService } from '../apply/hydration-state.service'; +import { getDeferredActions } from './operation-capture.meta-reducer'; /** * NgRx Effects for persisting application state changes as operations to the diff --git a/src/app/core/persistence/operation-log/entity-registry.spec.ts b/src/app/op-log/core/entity-registry.spec.ts similarity index 100% rename from src/app/core/persistence/operation-log/entity-registry.spec.ts rename to src/app/op-log/core/entity-registry.spec.ts diff --git a/src/app/core/persistence/operation-log/entity-registry.ts b/src/app/op-log/core/entity-registry.ts similarity index 84% rename from src/app/core/persistence/operation-log/entity-registry.ts rename to src/app/op-log/core/entity-registry.ts index a5e1809fc..a41275e73 100644 --- a/src/app/core/persistence/operation-log/entity-registry.ts +++ b/src/app/op-log/core/entity-registry.ts @@ -6,7 +6,7 @@ * ## Adding a New Entity Type: * 1. Add the type to EntityType union in operation.types.ts * 2. Add config here - * 3. Run `npm run checkFile src/app/core/persistence/operation-log/entity-registry.ts` + * 3. Run `npm run checkFile src/app/op-log/core/entity-registry.ts` */ import { EntityAdapter } from '@ngrx/entity'; @@ -17,41 +17,38 @@ import { EntityType } from './operation.types'; // ───────────────────────────────────────────────────────────────────────────── // IMPORTS - Adapters & Feature Names // ───────────────────────────────────────────────────────────────────────────── -import { - TASK_FEATURE_NAME, - taskAdapter, -} from '../../../features/tasks/store/task.reducer'; +import { TASK_FEATURE_NAME, taskAdapter } from '../../features/tasks/store/task.reducer'; import { PROJECT_FEATURE_NAME, projectAdapter, -} from '../../../features/project/store/project.reducer'; -import { TAG_FEATURE_NAME, tagAdapter } from '../../../features/tag/store/tag.reducer'; +} from '../../features/project/store/project.reducer'; +import { TAG_FEATURE_NAME, tagAdapter } from '../../features/tag/store/tag.reducer'; import { adapter as noteAdapter, NOTE_FEATURE_NAME, -} from '../../../features/note/store/note.reducer'; +} from '../../features/note/store/note.reducer'; import { adapter as simpleCounterAdapter, SIMPLE_COUNTER_FEATURE_NAME, -} from '../../../features/simple-counter/store/simple-counter.reducer'; +} from '../../features/simple-counter/store/simple-counter.reducer'; import { adapter as taskRepeatCfgAdapter, TASK_REPEAT_CFG_FEATURE_NAME, -} from '../../../features/task-repeat-cfg/store/task-repeat-cfg.selectors'; +} from '../../features/task-repeat-cfg/store/task-repeat-cfg.selectors'; import { metricAdapter, METRIC_FEATURE_NAME, -} from '../../../features/metric/store/metric.reducer'; +} from '../../features/metric/store/metric.reducer'; import { adapter as issueProviderAdapter, ISSUE_PROVIDER_FEATURE_KEY, -} from '../../../features/issue/store/issue-provider.reducer'; -import { CONFIG_FEATURE_NAME } from '../../../features/config/store/global-config.reducer'; -import { TIME_TRACKING_FEATURE_KEY } from '../../../features/time-tracking/store/time-tracking.reducer'; -import { plannerFeatureKey } from '../../../features/planner/store/planner.reducer'; -import { BOARDS_FEATURE_NAME } from '../../../features/boards/store/boards.reducer'; -import { menuTreeFeatureKey } from '../../../features/menu-tree/store/menu-tree.reducer'; -import { REMINDER_FEATURE_NAME } from '../../../features/reminder/store/reminder.reducer'; +} from '../../features/issue/store/issue-provider.reducer'; +import { CONFIG_FEATURE_NAME } from '../../features/config/store/global-config.reducer'; +import { TIME_TRACKING_FEATURE_KEY } from '../../features/time-tracking/store/time-tracking.reducer'; +import { plannerFeatureKey } from '../../features/planner/store/planner.reducer'; +import { BOARDS_FEATURE_NAME } from '../../features/boards/store/boards.reducer'; +import { menuTreeFeatureKey } from '../../features/menu-tree/store/menu-tree.reducer'; +import { REMINDER_FEATURE_NAME } from '../../features/reminder/store/reminder.reducer'; // ───────────────────────────────────────────────────────────────────────────── // IMPORTS - Selectors @@ -59,51 +56,51 @@ import { REMINDER_FEATURE_NAME } from '../../../features/reminder/store/reminder import { selectTaskEntities, selectTaskById, -} from '../../../features/tasks/store/task.selectors'; +} from '../../features/tasks/store/task.selectors'; import { selectProjectFeatureState, selectEntities as selectProjectEntitiesFromAdapter, -} from '../../../features/project/store/project.reducer'; -import { selectProjectById } from '../../../features/project/store/project.selectors'; +} from '../../features/project/store/project.reducer'; +import { selectProjectById } from '../../features/project/store/project.selectors'; import { selectTagFeatureState, selectEntities as selectTagEntitiesFromAdapter, selectTagById, -} from '../../../features/tag/store/tag.reducer'; +} from '../../features/tag/store/tag.reducer'; import { selectNoteFeatureState, selectEntities as selectNoteEntitiesFromAdapter, selectNoteById, -} from '../../../features/note/store/note.reducer'; +} from '../../features/note/store/note.reducer'; import { selectSimpleCounterFeatureState, selectEntities as selectSimpleCounterEntitiesFromAdapter, selectSimpleCounterById, -} from '../../../features/simple-counter/store/simple-counter.reducer'; +} from '../../features/simple-counter/store/simple-counter.reducer'; import { selectTaskRepeatCfgFeatureState, selectTaskRepeatCfgById, -} from '../../../features/task-repeat-cfg/store/task-repeat-cfg.selectors'; +} from '../../features/task-repeat-cfg/store/task-repeat-cfg.selectors'; import { selectMetricFeatureState, selectEntities as selectMetricEntitiesFromAdapter, selectMetricById, -} from '../../../features/metric/store/metric.selectors'; +} from '../../features/metric/store/metric.selectors'; import { selectIssueProviderState, selectEntities as selectIssueProviderEntitiesFromAdapter, selectIssueProviderById, -} from '../../../features/issue/store/issue-provider.selectors'; -import { selectConfigFeatureState } from '../../../features/config/store/global-config.reducer'; -import { selectTimeTrackingState } from '../../../features/time-tracking/store/time-tracking.selectors'; -import { selectPlannerState } from '../../../features/planner/store/planner.selectors'; -import { selectBoardsState } from '../../../features/boards/store/boards.selectors'; -import { selectMenuTreeState } from '../../../features/menu-tree/store/menu-tree.selectors'; -import { selectReminderFeatureState } from '../../../features/reminder/store/reminder.reducer'; +} from '../../features/issue/store/issue-provider.selectors'; +import { selectConfigFeatureState } from '../../features/config/store/global-config.reducer'; +import { selectTimeTrackingState } from '../../features/time-tracking/store/time-tracking.selectors'; +import { selectPlannerState } from '../../features/planner/store/planner.selectors'; +import { selectBoardsState } from '../../features/boards/store/boards.selectors'; +import { selectMenuTreeState } from '../../features/menu-tree/store/menu-tree.selectors'; +import { selectReminderFeatureState } from '../../features/reminder/store/reminder.reducer'; import { selectContextFeatureState, WORK_CONTEXT_FEATURE_NAME, -} from '../../../features/work-context/store/work-context.selectors'; +} from '../../features/work-context/store/work-context.selectors'; // ───────────────────────────────────────────────────────────────────────────── // TYPES diff --git a/src/app/core/persistence/operation-log/operation-log.const.ts b/src/app/op-log/core/operation-log.const.ts similarity index 100% rename from src/app/core/persistence/operation-log/operation-log.const.ts rename to src/app/op-log/core/operation-log.const.ts diff --git a/src/app/core/persistence/operation-log/operation.types.ts b/src/app/op-log/core/operation.types.ts similarity index 99% rename from src/app/core/persistence/operation-log/operation.types.ts rename to src/app/op-log/core/operation.types.ts index cea9b475d..221ecc615 100644 --- a/src/app/core/persistence/operation-log/operation.types.ts +++ b/src/app/op-log/core/operation.types.ts @@ -1,4 +1,4 @@ -import { VectorClock } from '../../../pfapi/api/util/vector-clock'; +import { VectorClock } from '../../pfapi/api/util/vector-clock'; export { VectorClock }; export enum OpType { diff --git a/src/app/core/persistence/operation-log/persistent-action-types.spec.ts b/src/app/op-log/core/persistent-action-types.spec.ts similarity index 84% rename from src/app/core/persistence/operation-log/persistent-action-types.spec.ts rename to src/app/op-log/core/persistent-action-types.spec.ts index d67c59e7e..09013f523 100644 --- a/src/app/core/persistence/operation-log/persistent-action-types.spec.ts +++ b/src/app/op-log/core/persistent-action-types.spec.ts @@ -9,21 +9,17 @@ * The alias registry ensures old operations can still be replayed after renames. */ -import { TaskSharedActions } from '../../../root-store/meta/task-shared.actions'; -import { syncTimeSpent } from '../../../features/time-tracking/store/time-tracking.actions'; -import { flushYoungToOld } from '../../../features/time-tracking/store/archive.actions'; +import { TaskSharedActions } from '../../root-store/meta/task-shared.actions'; +import { syncTimeSpent } from '../../features/time-tracking/store/time-tracking.actions'; +import { flushYoungToOld } from '../../features/time-tracking/store/archive.actions'; import { addProject, updateProject, archiveProject, -} from '../../../features/project/store/project.actions'; -import { addTag, updateTag, deleteTag } from '../../../features/tag/store/tag.actions'; -import { - addNote, - updateNote, - deleteNote, -} from '../../../features/note/store/note.actions'; -import { updateGlobalConfigSection } from '../../../features/config/store/global-config.actions'; +} from '../../features/project/store/project.actions'; +import { addTag, updateTag, deleteTag } from '../../features/tag/store/tag.actions'; +import { addNote, updateNote, deleteNote } from '../../features/note/store/note.actions'; +import { updateGlobalConfigSection } from '../../features/config/store/global-config.actions'; describe('Persistent Action Types Stability', () => { /** diff --git a/src/app/core/persistence/operation-log/persistent-action.interface.spec.ts b/src/app/op-log/core/persistent-action.interface.spec.ts similarity index 100% rename from src/app/core/persistence/operation-log/persistent-action.interface.spec.ts rename to src/app/op-log/core/persistent-action.interface.spec.ts diff --git a/src/app/core/persistence/operation-log/persistent-action.interface.ts b/src/app/op-log/core/persistent-action.interface.ts similarity index 100% rename from src/app/core/persistence/operation-log/persistent-action.interface.ts rename to src/app/op-log/core/persistent-action.interface.ts diff --git a/src/app/core/persistence/operation-log/sync-state-corrupted.error.spec.ts b/src/app/op-log/core/sync-state-corrupted.error.spec.ts similarity index 100% rename from src/app/core/persistence/operation-log/sync-state-corrupted.error.spec.ts rename to src/app/op-log/core/sync-state-corrupted.error.spec.ts diff --git a/src/app/core/persistence/operation-log/sync-state-corrupted.error.ts b/src/app/op-log/core/sync-state-corrupted.error.ts similarity index 100% rename from src/app/core/persistence/operation-log/sync-state-corrupted.error.ts rename to src/app/op-log/core/sync-state-corrupted.error.ts diff --git a/src/app/core/persistence/operation-log/store/operation-log-compaction.service.spec.ts b/src/app/op-log/store/operation-log-compaction.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/store/operation-log-compaction.service.spec.ts rename to src/app/op-log/store/operation-log-compaction.service.spec.ts index e2b57f5f0..c00370b70 100644 --- a/src/app/core/persistence/operation-log/store/operation-log-compaction.service.spec.ts +++ b/src/app/op-log/store/operation-log-compaction.service.spec.ts @@ -2,16 +2,16 @@ import { TestBed } from '@angular/core/testing'; import { OperationLogCompactionService } from './operation-log-compaction.service'; import { OperationLogStoreService } from './operation-log-store.service'; import { LockService } from '../sync/lock.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; import { VectorClockService } from '../sync/vector-clock.service'; import { COMPACTION_RETENTION_MS, SLOW_COMPACTION_THRESHOLD_MS, -} from '../operation-log.const'; +} from '../core/operation-log.const'; import { CURRENT_SCHEMA_VERSION } from './schema-migration.service'; -import { OperationLogEntry } from '../operation.types'; -import { OpLog } from '../../../log'; -import { PFAPI_MODEL_CFGS } from '../../../../pfapi/pfapi-config'; +import { OperationLogEntry } from '../core/operation.types'; +import { OpLog } from '../../core/log'; +import { PFAPI_MODEL_CFGS } from '../../pfapi/pfapi-config'; const MS_PER_DAY = 24 * 60 * 60 * 1000; diff --git a/src/app/core/persistence/operation-log/store/operation-log-compaction.service.ts b/src/app/op-log/store/operation-log-compaction.service.ts similarity index 96% rename from src/app/core/persistence/operation-log/store/operation-log-compaction.service.ts rename to src/app/op-log/store/operation-log-compaction.service.ts index f70394c68..1737b5fa7 100644 --- a/src/app/core/persistence/operation-log/store/operation-log-compaction.service.ts +++ b/src/app/op-log/store/operation-log-compaction.service.ts @@ -6,14 +6,14 @@ import { EMERGENCY_COMPACTION_RETENTION_MS, LOCK_NAMES, SLOW_COMPACTION_THRESHOLD_MS, -} from '../operation-log.const'; +} from '../core/operation-log.const'; import { OperationLogStoreService } from './operation-log-store.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; import { CURRENT_SCHEMA_VERSION } from './schema-migration.service'; import { VectorClockService } from '../sync/vector-clock.service'; -import { OpLog } from '../../../log'; -import { PfapiAllModelCfg } from '../../../../pfapi/pfapi-config'; -import { AllSyncModels } from '../../../../pfapi/api/pfapi.model'; +import { OpLog } from '../../core/log'; +import { PfapiAllModelCfg } from '../../pfapi/pfapi-config'; +import { AllSyncModels } from '../../pfapi/api/pfapi.model'; /** * Manages the compaction (garbage collection) of the operation log. diff --git a/src/app/core/persistence/operation-log/store/operation-log-hydrator.service.spec.ts b/src/app/op-log/store/operation-log-hydrator.service.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/store/operation-log-hydrator.service.spec.ts rename to src/app/op-log/store/operation-log-hydrator.service.spec.ts index 742ae1fe92..299d80088 100644 --- a/src/app/core/persistence/operation-log/store/operation-log-hydrator.service.spec.ts +++ b/src/app/op-log/store/operation-log-hydrator.service.spec.ts @@ -8,17 +8,17 @@ import { SchemaMigrationService, CURRENT_SCHEMA_VERSION, } from './schema-migration.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; -import { SnackService } from '../../../snack/snack.service'; -import { ValidateStateService } from '../processing/validate-state.service'; -import { RepairOperationService } from '../processing/repair-operation.service'; +import { PfapiService } from '../../pfapi/pfapi.service'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; +import { SnackService } from '../../core/snack/snack.service'; +import { ValidateStateService } from '../validation/validate-state.service'; +import { RepairOperationService } from '../validation/repair-operation.service'; import { VectorClockService } from '../sync/vector-clock.service'; -import { OperationApplierService } from '../processing/operation-applier.service'; -import { HydrationStateService } from '../processing/hydration-state.service'; -import { Operation, OperationLogEntry, OpType } from '../operation.types'; -import { loadAllData } from '../../../../root-store/meta/load-all-data.action'; -import { bulkApplyHydrationOperations } from '../bulk-hydration.action'; +import { OperationApplierService } from '../apply/operation-applier.service'; +import { HydrationStateService } from '../apply/hydration-state.service'; +import { Operation, OperationLogEntry, OpType } from '../core/operation.types'; +import { loadAllData } from '../../root-store/meta/load-all-data.action'; +import { bulkApplyHydrationOperations } from '../apply/bulk-hydration.action'; describe('OperationLogHydratorService', () => { let service: OperationLogHydratorService; diff --git a/src/app/core/persistence/operation-log/store/operation-log-hydrator.service.ts b/src/app/op-log/store/operation-log-hydrator.service.ts similarity index 97% rename from src/app/core/persistence/operation-log/store/operation-log-hydrator.service.ts rename to src/app/op-log/store/operation-log-hydrator.service.ts index 5473faeda..8f8b19b10 100644 --- a/src/app/core/persistence/operation-log/store/operation-log-hydrator.service.ts +++ b/src/app/op-log/store/operation-log-hydrator.service.ts @@ -1,36 +1,36 @@ import { inject, Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; import { OperationLogStoreService } from './operation-log-store.service'; -import { loadAllData } from '../../../../root-store/meta/load-all-data.action'; +import { loadAllData } from '../../root-store/meta/load-all-data.action'; import { OperationLogMigrationService } from './operation-log-migration.service'; import { CURRENT_SCHEMA_VERSION, MigratableStateCache, SchemaMigrationService, } from './schema-migration.service'; -import { OpLog } from '../../../log'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; -import { Operation, OpType, RepairPayload } from '../operation.types'; -import { uuidv7 } from '../../../../util/uuid-v7'; +import { OpLog } from '../../core/log'; +import { PfapiService } from '../../pfapi/pfapi.service'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; +import { Operation, OpType, RepairPayload } from '../core/operation.types'; +import { uuidv7 } from '../../util/uuid-v7'; import { incrementVectorClock, mergeVectorClocks, -} from '../../../../pfapi/api/util/vector-clock'; -import { SnackService } from '../../../snack/snack.service'; -import { T } from '../../../../t.const'; -import { ValidateStateService } from '../processing/validate-state.service'; +} from '../../pfapi/api/util/vector-clock'; +import { SnackService } from '../../core/snack/snack.service'; +import { T } from '../../t.const'; +import { ValidateStateService } from '../validation/validate-state.service'; // DISABLED: Repair system is non-functional -// import { RepairOperationService } from '../processing/repair-operation.service'; -import { OperationApplierService } from '../processing/operation-applier.service'; -import { HydrationStateService } from '../processing/hydration-state.service'; -import { bulkApplyOperations } from '../bulk-hydration.action'; -import { AppDataCompleteNew } from '../../../../pfapi/pfapi-config'; +// import { RepairOperationService } from '../validation/repair-operation.service'; +import { OperationApplierService } from '../apply/operation-applier.service'; +import { HydrationStateService } from '../apply/hydration-state.service'; +import { bulkApplyOperations } from '../apply/bulk-hydration.action'; +import { AppDataCompleteNew } from '../../pfapi/pfapi-config'; import { VectorClockService } from '../sync/vector-clock.service'; import { MAX_CONFLICT_RETRY_ATTEMPTS, PENDING_OPERATION_EXPIRY_MS, -} from '../operation-log.const'; +} from '../core/operation-log.const'; type StateCache = MigratableStateCache; diff --git a/src/app/core/persistence/operation-log/store/operation-log-migration.service.spec.ts b/src/app/op-log/store/operation-log-migration.service.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/store/operation-log-migration.service.spec.ts rename to src/app/op-log/store/operation-log-migration.service.spec.ts index 845787a76..a7d4e3db9 100644 --- a/src/app/core/persistence/operation-log/store/operation-log-migration.service.spec.ts +++ b/src/app/op-log/store/operation-log-migration.service.spec.ts @@ -3,9 +3,9 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { of } from 'rxjs'; import { OperationLogMigrationService } from './operation-log-migration.service'; import { OperationLogStoreService } from './operation-log-store.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { OpLog } from '../../../log'; -import { OpType } from '../operation.types'; +import { PfapiService } from '../../pfapi/pfapi.service'; +import { OpLog } from '../../core/log'; +import { OpType } from '../core/operation.types'; describe('OperationLogMigrationService', () => { let service: OperationLogMigrationService; diff --git a/src/app/core/persistence/operation-log/store/operation-log-migration.service.ts b/src/app/op-log/store/operation-log-migration.service.ts similarity index 92% rename from src/app/core/persistence/operation-log/store/operation-log-migration.service.ts rename to src/app/op-log/store/operation-log-migration.service.ts index 5ecb4c367..ab5b1c57c 100644 --- a/src/app/core/persistence/operation-log/store/operation-log-migration.service.ts +++ b/src/app/op-log/store/operation-log-migration.service.ts @@ -2,14 +2,14 @@ import { inject, Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { firstValueFrom } from 'rxjs'; import { OperationLogStoreService } from './operation-log-store.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { Operation, OpType } from '../operation.types'; -import { uuidv7 } from '../../../../util/uuid-v7'; -import { OpLog } from '../../../log'; +import { PfapiService } from '../../pfapi/pfapi.service'; +import { Operation, OpType } from '../core/operation.types'; +import { uuidv7 } from '../../util/uuid-v7'; +import { OpLog } from '../../core/log'; import { CURRENT_SCHEMA_VERSION } from './schema-migration.service'; -import { DialogConfirmComponent } from '../../../../ui/dialog-confirm/dialog-confirm.component'; -import { download } from '../../../../util/download'; -import { T } from '../../../../t.const'; +import { DialogConfirmComponent } from '../../ui/dialog-confirm/dialog-confirm.component'; +import { download } from '../../util/download'; +import { T } from '../../t.const'; @Injectable({ providedIn: 'root' }) export class OperationLogMigrationService { diff --git a/src/app/core/persistence/operation-log/store/operation-log-store.service.spec.ts b/src/app/op-log/store/operation-log-store.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/store/operation-log-store.service.spec.ts rename to src/app/op-log/store/operation-log-store.service.spec.ts index d9d0ac45f..7af3181c7 100644 --- a/src/app/core/persistence/operation-log/store/operation-log-store.service.spec.ts +++ b/src/app/op-log/store/operation-log-store.service.spec.ts @@ -1,8 +1,8 @@ import { TestBed } from '@angular/core/testing'; import { OperationLogStoreService } from './operation-log-store.service'; import { VectorClockService } from '../sync/vector-clock.service'; -import { Operation, OpType, EntityType, VectorClock } from '../operation.types'; -import { uuidv7 } from '../../../../util/uuid-v7'; +import { Operation, OpType, EntityType, VectorClock } from '../core/operation.types'; +import { uuidv7 } from '../../util/uuid-v7'; describe('OperationLogStoreService', () => { let service: OperationLogStoreService; diff --git a/src/app/core/persistence/operation-log/store/operation-log-store.service.ts b/src/app/op-log/store/operation-log-store.service.ts similarity index 99% rename from src/app/core/persistence/operation-log/store/operation-log-store.service.ts rename to src/app/op-log/store/operation-log-store.service.ts index 8473da7a9..b32c4f654 100644 --- a/src/app/core/persistence/operation-log/store/operation-log-store.service.ts +++ b/src/app/op-log/store/operation-log-store.service.ts @@ -1,7 +1,12 @@ import { Injectable } from '@angular/core'; import { DBSchema, IDBPDatabase, openDB } from 'idb'; -import { Operation, OperationLogEntry, OpType, VectorClock } from '../operation.types'; -import { toEntityKey } from '../entity-key.util'; +import { + Operation, + OperationLogEntry, + OpType, + VectorClock, +} from '../core/operation.types'; +import { toEntityKey } from '../util/entity-key.util'; const DB_NAME = 'SUP_OPS'; const DB_VERSION = 3; diff --git a/src/app/core/persistence/operation-log/store/schema-migration.service.spec.ts b/src/app/op-log/store/schema-migration.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/store/schema-migration.service.spec.ts rename to src/app/op-log/store/schema-migration.service.spec.ts index 235d38e77..e34816dd4 100644 --- a/src/app/core/persistence/operation-log/store/schema-migration.service.spec.ts +++ b/src/app/op-log/store/schema-migration.service.spec.ts @@ -4,7 +4,7 @@ import { MigratableStateCache, CURRENT_SCHEMA_VERSION, } from './schema-migration.service'; -import { Operation, OpType } from '../operation.types'; +import { Operation, OpType } from '../core/operation.types'; describe('SchemaMigrationService', () => { let service: SchemaMigrationService; diff --git a/src/app/core/persistence/operation-log/store/schema-migration.service.ts b/src/app/op-log/store/schema-migration.service.ts similarity index 98% rename from src/app/core/persistence/operation-log/store/schema-migration.service.ts rename to src/app/op-log/store/schema-migration.service.ts index 5356a10a9..1870ebd4c 100644 --- a/src/app/core/persistence/operation-log/store/schema-migration.service.ts +++ b/src/app/op-log/store/schema-migration.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { Operation, VectorClock } from '../operation.types'; -import { OpLog } from '../../../log'; +import { Operation, VectorClock } from '../core/operation.types'; +import { OpLog } from '../../core/log'; import { CURRENT_SCHEMA_VERSION as SHARED_CURRENT_SCHEMA_VERSION, MAX_VERSION_SKIP as SHARED_MAX_VERSION_SKIP, diff --git a/src/app/core/persistence/operation-log/sync/conflict-resolution.service.spec.ts b/src/app/op-log/sync/conflict-resolution.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/sync/conflict-resolution.service.spec.ts rename to src/app/op-log/sync/conflict-resolution.service.spec.ts index 17d2f3928..9aea32707 100644 --- a/src/app/core/persistence/operation-log/sync/conflict-resolution.service.spec.ts +++ b/src/app/op-log/sync/conflict-resolution.service.spec.ts @@ -1,14 +1,14 @@ import { TestBed } from '@angular/core/testing'; import { ConflictResolutionService } from './conflict-resolution.service'; import { Store } from '@ngrx/store'; -import { OperationApplierService } from '../processing/operation-applier.service'; +import { OperationApplierService } from '../apply/operation-applier.service'; import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { SnackService } from '../../../snack/snack.service'; -import { ValidateStateService } from '../processing/validate-state.service'; +import { SnackService } from '../../core/snack/snack.service'; +import { ValidateStateService } from '../validation/validate-state.service'; import { of } from 'rxjs'; -import { EntityConflict, OpType, Operation } from '../operation.types'; -import { SyncSafetyBackupService } from '../../../../imex/sync/sync-safety-backup.service'; -import { BACKUP_TIMEOUT_MS } from '../operation-log.const'; +import { EntityConflict, OpType, Operation } from '../core/operation.types'; +import { SyncSafetyBackupService } from '../../imex/sync/sync-safety-backup.service'; +import { BACKUP_TIMEOUT_MS } from '../core/operation-log.const'; describe('ConflictResolutionService', () => { let service: ConflictResolutionService; diff --git a/src/app/core/persistence/operation-log/sync/conflict-resolution.service.ts b/src/app/op-log/sync/conflict-resolution.service.ts similarity index 97% rename from src/app/core/persistence/operation-log/sync/conflict-resolution.service.ts rename to src/app/op-log/sync/conflict-resolution.service.ts index ea2fa8b4f..5fcc3ad3a 100644 --- a/src/app/core/persistence/operation-log/sync/conflict-resolution.service.ts +++ b/src/app/op-log/sync/conflict-resolution.service.ts @@ -6,35 +6,38 @@ import { Operation, OpType, VectorClock, -} from '../operation.types'; -import { OperationApplierService } from '../processing/operation-applier.service'; +} from '../core/operation.types'; +import { OperationApplierService } from '../apply/operation-applier.service'; import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpLog } from '../../../log'; -import { toEntityKey } from '../entity-key.util'; +import { OpLog } from '../../core/log'; +import { toEntityKey } from '../util/entity-key.util'; import { firstValueFrom } from 'rxjs'; -import { SnackService } from '../../../snack/snack.service'; -import { T } from '../../../../t.const'; -import { ValidateStateService } from '../processing/validate-state.service'; -import { BACKUP_TIMEOUT_MS, MAX_CONFLICT_RETRY_ATTEMPTS } from '../operation-log.const'; -import { SyncSafetyBackupService } from '../../../../imex/sync/sync-safety-backup.service'; +import { SnackService } from '../../core/snack/snack.service'; +import { T } from '../../t.const'; +import { ValidateStateService } from '../validation/validate-state.service'; +import { + BACKUP_TIMEOUT_MS, + MAX_CONFLICT_RETRY_ATTEMPTS, +} from '../core/operation-log.const'; +import { SyncSafetyBackupService } from '../../imex/sync/sync-safety-backup.service'; import { compareVectorClocks, incrementVectorClock, mergeVectorClocks, VectorClockComparison, -} from '../../../../pfapi/api/util/vector-clock'; -import { devError } from '../../../../util/dev-error'; -import { uuidv7 } from '../../../../util/uuid-v7'; +} from '../../pfapi/api/util/vector-clock'; +import { devError } from '../../util/dev-error'; +import { uuidv7 } from '../../util/uuid-v7'; import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; -import { CLIENT_ID_PROVIDER } from '../client-id.provider'; +import { CLIENT_ID_PROVIDER } from '../util/client-id.provider'; import { getEntityConfig, isAdapterEntity, isSingletonEntity, isMapEntity, isArrayEntity, -} from '../entity-registry'; -import { selectIssueProviderById } from '../../../../features/issue/store/issue-provider.selectors'; +} from '../core/entity-registry'; +import { selectIssueProviderById } from '../../features/issue/store/issue-provider.selectors'; /** * Represents the result of LWW (Last-Write-Wins) conflict resolution. diff --git a/src/app/core/persistence/operation-log/sync/immediate-upload.service.spec.ts b/src/app/op-log/sync/immediate-upload.service.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/sync/immediate-upload.service.spec.ts rename to src/app/op-log/sync/immediate-upload.service.spec.ts index 945b42485..401a13f3e 100644 --- a/src/app/core/persistence/operation-log/sync/immediate-upload.service.spec.ts +++ b/src/app/op-log/sync/immediate-upload.service.spec.ts @@ -1,8 +1,8 @@ import { TestBed, fakeAsync, tick } from '@angular/core/testing'; import { ImmediateUploadService } from './immediate-upload.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; +import { PfapiService } from '../../pfapi/pfapi.service'; import { OperationLogSyncService } from './operation-log-sync.service'; -import { Operation, OpType } from '../operation.types'; +import { Operation, OpType } from '../core/operation.types'; describe('ImmediateUploadService', () => { let service: ImmediateUploadService; diff --git a/src/app/core/persistence/operation-log/sync/immediate-upload.service.ts b/src/app/op-log/sync/immediate-upload.service.ts similarity index 97% rename from src/app/core/persistence/operation-log/sync/immediate-upload.service.ts rename to src/app/op-log/sync/immediate-upload.service.ts index 86d50a180..b4945ae86 100644 --- a/src/app/core/persistence/operation-log/sync/immediate-upload.service.ts +++ b/src/app/op-log/sync/immediate-upload.service.ts @@ -1,11 +1,11 @@ import { inject, Injectable, OnDestroy } from '@angular/core'; import { Subject, Subscription } from 'rxjs'; import { debounceTime, exhaustMap, filter } from 'rxjs/operators'; -import { isOnline } from '../../../../util/is-online'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; +import { isOnline } from '../../util/is-online'; +import { PfapiService } from '../../pfapi/pfapi.service'; import { OperationLogSyncService } from './operation-log-sync.service'; import { isOperationSyncCapable } from './operation-sync.util'; -import { OpLog } from '../../../log'; +import { OpLog } from '../../core/log'; const IMMEDIATE_UPLOAD_DEBOUNCE_MS = 2000; diff --git a/src/app/core/persistence/operation-log/sync/lock.service.spec.ts b/src/app/op-log/sync/lock.service.spec.ts similarity index 100% rename from src/app/core/persistence/operation-log/sync/lock.service.spec.ts rename to src/app/op-log/sync/lock.service.spec.ts diff --git a/src/app/core/persistence/operation-log/sync/lock.service.ts b/src/app/op-log/sync/lock.service.ts similarity index 94% rename from src/app/core/persistence/operation-log/sync/lock.service.ts rename to src/app/op-log/sync/lock.service.ts index a1844e995..cabdf29fc 100644 --- a/src/app/core/persistence/operation-log/sync/lock.service.ts +++ b/src/app/op-log/sync/lock.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -import { OpLog } from '../../../log'; -import { IS_ELECTRON } from '../../../../app.constants'; -import { IS_ANDROID_WEB_VIEW } from '../../../../util/is-android-web-view'; +import { OpLog } from '../../core/log'; +import { IS_ELECTRON } from '../../app.constants'; +import { IS_ANDROID_WEB_VIEW } from '../../util/is-android-web-view'; /** * Provides a cross-tab locking mechanism for critical operations using the Web Locks API. diff --git a/src/app/core/persistence/operation-log/sync/operation-encryption.service.spec.ts b/src/app/op-log/sync/operation-encryption.service.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/sync/operation-encryption.service.spec.ts rename to src/app/op-log/sync/operation-encryption.service.spec.ts index 76105a5a9..62fb22ee3 100644 --- a/src/app/core/persistence/operation-log/sync/operation-encryption.service.spec.ts +++ b/src/app/op-log/sync/operation-encryption.service.spec.ts @@ -1,7 +1,7 @@ import { TestBed } from '@angular/core/testing'; import { OperationEncryptionService } from './operation-encryption.service'; -import { SyncOperation } from '../../../../pfapi/api/sync/sync-provider.interface'; -import { DecryptError } from '../../../../pfapi/api/errors/errors'; +import { SyncOperation } from '../../pfapi/api/sync/sync-provider.interface'; +import { DecryptError } from '../../pfapi/api/errors/errors'; describe('OperationEncryptionService', () => { let service: OperationEncryptionService; diff --git a/src/app/core/persistence/operation-log/sync/operation-encryption.service.ts b/src/app/op-log/sync/operation-encryption.service.ts similarity index 92% rename from src/app/core/persistence/operation-log/sync/operation-encryption.service.ts rename to src/app/op-log/sync/operation-encryption.service.ts index e07dccdb6..68b1cf3a1 100644 --- a/src/app/core/persistence/operation-log/sync/operation-encryption.service.ts +++ b/src/app/op-log/sync/operation-encryption.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -import { encrypt, decrypt } from '../../../../pfapi/api/encryption/encryption'; -import { SyncOperation } from '../../../../pfapi/api/sync/sync-provider.interface'; -import { DecryptError } from '../../../../pfapi/api/errors/errors'; +import { encrypt, decrypt } from '../../pfapi/api/encryption/encryption'; +import { SyncOperation } from '../../pfapi/api/sync/sync-provider.interface'; +import { DecryptError } from '../../pfapi/api/errors/errors'; /** * Handles E2E encryption/decryption of operation payloads for SuperSync. diff --git a/src/app/core/persistence/operation-log/sync/operation-log-download.service.spec.ts b/src/app/op-log/sync/operation-log-download.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/sync/operation-log-download.service.spec.ts rename to src/app/op-log/sync/operation-log-download.service.spec.ts index c9fae8f64..d19e67a01 100644 --- a/src/app/core/persistence/operation-log/sync/operation-log-download.service.spec.ts +++ b/src/app/op-log/sync/operation-log-download.service.spec.ts @@ -2,16 +2,16 @@ import { fakeAsync, TestBed, tick } from '@angular/core/testing'; import { OperationLogDownloadService } from './operation-log-download.service'; import { OperationLogStoreService } from '../store/operation-log-store.service'; import { LockService } from './lock.service'; -import { SnackService } from '../../../snack/snack.service'; +import { SnackService } from '../../core/snack/snack.service'; import { SyncProviderServiceInterface, OperationSyncCapable, -} from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; -import { OpType } from '../operation.types'; -import { CLOCK_DRIFT_THRESHOLD_MS } from '../operation-log.const'; -import { OpLog } from '../../../log'; -import { T } from '../../../../t.const'; +} from '../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../pfapi/api/pfapi.const'; +import { OpType } from '../core/operation.types'; +import { CLOCK_DRIFT_THRESHOLD_MS } from '../core/operation-log.const'; +import { OpLog } from '../../core/log'; +import { T } from '../../t.const'; describe('OperationLogDownloadService', () => { let service: OperationLogDownloadService; diff --git a/src/app/core/persistence/operation-log/sync/operation-log-download.service.ts b/src/app/op-log/sync/operation-log-download.service.ts similarity index 94% rename from src/app/core/persistence/operation-log/sync/operation-log-download.service.ts rename to src/app/op-log/sync/operation-log-download.service.ts index 6677a5160..416521095 100644 --- a/src/app/core/persistence/operation-log/sync/operation-log-download.service.ts +++ b/src/app/op-log/sync/operation-log-download.service.ts @@ -1,26 +1,26 @@ import { inject, Injectable } from '@angular/core'; import { OperationLogStoreService } from '../store/operation-log-store.service'; import { LockService } from './lock.service'; -import { Operation } from '../operation.types'; -import { OpLog } from '../../../log'; +import { Operation } from '../core/operation.types'; +import { OpLog } from '../../core/log'; import { SyncProviderServiceInterface, OperationSyncCapable, SyncOperation, -} from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; +} from '../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../pfapi/api/pfapi.const'; import { isOperationSyncCapable, syncOpToOperation } from './operation-sync.util'; -import { SnackService } from '../../../snack/snack.service'; -import { T } from '../../../../t.const'; +import { SnackService } from '../../core/snack/snack.service'; +import { T } from '../../t.const'; import { LOCK_NAMES, MAX_DOWNLOAD_OPS_IN_MEMORY, MAX_DOWNLOAD_ITERATIONS, CLOCK_DRIFT_THRESHOLD_MS, -} from '../operation-log.const'; +} from '../core/operation-log.const'; import { OperationEncryptionService } from './operation-encryption.service'; -import { SuperSyncPrivateCfg } from '../../../../pfapi/api/sync/providers/super-sync/super-sync.model'; -import { DecryptError } from '../../../../pfapi/api/errors/errors'; +import { SuperSyncPrivateCfg } from '../../pfapi/api/sync/providers/super-sync/super-sync.model'; +import { DecryptError } from '../../pfapi/api/errors/errors'; import { SuperSyncStatusService } from './super-sync-status.service'; /** @@ -50,13 +50,13 @@ export interface DownloadResult { * This is populated when forceFromSeq0 is true, allowing callers to rebuild their * vector clock state from all known ops on the server. */ - allOpClocks?: import('../operation.types').VectorClock[]; + allOpClocks?: import('../core/operation.types').VectorClock[]; /** * Aggregated vector clock from all ops before and including the snapshot. * Only set when snapshot optimization is used (sinceSeq < latestSnapshotSeq). * Clients need this to create merged updates that dominate all known clocks. */ - snapshotVectorClock?: import('../operation.types').VectorClock; + snapshotVectorClock?: import('../core/operation.types').VectorClock; } /** @@ -116,11 +116,11 @@ export class OperationLogDownloadService { ); const allNewOps: Operation[] = []; - const allOpClocks: import('../operation.types').VectorClock[] = []; + const allOpClocks: import('../core/operation.types').VectorClock[] = []; let downloadFailed = false; let needsFullStateUpload = false; let finalLatestSeq = 0; - let snapshotVectorClock: import('../operation.types').VectorClock | undefined; + let snapshotVectorClock: import('../core/operation.types').VectorClock | undefined; // Get encryption key upfront const privateCfg = diff --git a/src/app/core/persistence/operation-log/sync/operation-log-sync.service.spec.ts b/src/app/op-log/sync/operation-log-sync.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/sync/operation-log-sync.service.spec.ts rename to src/app/op-log/sync/operation-log-sync.service.spec.ts index 7a826f882..7c40e3b30 100644 --- a/src/app/core/persistence/operation-log/sync/operation-log-sync.service.spec.ts +++ b/src/app/op-log/sync/operation-log-sync.service.spec.ts @@ -4,15 +4,15 @@ import { SchemaMigrationService, MAX_VERSION_SKIP, } from '../store/schema-migration.service'; -import { SnackService } from '../../../snack/snack.service'; +import { SnackService } from '../../core/snack/snack.service'; import { OperationLogStoreService } from '../store/operation-log-store.service'; import { VectorClockService } from './vector-clock.service'; -import { OperationApplierService } from '../processing/operation-applier.service'; +import { OperationApplierService } from '../apply/operation-applier.service'; import { ConflictResolutionService } from './conflict-resolution.service'; -import { ValidateStateService } from '../processing/validate-state.service'; -import { RepairOperationService } from '../processing/repair-operation.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; +import { ValidateStateService } from '../validation/validate-state.service'; +import { RepairOperationService } from '../validation/repair-operation.service'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; +import { PfapiService } from '../../pfapi/pfapi.service'; import { OperationLogUploadService } from './operation-log-upload.service'; import { OperationLogDownloadService } from './operation-log-download.service'; import { LockService } from './lock.service'; @@ -21,14 +21,14 @@ import { SyncImportFilterService } from './sync-import-filter.service'; import { ServerMigrationService } from './server-migration.service'; import { StaleOperationResolverService } from './stale-operation-resolver.service'; import { provideMockStore } from '@ngrx/store/testing'; -import { EntityConflict, Operation, OpType, VectorClock } from '../operation.types'; +import { EntityConflict, Operation, OpType, VectorClock } from '../core/operation.types'; import { compareVectorClocks, mergeVectorClocks, VectorClockComparison, -} from '../../../../pfapi/api/util/vector-clock'; -import { toEntityKey } from '../entity-key.util'; -import { T } from '../../../../t.const'; +} from '../../pfapi/api/util/vector-clock'; +import { toEntityKey } from '../util/entity-key.util'; +import { T } from '../../t.const'; import { TranslateService } from '@ngx-translate/core'; // Helper to mock OpLogEntry diff --git a/src/app/core/persistence/operation-log/sync/operation-log-sync.service.ts b/src/app/op-log/sync/operation-log-sync.service.ts similarity index 98% rename from src/app/core/persistence/operation-log/sync/operation-log-sync.service.ts rename to src/app/op-log/sync/operation-log-sync.service.ts index 0c6c89150..ccf63ba78 100644 --- a/src/app/core/persistence/operation-log/sync/operation-log-sync.service.ts +++ b/src/app/op-log/sync/operation-log-sync.service.ts @@ -8,14 +8,14 @@ import { Operation, OpType, VectorClock, -} from '../operation.types'; -import { OpLog } from '../../../log'; -import { SyncProviderServiceInterface } from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; +} from '../core/operation.types'; +import { OpLog } from '../../core/log'; +import { SyncProviderServiceInterface } from '../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../pfapi/api/pfapi.const'; import { isOperationSyncCapable } from './operation-sync.util'; -import { OperationApplierService } from '../processing/operation-applier.service'; +import { OperationApplierService } from '../apply/operation-applier.service'; import { ConflictResolutionService } from './conflict-resolution.service'; -import { ValidateStateService } from '../processing/validate-state.service'; +import { ValidateStateService } from '../validation/validate-state.service'; import { OperationLogUploadService, UploadResult } from './operation-log-upload.service'; import { OperationLogDownloadService } from './operation-log-download.service'; import { VectorClockService } from './vector-clock.service'; @@ -23,13 +23,13 @@ import { MAX_VERSION_SKIP, SchemaMigrationService, } from '../store/schema-migration.service'; -import { SnackService } from '../../../snack/snack.service'; -import { T } from '../../../../t.const'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; -import { lazyInject } from '../../../../util/lazy-inject'; -import { LOCK_NAMES, MAX_REJECTED_OPS_BEFORE_WARNING } from '../operation-log.const'; -import { CLIENT_ID_PROVIDER } from '../client-id.provider'; +import { SnackService } from '../../core/snack/snack.service'; +import { T } from '../../t.const'; +import { PfapiService } from '../../pfapi/pfapi.service'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; +import { lazyInject } from '../../util/lazy-inject'; +import { LOCK_NAMES, MAX_REJECTED_OPS_BEFORE_WARNING } from '../core/operation-log.const'; +import { CLIENT_ID_PROVIDER } from '../util/client-id.provider'; import { LockService } from './lock.service'; import { OperationLogCompactionService } from '../store/operation-log-compaction.service'; import { SuperSyncStatusService } from './super-sync-status.service'; diff --git a/src/app/core/persistence/operation-log/sync/operation-log-upload.service.spec.ts b/src/app/op-log/sync/operation-log-upload.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/sync/operation-log-upload.service.spec.ts rename to src/app/op-log/sync/operation-log-upload.service.spec.ts index 65f2bcad4..14ab265c1 100644 --- a/src/app/core/persistence/operation-log/sync/operation-log-upload.service.spec.ts +++ b/src/app/op-log/sync/operation-log-upload.service.spec.ts @@ -5,10 +5,10 @@ import { LockService } from './lock.service'; import { SyncProviderServiceInterface, OperationSyncCapable, -} from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; -import { OpType, OperationLogEntry } from '../operation.types'; -import { SnackService } from '../../../snack/snack.service'; +} from '../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../pfapi/api/pfapi.const'; +import { OpType, OperationLogEntry } from '../core/operation.types'; +import { SnackService } from '../../core/snack/snack.service'; import { provideMockStore } from '@ngrx/store/testing'; describe('OperationLogUploadService', () => { diff --git a/src/app/core/persistence/operation-log/sync/operation-log-upload.service.ts b/src/app/op-log/sync/operation-log-upload.service.ts similarity index 97% rename from src/app/core/persistence/operation-log/sync/operation-log-upload.service.ts rename to src/app/op-log/sync/operation-log-upload.service.ts index b90405783..d574b5e85 100644 --- a/src/app/core/persistence/operation-log/sync/operation-log-upload.service.ts +++ b/src/app/op-log/sync/operation-log-upload.service.ts @@ -1,19 +1,19 @@ import { inject, Injectable } from '@angular/core'; import { OperationLogStoreService } from '../store/operation-log-store.service'; import { LockService } from './lock.service'; -import { Operation, OperationLogEntry, OpType } from '../operation.types'; -import { OpLog } from '../../../log'; -import { LOCK_NAMES } from '../operation-log.const'; -import { chunkArray } from '../../../../util/chunk-array'; +import { Operation, OperationLogEntry, OpType } from '../core/operation.types'; +import { OpLog } from '../../core/log'; +import { LOCK_NAMES } from '../core/operation-log.const'; +import { chunkArray } from '../../util/chunk-array'; import { SyncProviderServiceInterface, OperationSyncCapable, SyncOperation, -} from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; +} from '../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../pfapi/api/pfapi.const'; import { isOperationSyncCapable, syncOpToOperation } from './operation-sync.util'; import { OperationEncryptionService } from './operation-encryption.service'; -import { SuperSyncPrivateCfg } from '../../../../pfapi/api/sync/providers/super-sync/super-sync.model'; +import { SuperSyncPrivateCfg } from '../../pfapi/api/sync/providers/super-sync/super-sync.model'; /** * Operation types that contain full application state and should use diff --git a/src/app/core/persistence/operation-log/sync/operation-sync.util.spec.ts b/src/app/op-log/sync/operation-sync.util.spec.ts similarity index 97% rename from src/app/core/persistence/operation-log/sync/operation-sync.util.spec.ts rename to src/app/op-log/sync/operation-sync.util.spec.ts index 21e6ae1ab..671c8034b 100644 --- a/src/app/core/persistence/operation-log/sync/operation-sync.util.spec.ts +++ b/src/app/op-log/sync/operation-sync.util.spec.ts @@ -3,9 +3,9 @@ import { SyncProviderServiceInterface, OperationSyncCapable, SyncOperation, -} from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; -import { OpType } from '../operation.types'; +} from '../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../pfapi/api/pfapi.const'; +import { OpType } from '../core/operation.types'; describe('operation-sync utility', () => { describe('isOperationSyncCapable', () => { diff --git a/src/app/core/persistence/operation-log/sync/operation-sync.util.ts b/src/app/op-log/sync/operation-sync.util.ts similarity index 85% rename from src/app/core/persistence/operation-log/sync/operation-sync.util.ts rename to src/app/op-log/sync/operation-sync.util.ts index c4ce82e15..f498fab8e 100644 --- a/src/app/core/persistence/operation-log/sync/operation-sync.util.ts +++ b/src/app/op-log/sync/operation-sync.util.ts @@ -1,10 +1,10 @@ -import { Operation } from '../operation.types'; +import { Operation } from '../core/operation.types'; import { SyncProviderServiceInterface, OperationSyncCapable, SyncOperation, -} from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; +} from '../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../pfapi/api/pfapi.const'; /** * Type guard to check if a provider supports operation-based sync (API sync). diff --git a/src/app/core/persistence/operation-log/sync/operation-write-flush.service.spec.ts b/src/app/op-log/sync/operation-write-flush.service.spec.ts similarity index 100% rename from src/app/core/persistence/operation-log/sync/operation-write-flush.service.spec.ts rename to src/app/op-log/sync/operation-write-flush.service.spec.ts diff --git a/src/app/core/persistence/operation-log/sync/operation-write-flush.service.ts b/src/app/op-log/sync/operation-write-flush.service.ts similarity index 96% rename from src/app/core/persistence/operation-log/sync/operation-write-flush.service.ts rename to src/app/op-log/sync/operation-write-flush.service.ts index 569c3013c..f01cf0f2f 100644 --- a/src/app/core/persistence/operation-log/sync/operation-write-flush.service.ts +++ b/src/app/op-log/sync/operation-write-flush.service.ts @@ -1,8 +1,8 @@ import { inject, Injectable } from '@angular/core'; import { LockService } from './lock.service'; -import { OperationCaptureService } from '../processing/operation-capture.service'; -import { OpLog } from '../../../log'; -import { LOCK_NAMES } from '../operation-log.const'; +import { OperationCaptureService } from '../capture/operation-capture.service'; +import { OpLog } from '../../core/log'; +import { LOCK_NAMES } from '../core/operation-log.const'; /** * Service to ensure all pending operation writes have completed. diff --git a/src/app/core/persistence/operation-log/sync/server-migration.service.spec.ts b/src/app/op-log/sync/server-migration.service.spec.ts similarity index 96% rename from src/app/core/persistence/operation-log/sync/server-migration.service.spec.ts rename to src/app/op-log/sync/server-migration.service.spec.ts index 0c0c04f3b..6a47402c0 100644 --- a/src/app/core/persistence/operation-log/sync/server-migration.service.spec.ts +++ b/src/app/op-log/sync/server-migration.service.spec.ts @@ -4,18 +4,18 @@ import { provideMockStore, MockStore } from '@ngrx/store/testing'; import { ServerMigrationService } from './server-migration.service'; import { OperationLogStoreService } from '../store/operation-log-store.service'; import { VectorClockService } from './vector-clock.service'; -import { ValidateStateService } from '../processing/validate-state.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; -import { SnackService } from '../../../snack/snack.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; +import { ValidateStateService } from '../validation/validate-state.service'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; +import { SnackService } from '../../core/snack/snack.service'; +import { PfapiService } from '../../pfapi/pfapi.service'; import { SyncProviderServiceInterface, OperationSyncCapable, -} from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; -import { OpType } from '../operation.types'; -import { SYSTEM_TAG_IDS } from '../../../../features/tag/tag.const'; -import { loadAllData } from '../../../../root-store/meta/load-all-data.action'; +} from '../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../pfapi/api/pfapi.const'; +import { OpType } from '../core/operation.types'; +import { SYSTEM_TAG_IDS } from '../../features/tag/tag.const'; +import { loadAllData } from '../../root-store/meta/load-all-data.action'; describe('ServerMigrationService', () => { let service: ServerMigrationService; diff --git a/src/app/core/persistence/operation-log/sync/server-migration.service.ts b/src/app/op-log/sync/server-migration.service.ts similarity index 90% rename from src/app/core/persistence/operation-log/sync/server-migration.service.ts rename to src/app/op-log/sync/server-migration.service.ts index e8f7553e9..61b7710aa 100644 --- a/src/app/core/persistence/operation-log/sync/server-migration.service.ts +++ b/src/app/op-log/sync/server-migration.service.ts @@ -1,23 +1,23 @@ import { inject, Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; -import { SyncProviderServiceInterface } from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; +import { SyncProviderServiceInterface } from '../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../pfapi/api/pfapi.const'; import { isOperationSyncCapable } from './operation-sync.util'; import { OperationLogStoreService } from '../store/operation-log-store.service'; import { VectorClockService } from './vector-clock.service'; -import { incrementVectorClock } from '../../../../pfapi/api/util/vector-clock'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; -import { ValidateStateService } from '../processing/validate-state.service'; -import { AppDataCompleteNew } from '../../../../pfapi/pfapi-config'; -import { SnackService } from '../../../snack/snack.service'; -import { T } from '../../../../t.const'; -import { loadAllData } from '../../../../root-store/meta/load-all-data.action'; +import { incrementVectorClock } from '../../pfapi/api/util/vector-clock'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; +import { ValidateStateService } from '../validation/validate-state.service'; +import { AppDataCompleteNew } from '../../pfapi/pfapi-config'; +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 '../store/schema-migration.service'; -import { Operation, OpType } from '../operation.types'; -import { uuidv7 } from '../../../../util/uuid-v7'; -import { OpLog } from '../../../log'; -import { SYSTEM_TAG_IDS } from '../../../../features/tag/tag.const'; -import { CLIENT_ID_PROVIDER } from '../client-id.provider'; +import { 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'; +import { CLIENT_ID_PROVIDER } from '../util/client-id.provider'; /** * Service responsible for handling server migration scenarios. diff --git a/src/app/core/persistence/operation-log/sync/stale-operation-resolver.service.ts b/src/app/op-log/sync/stale-operation-resolver.service.ts similarity index 94% rename from src/app/core/persistence/operation-log/sync/stale-operation-resolver.service.ts rename to src/app/op-log/sync/stale-operation-resolver.service.ts index ae590924a..22542e1c8 100644 --- a/src/app/core/persistence/operation-log/sync/stale-operation-resolver.service.ts +++ b/src/app/op-log/sync/stale-operation-resolver.service.ts @@ -1,19 +1,19 @@ import { inject, Injectable } from '@angular/core'; import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { Operation, OpType, VectorClock } from '../operation.types'; +import { Operation, OpType, VectorClock } from '../core/operation.types'; import { incrementVectorClock, mergeVectorClocks, -} from '../../../../pfapi/api/util/vector-clock'; -import { OpLog } from '../../../log'; +} from '../../pfapi/api/util/vector-clock'; +import { OpLog } from '../../core/log'; import { ConflictResolutionService } from './conflict-resolution.service'; import { VectorClockService } from './vector-clock.service'; -import { toEntityKey } from '../entity-key.util'; +import { toEntityKey } from '../util/entity-key.util'; import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; -import { SnackService } from '../../../snack/snack.service'; -import { T } from '../../../../t.const'; -import { uuidv7 } from '../../../../util/uuid-v7'; -import { CLIENT_ID_PROVIDER } from '../client-id.provider'; +import { SnackService } from '../../core/snack/snack.service'; +import { T } from '../../t.const'; +import { uuidv7 } from '../../util/uuid-v7'; +import { CLIENT_ID_PROVIDER } from '../util/client-id.provider'; /** * Resolves stale local operations that were rejected due to concurrent modification. diff --git a/src/app/core/persistence/operation-log/sync/super-sync-status.service.spec.ts b/src/app/op-log/sync/super-sync-status.service.spec.ts similarity index 100% rename from src/app/core/persistence/operation-log/sync/super-sync-status.service.spec.ts rename to src/app/op-log/sync/super-sync-status.service.spec.ts diff --git a/src/app/core/persistence/operation-log/sync/super-sync-status.service.ts b/src/app/op-log/sync/super-sync-status.service.ts similarity index 100% rename from src/app/core/persistence/operation-log/sync/super-sync-status.service.ts rename to src/app/op-log/sync/super-sync-status.service.ts diff --git a/src/app/core/persistence/operation-log/sync/sync-import-filter.service.spec.ts b/src/app/op-log/sync/sync-import-filter.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/sync/sync-import-filter.service.spec.ts rename to src/app/op-log/sync/sync-import-filter.service.spec.ts index 64fa153b1..7496b68b3 100644 --- a/src/app/core/persistence/operation-log/sync/sync-import-filter.service.spec.ts +++ b/src/app/op-log/sync/sync-import-filter.service.spec.ts @@ -1,7 +1,7 @@ import { TestBed } from '@angular/core/testing'; import { SyncImportFilterService } from './sync-import-filter.service'; import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { Operation, OpType } from '../operation.types'; +import { Operation, OpType } from '../core/operation.types'; describe('SyncImportFilterService', () => { let service: SyncImportFilterService; diff --git a/src/app/core/persistence/operation-log/sync/sync-import-filter.service.ts b/src/app/op-log/sync/sync-import-filter.service.ts similarity index 97% rename from src/app/core/persistence/operation-log/sync/sync-import-filter.service.ts rename to src/app/op-log/sync/sync-import-filter.service.ts index 65d40ed43..84f914d13 100644 --- a/src/app/core/persistence/operation-log/sync/sync-import-filter.service.ts +++ b/src/app/op-log/sync/sync-import-filter.service.ts @@ -1,11 +1,11 @@ import { inject, Injectable } from '@angular/core'; import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { Operation, OpType } from '../operation.types'; +import { Operation, OpType } from '../core/operation.types'; import { compareVectorClocks, VectorClockComparison, -} from '../../../../pfapi/api/util/vector-clock'; -import { OpLog } from '../../../log'; +} from '../../pfapi/api/util/vector-clock'; +import { OpLog } from '../../core/log'; /** * Service responsible for filtering operations invalidated by SYNC_IMPORT, BACKUP_IMPORT, or REPAIR operations. diff --git a/src/app/core/persistence/operation-log/sync/vector-clock.service.spec.ts b/src/app/op-log/sync/vector-clock.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/sync/vector-clock.service.spec.ts rename to src/app/op-log/sync/vector-clock.service.spec.ts index 097b1dd0f..491bae9e8 100644 --- a/src/app/core/persistence/operation-log/sync/vector-clock.service.spec.ts +++ b/src/app/op-log/sync/vector-clock.service.spec.ts @@ -1,8 +1,13 @@ import { TestBed } from '@angular/core/testing'; import { VectorClockService } from './vector-clock.service'; import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { Operation, OperationLogEntry, OpType, EntityType } from '../operation.types'; -import { VectorClock } from '../../../../pfapi/api/util/vector-clock'; +import { + Operation, + OperationLogEntry, + OpType, + EntityType, +} from '../core/operation.types'; +import { VectorClock } from '../../pfapi/api/util/vector-clock'; describe('VectorClockService', () => { let service: VectorClockService; diff --git a/src/app/core/persistence/operation-log/sync/vector-clock.service.ts b/src/app/op-log/sync/vector-clock.service.ts similarity index 97% rename from src/app/core/persistence/operation-log/sync/vector-clock.service.ts rename to src/app/op-log/sync/vector-clock.service.ts index 8d1a04956..ea11da8ac 100644 --- a/src/app/core/persistence/operation-log/sync/vector-clock.service.ts +++ b/src/app/op-log/sync/vector-clock.service.ts @@ -1,8 +1,8 @@ import { inject, Injectable } from '@angular/core'; import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { VectorClock, EntityType } from '../operation.types'; -import { mergeVectorClocks } from '../../../../pfapi/api/util/vector-clock'; -import { toEntityKey } from '../entity-key.util'; +import { VectorClock, EntityType } from '../core/operation.types'; +import { mergeVectorClocks } from '../../pfapi/api/util/vector-clock'; +import { toEntityKey } from '../util/entity-key.util'; /** * Service for managing vector clocks in the operation log system. diff --git a/src/app/core/persistence/operation-log/benchmarks/operation-log-stress.spec.ts b/src/app/op-log/testing/benchmarks/operation-log-stress.spec.ts similarity index 94% rename from src/app/core/persistence/operation-log/benchmarks/operation-log-stress.spec.ts rename to src/app/op-log/testing/benchmarks/operation-log-stress.spec.ts index 80a7e4c48..3fdeb3450 100644 --- a/src/app/core/persistence/operation-log/benchmarks/operation-log-stress.spec.ts +++ b/src/app/op-log/testing/benchmarks/operation-log-stress.spec.ts @@ -6,7 +6,7 @@ * * To run these benchmarks: * 1. Change `xdescribe` to `describe` below - * 2. Run: npm run test:file src/app/core/persistence/operation-log/benchmarks/operation-log-stress.benchmark.ts + * 2. Run: npm run test:file src/app/op-log/testing/benchmarks/operation-log-stress.benchmark.ts * 3. Watch the console output for timing information * * Note: Results vary significantly based on: @@ -18,9 +18,9 @@ * due to timing dependencies on system load. */ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { Operation, OpType, EntityType } from '../operation.types'; -import { uuidv7 } from '../../../../util/uuid-v7'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { Operation, OpType, EntityType } from '../../core/operation.types'; +import { uuidv7 } from '../../../util/uuid-v7'; // Increase timeout for stress tests jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000; diff --git a/src/app/core/persistence/operation-log/integration/archive-subtask-sync.integration.spec.ts b/src/app/op-log/testing/integration/archive-subtask-sync.integration.spec.ts similarity index 96% rename from src/app/core/persistence/operation-log/integration/archive-subtask-sync.integration.spec.ts rename to src/app/op-log/testing/integration/archive-subtask-sync.integration.spec.ts index adfd22ca2..c166b36cc 100644 --- a/src/app/core/persistence/operation-log/integration/archive-subtask-sync.integration.spec.ts +++ b/src/app/op-log/testing/integration/archive-subtask-sync.integration.spec.ts @@ -1,16 +1,20 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType, extractActionPayload, MultiEntityPayload } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { + OpType, + extractActionPayload, + MultiEntityPayload, +} from '../../core/operation.types'; import { TestClient, resetTestUuidCounter } from './helpers/test-client.helper'; -import { convertOpToAction } from '../operation-converter.util'; -import { TaskSharedActions } from '../../../../root-store/meta/task-shared.actions'; -import { Task, TaskWithSubTasks } from '../../../../features/tasks/task.model'; -import { ArchiveService } from '../../../../features/time-tracking/archive.service'; -import { ArchiveOperationHandler } from '../processing/archive-operation-handler.service'; -import { TaskArchiveService } from '../../../../features/time-tracking/task-archive.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { TimeTrackingService } from '../../../../features/time-tracking/time-tracking.service'; -import { flattenTasks } from '../../../../features/tasks/store/task.selectors'; +import { convertOpToAction } from '../../apply/operation-converter.util'; +import { TaskSharedActions } from '../../../root-store/meta/task-shared.actions'; +import { Task, TaskWithSubTasks } from '../../../features/tasks/task.model'; +import { ArchiveService } from '../../../features/time-tracking/archive.service'; +import { ArchiveOperationHandler } from '../../apply/archive-operation-handler.service'; +import { TaskArchiveService } from '../../../features/time-tracking/task-archive.service'; +import { PfapiService } from '../../../pfapi/pfapi.service'; +import { TimeTrackingService } from '../../../features/time-tracking/time-tracking.service'; +import { flattenTasks } from '../../../features/tasks/store/task.selectors'; /** * Integration tests for archive subtask sync. diff --git a/src/app/core/persistence/operation-log/integration/bulk-hydration.integration.spec.ts b/src/app/op-log/testing/integration/bulk-hydration.integration.spec.ts similarity index 96% rename from src/app/core/persistence/operation-log/integration/bulk-hydration.integration.spec.ts rename to src/app/op-log/testing/integration/bulk-hydration.integration.spec.ts index ba7fe0262..81c7cce17 100644 --- a/src/app/core/persistence/operation-log/integration/bulk-hydration.integration.spec.ts +++ b/src/app/op-log/testing/integration/bulk-hydration.integration.spec.ts @@ -10,11 +10,11 @@ * operations need to be replayed efficiently. */ import { ActionReducer, Action } from '@ngrx/store'; -import { bulkHydrationMetaReducer } from '../bulk-hydration.meta-reducer'; -import { bulkApplyHydrationOperations } from '../bulk-hydration.action'; -import { convertOpToAction } from '../operation-converter.util'; -import { Operation, OpType } from '../operation.types'; -import { lwwUpdateMetaReducer } from '../../../../root-store/meta/task-shared-meta-reducers/lww-update.meta-reducer'; +import { bulkHydrationMetaReducer } from '../../apply/bulk-hydration.meta-reducer'; +import { bulkApplyHydrationOperations } from '../../apply/bulk-hydration.action'; +import { convertOpToAction } from '../../apply/operation-converter.util'; +import { Operation, OpType } from '../../core/operation.types'; +import { lwwUpdateMetaReducer } from '../../../root-store/meta/task-shared-meta-reducers/lww-update.meta-reducer'; describe('Bulk Hydration Integration', () => { const TASKS_FEATURE = 'tasks'; diff --git a/src/app/core/persistence/operation-log/integration/compaction.integration.spec.ts b/src/app/op-log/testing/integration/compaction.integration.spec.ts similarity index 97% rename from src/app/core/persistence/operation-log/integration/compaction.integration.spec.ts rename to src/app/op-log/testing/integration/compaction.integration.spec.ts index a426450b6..7fb38add2 100644 --- a/src/app/core/persistence/operation-log/integration/compaction.integration.spec.ts +++ b/src/app/op-log/testing/integration/compaction.integration.spec.ts @@ -1,9 +1,9 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OperationLogCompactionService } from '../store/operation-log-compaction.service'; -import { VectorClockService } from '../sync/vector-clock.service'; -import { OpType, VectorClock } from '../operation.types'; -import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OperationLogCompactionService } from '../../store/operation-log-compaction.service'; +import { VectorClockService } from '../../sync/vector-clock.service'; +import { OpType, VectorClock } from '../../core/operation.types'; +import { CURRENT_SCHEMA_VERSION } from '../../store/schema-migration.service'; import { TestClient, resetTestUuidCounter } from './helpers/test-client.helper'; import { createTaskOperation, @@ -13,8 +13,8 @@ import { import { COMPACTION_RETENTION_MS, EMERGENCY_COMPACTION_RETENTION_MS, -} from '../operation-log.const'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; +} from '../../core/operation-log.const'; +import { PfapiStoreDelegateService } from '../../../pfapi/pfapi-store-delegate.service'; /** * Integration tests for operation log compaction and snapshot functionality. diff --git a/src/app/core/persistence/operation-log/integration/cross-entity-sync.integration.spec.ts b/src/app/op-log/testing/integration/cross-entity-sync.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/cross-entity-sync.integration.spec.ts rename to src/app/op-log/testing/integration/cross-entity-sync.integration.spec.ts index 58e1fb383..879a3f98d 100644 --- a/src/app/core/persistence/operation-log/integration/cross-entity-sync.integration.spec.ts +++ b/src/app/op-log/testing/integration/cross-entity-sync.integration.spec.ts @@ -1,11 +1,11 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { VectorClockService } from '../sync/vector-clock.service'; -import { OpType } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { VectorClockService } from '../../sync/vector-clock.service'; +import { OpType } from '../../core/operation.types'; import { compareVectorClocks, VectorClockComparison, -} from '../../../../pfapi/api/util/vector-clock'; +} from '../../../pfapi/api/util/vector-clock'; import { TestClient, resetTestUuidCounter } from './helpers/test-client.helper'; import { createTaskOperation, diff --git a/src/app/core/persistence/operation-log/integration/helpers/mock-sync-server.helper.ts b/src/app/op-log/testing/integration/helpers/mock-sync-server.helper.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/helpers/mock-sync-server.helper.ts rename to src/app/op-log/testing/integration/helpers/mock-sync-server.helper.ts index 085d27c46..cd2366072 100644 --- a/src/app/core/persistence/operation-log/integration/helpers/mock-sync-server.helper.ts +++ b/src/app/op-log/testing/integration/helpers/mock-sync-server.helper.ts @@ -4,7 +4,7 @@ import { OpUploadResponse, OpDownloadResponse, OpUploadResult, -} from '../../../../../pfapi/api/sync/sync-provider.interface'; +} from '../../../../pfapi/api/sync/sync-provider.interface'; /** * Simulates a sync server for integration testing. diff --git a/src/app/core/persistence/operation-log/integration/helpers/operation-factory.helper.ts b/src/app/op-log/testing/integration/helpers/operation-factory.helper.ts similarity index 99% rename from src/app/core/persistence/operation-log/integration/helpers/operation-factory.helper.ts rename to src/app/op-log/testing/integration/helpers/operation-factory.helper.ts index 3c826c91a..f3aebc72e 100644 --- a/src/app/core/persistence/operation-log/integration/helpers/operation-factory.helper.ts +++ b/src/app/op-log/testing/integration/helpers/operation-factory.helper.ts @@ -1,4 +1,4 @@ -import { Operation, OpType, EntityType } from '../../operation.types'; +import { Operation, OpType, EntityType } from '../../../core/operation.types'; import { TestClient } from './test-client.helper'; /** diff --git a/src/app/core/persistence/operation-log/integration/helpers/simulated-client.helper.ts b/src/app/op-log/testing/integration/helpers/simulated-client.helper.ts similarity index 96% rename from src/app/core/persistence/operation-log/integration/helpers/simulated-client.helper.ts rename to src/app/op-log/testing/integration/helpers/simulated-client.helper.ts index e534dfaf2..6b4df1af5 100644 --- a/src/app/core/persistence/operation-log/integration/helpers/simulated-client.helper.ts +++ b/src/app/op-log/testing/integration/helpers/simulated-client.helper.ts @@ -1,9 +1,9 @@ -import { Operation, OperationLogEntry, OpType } from '../../operation.types'; -import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { Operation, OperationLogEntry, OpType } from '../../../core/operation.types'; +import { OperationLogStoreService } from '../../../store/operation-log-store.service'; import { SyncOperation, ServerSyncOperation, -} from '../../../../../pfapi/api/sync/sync-provider.interface'; +} from '../../../../pfapi/api/sync/sync-provider.interface'; import { MockSyncServer } from './mock-sync-server.helper'; import { TestClient } from './test-client.helper'; diff --git a/src/app/core/persistence/operation-log/integration/helpers/test-client.helper.ts b/src/app/op-log/testing/integration/helpers/test-client.helper.ts similarity index 92% rename from src/app/core/persistence/operation-log/integration/helpers/test-client.helper.ts rename to src/app/op-log/testing/integration/helpers/test-client.helper.ts index 4fa2b608e..36d6ee31b 100644 --- a/src/app/core/persistence/operation-log/integration/helpers/test-client.helper.ts +++ b/src/app/op-log/testing/integration/helpers/test-client.helper.ts @@ -1,6 +1,11 @@ -import { Operation, OpType, EntityType, VectorClock } from '../../operation.types'; -import { mergeVectorClocks } from '../../../../../pfapi/api/util/vector-clock'; -import { CURRENT_SCHEMA_VERSION } from '../../store/schema-migration.service'; +import { + Operation, + OpType, + EntityType, + VectorClock, +} from '../../../core/operation.types'; +import { mergeVectorClocks } from '../../../../pfapi/api/util/vector-clock'; +import { CURRENT_SCHEMA_VERSION } from '../../../store/schema-migration.service'; /** * Counter for generating deterministic test UUIDs. diff --git a/src/app/core/persistence/operation-log/integration/import-sync.integration.spec.ts b/src/app/op-log/testing/integration/import-sync.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/import-sync.integration.spec.ts rename to src/app/op-log/testing/integration/import-sync.integration.spec.ts index 12923398a..83c5b34ff 100644 --- a/src/app/core/persistence/operation-log/integration/import-sync.integration.spec.ts +++ b/src/app/op-log/testing/integration/import-sync.integration.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention, no-mixed-operators */ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType, Operation } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OpType, Operation } from '../../core/operation.types'; import { resetTestUuidCounter, TestClient } from './helpers/test-client.helper'; import { MockSyncServer } from './helpers/mock-sync-server.helper'; import { SimulatedClient } from './helpers/simulated-client.helper'; @@ -9,8 +9,8 @@ import { createMinimalTaskPayload, createMinimalProjectPayload, } from './helpers/operation-factory.helper'; -import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; -import { uuidv7 } from '../../../../util/uuid-v7'; +import { CURRENT_SCHEMA_VERSION } from '../../store/schema-migration.service'; +import { uuidv7 } from '../../../util/uuid-v7'; /** * Integration tests for Import + Sync scenarios. diff --git a/src/app/core/persistence/operation-log/integration/large-batch-sync.integration.spec.ts b/src/app/op-log/testing/integration/large-batch-sync.integration.spec.ts similarity index 96% rename from src/app/core/persistence/operation-log/integration/large-batch-sync.integration.spec.ts rename to src/app/op-log/testing/integration/large-batch-sync.integration.spec.ts index f96c77a13..3eb7dd17e 100644 --- a/src/app/core/persistence/operation-log/integration/large-batch-sync.integration.spec.ts +++ b/src/app/op-log/testing/integration/large-batch-sync.integration.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OpType } from '../../core/operation.types'; import { resetTestUuidCounter } from './helpers/test-client.helper'; import { MockSyncServer } from './helpers/mock-sync-server.helper'; import { SimulatedClient } from './helpers/simulated-client.helper'; diff --git a/src/app/core/persistence/operation-log/integration/legacy-archive-subtasks.integration.spec.ts b/src/app/op-log/testing/integration/legacy-archive-subtasks.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/legacy-archive-subtasks.integration.spec.ts rename to src/app/op-log/testing/integration/legacy-archive-subtasks.integration.spec.ts index fde3757ba..b15d76c9b 100644 --- a/src/app/core/persistence/operation-log/integration/legacy-archive-subtasks.integration.spec.ts +++ b/src/app/op-log/testing/integration/legacy-archive-subtasks.integration.spec.ts @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType, Operation } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OpType, Operation } from '../../core/operation.types'; import { resetTestUuidCounter, TestClient } from './helpers/test-client.helper'; import { createMinimalTaskPayload } from './helpers/operation-factory.helper'; -import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; -import { uuidv7 } from '../../../../util/uuid-v7'; +import { CURRENT_SCHEMA_VERSION } from '../../store/schema-migration.service'; +import { uuidv7 } from '../../../util/uuid-v7'; /** * Integration tests for legacy data import/export with archive subtasks. diff --git a/src/app/core/persistence/operation-log/integration/legacy-data-migration.integration.spec.ts b/src/app/op-log/testing/integration/legacy-data-migration.integration.spec.ts similarity index 97% rename from src/app/core/persistence/operation-log/integration/legacy-data-migration.integration.spec.ts rename to src/app/op-log/testing/integration/legacy-data-migration.integration.spec.ts index ba35bd2bf..4e24daa23 100644 --- a/src/app/core/persistence/operation-log/integration/legacy-data-migration.integration.spec.ts +++ b/src/app/op-log/testing/integration/legacy-data-migration.integration.spec.ts @@ -1,10 +1,10 @@ import { TestBed } from '@angular/core/testing'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { OperationLogMigrationService } from '../store/operation-log-migration.service'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { OpType } from '../operation.types'; +import { OperationLogMigrationService } from '../../store/operation-log-migration.service'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { PfapiService } from '../../../pfapi/pfapi.service'; +import { OpType } from '../../core/operation.types'; import { resetTestUuidCounter } from './helpers/test-client.helper'; /** diff --git a/src/app/core/persistence/operation-log/integration/lww-conflict-resolution.integration.spec.ts b/src/app/op-log/testing/integration/lww-conflict-resolution.integration.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/integration/lww-conflict-resolution.integration.spec.ts rename to src/app/op-log/testing/integration/lww-conflict-resolution.integration.spec.ts index c28c70b82..14fcaa56d 100644 --- a/src/app/core/persistence/operation-log/integration/lww-conflict-resolution.integration.spec.ts +++ b/src/app/op-log/testing/integration/lww-conflict-resolution.integration.spec.ts @@ -1,12 +1,12 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OpType } from '../../core/operation.types'; import { compareVectorClocks, VectorClockComparison, mergeVectorClocks, incrementVectorClock, -} from '../../../../pfapi/api/util/vector-clock'; +} from '../../../pfapi/api/util/vector-clock'; import { TestClient, resetTestUuidCounter } from './helpers/test-client.helper'; import { createTaskOperation } from './helpers/operation-factory.helper'; diff --git a/src/app/core/persistence/operation-log/integration/lww-update-store-application.integration.spec.ts b/src/app/op-log/testing/integration/lww-update-store-application.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/lww-update-store-application.integration.spec.ts rename to src/app/op-log/testing/integration/lww-update-store-application.integration.spec.ts index 2d7a8cf85..a3acf7c5c 100644 --- a/src/app/core/persistence/operation-log/integration/lww-update-store-application.integration.spec.ts +++ b/src/app/op-log/testing/integration/lww-update-store-application.integration.spec.ts @@ -14,9 +14,9 @@ * 5. Client B's UI reflects the change WITHOUT needing a reload */ import { ActionReducer, Action } from '@ngrx/store'; -import { lwwUpdateMetaReducer } from '../../../../root-store/meta/task-shared-meta-reducers/lww-update.meta-reducer'; -import { convertOpToAction } from '../operation-converter.util'; -import { Operation, OpType, EntityType } from '../operation.types'; +import { lwwUpdateMetaReducer } from '../../../root-store/meta/task-shared-meta-reducers/lww-update.meta-reducer'; +import { convertOpToAction } from '../../apply/operation-converter.util'; +import { Operation, OpType, EntityType } from '../../core/operation.types'; describe('LWW Update Store Application Integration', () => { // Feature names matching actual NgRx feature names diff --git a/src/app/core/persistence/operation-log/processing/meta-reducer-ordering.integration.spec.ts b/src/app/op-log/testing/integration/meta-reducer-ordering.integration.spec.ts similarity index 97% rename from src/app/core/persistence/operation-log/processing/meta-reducer-ordering.integration.spec.ts rename to src/app/op-log/testing/integration/meta-reducer-ordering.integration.spec.ts index 49c805c96..ddb3fce58 100644 --- a/src/app/core/persistence/operation-log/processing/meta-reducer-ordering.integration.spec.ts +++ b/src/app/op-log/testing/integration/meta-reducer-ordering.integration.spec.ts @@ -14,10 +14,10 @@ import { operationCaptureMetaReducer, setOperationCaptureService, setIsApplyingRemoteOps, -} from './operation-capture.meta-reducer'; -import { OperationCaptureService } from './operation-capture.service'; -import { EntityType, OpType } from '../operation.types'; -import { PersistentAction } from '../persistent-action.interface'; +} from '../../capture/operation-capture.meta-reducer'; +import { OperationCaptureService } from '../../capture/operation-capture.service'; +import { EntityType, OpType } from '../../core/operation.types'; +import { PersistentAction } from '../../core/persistent-action.interface'; describe('Meta-reducer ordering integration', () => { let captureService: OperationCaptureService; diff --git a/src/app/core/persistence/operation-log/integration/migration-handling.integration.spec.ts b/src/app/op-log/testing/integration/migration-handling.integration.spec.ts similarity index 86% rename from src/app/core/persistence/operation-log/integration/migration-handling.integration.spec.ts rename to src/app/op-log/testing/integration/migration-handling.integration.spec.ts index 698e42806..efa4ccd89 100644 --- a/src/app/core/persistence/operation-log/integration/migration-handling.integration.spec.ts +++ b/src/app/op-log/testing/integration/migration-handling.integration.spec.ts @@ -1,25 +1,25 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogSyncService } from '../sync/operation-log-sync.service'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; +import { OperationLogSyncService } from '../../sync/operation-log-sync.service'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; import { SchemaMigrationService, MAX_VERSION_SKIP, -} from '../store/schema-migration.service'; -import { SnackService } from '../../../snack/snack.service'; -import { VectorClockService } from '../sync/vector-clock.service'; -import { OperationApplierService } from '../processing/operation-applier.service'; -import { ConflictResolutionService } from '../sync/conflict-resolution.service'; -import { ValidateStateService } from '../processing/validate-state.service'; -import { RepairOperationService } from '../processing/repair-operation.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; -import { OperationLogUploadService } from '../sync/operation-log-upload.service'; -import { OperationLogDownloadService } from '../sync/operation-log-download.service'; +} from '../../store/schema-migration.service'; +import { SnackService } from '../../../core/snack/snack.service'; +import { VectorClockService } from '../../sync/vector-clock.service'; +import { OperationApplierService } from '../../apply/operation-applier.service'; +import { ConflictResolutionService } from '../../sync/conflict-resolution.service'; +import { ValidateStateService } from '../../validation/validate-state.service'; +import { RepairOperationService } from '../../validation/repair-operation.service'; +import { PfapiStoreDelegateService } from '../../../pfapi/pfapi-store-delegate.service'; +import { PfapiService } from '../../../pfapi/pfapi.service'; +import { OperationLogUploadService } from '../../sync/operation-log-upload.service'; +import { OperationLogDownloadService } from '../../sync/operation-log-download.service'; import { provideMockStore } from '@ngrx/store/testing'; -import { Operation, OpType } from '../operation.types'; -import { T } from '../../../../t.const'; +import { Operation, OpType } from '../../core/operation.types'; +import { T } from '../../../t.const'; import { MatDialog } from '@angular/material/dialog'; -import { UserInputWaitStateService } from '../../../../imex/sync/user-input-wait-state.service'; +import { UserInputWaitStateService } from '../../../imex/sync/user-input-wait-state.service'; import { resetTestUuidCounter } from './helpers/test-client.helper'; import { TranslateService } from '@ngx-translate/core'; diff --git a/src/app/core/persistence/operation-log/integration/multi-client-sync.integration.spec.ts b/src/app/op-log/testing/integration/multi-client-sync.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/multi-client-sync.integration.spec.ts rename to src/app/op-log/testing/integration/multi-client-sync.integration.spec.ts index 8e34b415c..71fb379f3 100644 --- a/src/app/core/persistence/operation-log/integration/multi-client-sync.integration.spec.ts +++ b/src/app/op-log/testing/integration/multi-client-sync.integration.spec.ts @@ -1,11 +1,11 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { VectorClockService } from '../sync/vector-clock.service'; -import { OpType } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { VectorClockService } from '../../sync/vector-clock.service'; +import { OpType } from '../../core/operation.types'; import { compareVectorClocks, VectorClockComparison, -} from '../../../../pfapi/api/util/vector-clock'; +} from '../../../pfapi/api/util/vector-clock'; import { TestClient, resetTestUuidCounter } from './helpers/test-client.helper'; import { createTaskOperation, diff --git a/src/app/core/persistence/operation-log/integration/multi-entity-atomicity.integration.spec.ts b/src/app/op-log/testing/integration/multi-entity-atomicity.integration.spec.ts similarity index 97% rename from src/app/core/persistence/operation-log/integration/multi-entity-atomicity.integration.spec.ts rename to src/app/op-log/testing/integration/multi-entity-atomicity.integration.spec.ts index af8b08bce..910c07e47 100644 --- a/src/app/core/persistence/operation-log/integration/multi-entity-atomicity.integration.spec.ts +++ b/src/app/op-log/testing/integration/multi-entity-atomicity.integration.spec.ts @@ -1,7 +1,10 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { OperationCaptureService } from '../processing/operation-capture.service'; -import { PersistentAction, PersistentActionMeta } from '../persistent-action.interface'; -import { EntityType, OpType, EntityChange } from '../operation.types'; +import { OperationCaptureService } from '../../capture/operation-capture.service'; +import { + PersistentAction, + PersistentActionMeta, +} from '../../core/persistent-action.interface'; +import { EntityType, OpType, EntityChange } from '../../core/operation.types'; /** * Operation Capture Integration Tests diff --git a/src/app/core/persistence/operation-log/integration/network-failure.integration.spec.ts b/src/app/op-log/testing/integration/network-failure.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/network-failure.integration.spec.ts rename to src/app/op-log/testing/integration/network-failure.integration.spec.ts index 2bd923ac3..c70f93c12 100644 --- a/src/app/core/persistence/operation-log/integration/network-failure.integration.spec.ts +++ b/src/app/op-log/testing/integration/network-failure.integration.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OpType } from '../../core/operation.types'; import { resetTestUuidCounter } from './helpers/test-client.helper'; import { MockSyncServer } from './helpers/mock-sync-server.helper'; import { SimulatedClient } from './helpers/simulated-client.helper'; @@ -8,7 +8,7 @@ import { SyncOperation, OpUploadResponse, OpDownloadResponse, -} from '../../../../pfapi/api/sync/sync-provider.interface'; +} from '../../../pfapi/api/sync/sync-provider.interface'; import { createMinimalTaskPayload } from './helpers/operation-factory.helper'; /** diff --git a/src/app/core/persistence/operation-log/integration/performance.integration.spec.ts b/src/app/op-log/testing/integration/performance.integration.spec.ts similarity index 97% rename from src/app/core/persistence/operation-log/integration/performance.integration.spec.ts rename to src/app/op-log/testing/integration/performance.integration.spec.ts index 1ff79a1b1..031864d69 100644 --- a/src/app/core/persistence/operation-log/integration/performance.integration.spec.ts +++ b/src/app/op-log/testing/integration/performance.integration.spec.ts @@ -1,16 +1,16 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OperationLogCompactionService } from '../store/operation-log-compaction.service'; -import { VectorClockService } from '../sync/vector-clock.service'; -import { OpType } from '../operation.types'; -import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OperationLogCompactionService } from '../../store/operation-log-compaction.service'; +import { VectorClockService } from '../../sync/vector-clock.service'; +import { OpType } from '../../core/operation.types'; +import { CURRENT_SCHEMA_VERSION } from '../../store/schema-migration.service'; import { TestClient, resetTestUuidCounter } from './helpers/test-client.helper'; import { createTaskOperation, createMinimalTaskPayload, createMinimalProjectPayload, } from './helpers/operation-factory.helper'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; +import { PfapiStoreDelegateService } from '../../../pfapi/pfapi-store-delegate.service'; /** * Performance integration tests for operation log. diff --git a/src/app/core/persistence/operation-log/integration/provider-switch.integration.spec.ts b/src/app/op-log/testing/integration/provider-switch.integration.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/integration/provider-switch.integration.spec.ts rename to src/app/op-log/testing/integration/provider-switch.integration.spec.ts index e692e8e9c..8868ac7d6 100644 --- a/src/app/core/persistence/operation-log/integration/provider-switch.integration.spec.ts +++ b/src/app/op-log/testing/integration/provider-switch.integration.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OpType } from '../../core/operation.types'; import { resetTestUuidCounter } from './helpers/test-client.helper'; import { MockSyncServer } from './helpers/mock-sync-server.helper'; import { SimulatedClient } from './helpers/simulated-client.helper'; diff --git a/src/app/core/persistence/operation-log/integration/repair-sync.integration.spec.ts b/src/app/op-log/testing/integration/repair-sync.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/repair-sync.integration.spec.ts rename to src/app/op-log/testing/integration/repair-sync.integration.spec.ts index 5daf5c403..3984a0e90 100644 --- a/src/app/core/persistence/operation-log/integration/repair-sync.integration.spec.ts +++ b/src/app/op-log/testing/integration/repair-sync.integration.spec.ts @@ -1,7 +1,12 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType, Operation, RepairPayload, RepairSummary } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { + OpType, + Operation, + RepairPayload, + RepairSummary, +} from '../../core/operation.types'; import { resetTestUuidCounter, TestClient } from './helpers/test-client.helper'; import { MockSyncServer } from './helpers/mock-sync-server.helper'; import { SimulatedClient } from './helpers/simulated-client.helper'; diff --git a/src/app/core/persistence/operation-log/integration/repeat-task-sync.integration.spec.ts b/src/app/op-log/testing/integration/repeat-task-sync.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/repeat-task-sync.integration.spec.ts rename to src/app/op-log/testing/integration/repeat-task-sync.integration.spec.ts index bc7c02105..c42bf14ec 100644 --- a/src/app/core/persistence/operation-log/integration/repeat-task-sync.integration.spec.ts +++ b/src/app/op-log/testing/integration/repeat-task-sync.integration.spec.ts @@ -1,11 +1,11 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { VectorClockService } from '../sync/vector-clock.service'; -import { OpType } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { VectorClockService } from '../../sync/vector-clock.service'; +import { OpType } from '../../core/operation.types'; import { compareVectorClocks, VectorClockComparison, -} from '../../../../pfapi/api/util/vector-clock'; +} from '../../../pfapi/api/util/vector-clock'; import { TestClient, resetTestUuidCounter } from './helpers/test-client.helper'; import { createTaskOperation, diff --git a/src/app/core/persistence/operation-log/integration/server-migration.integration.spec.ts b/src/app/op-log/testing/integration/server-migration.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/server-migration.integration.spec.ts rename to src/app/op-log/testing/integration/server-migration.integration.spec.ts index 84d5ce175..926e978a2 100644 --- a/src/app/core/persistence/operation-log/integration/server-migration.integration.spec.ts +++ b/src/app/op-log/testing/integration/server-migration.integration.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OpType } from '../../core/operation.types'; import { resetTestUuidCounter } from './helpers/test-client.helper'; import { MockSyncServer } from './helpers/mock-sync-server.helper'; import { SimulatedClient } from './helpers/simulated-client.helper'; diff --git a/src/app/core/persistence/operation-log/integration/service-logic.integration.spec.ts b/src/app/op-log/testing/integration/service-logic.integration.spec.ts similarity index 92% rename from src/app/core/persistence/operation-log/integration/service-logic.integration.spec.ts rename to src/app/op-log/testing/integration/service-logic.integration.spec.ts index 27a5f4c47..ac57a13d2 100644 --- a/src/app/core/persistence/operation-log/integration/service-logic.integration.spec.ts +++ b/src/app/op-log/testing/integration/service-logic.integration.spec.ts @@ -1,41 +1,46 @@ import { TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; -import { OperationLogSyncService } from '../sync/operation-log-sync.service'; -import { OperationLogUploadService } from '../sync/operation-log-upload.service'; -import { OperationLogDownloadService } from '../sync/operation-log-download.service'; -import { OperationEncryptionService } from '../sync/operation-encryption.service'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { VectorClockService } from '../sync/vector-clock.service'; -import { OperationApplierService } from '../processing/operation-applier.service'; -import { ConflictResolutionService } from '../sync/conflict-resolution.service'; -import { ValidateStateService } from '../processing/validate-state.service'; -import { RepairOperationService } from '../processing/repair-operation.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; -import { PfapiService } from '../../../../pfapi/pfapi.service'; +import { OperationLogSyncService } from '../../sync/operation-log-sync.service'; +import { OperationLogUploadService } from '../../sync/operation-log-upload.service'; +import { OperationLogDownloadService } from '../../sync/operation-log-download.service'; +import { OperationEncryptionService } from '../../sync/operation-encryption.service'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { VectorClockService } from '../../sync/vector-clock.service'; +import { OperationApplierService } from '../../apply/operation-applier.service'; +import { ConflictResolutionService } from '../../sync/conflict-resolution.service'; +import { ValidateStateService } from '../../validation/validate-state.service'; +import { RepairOperationService } from '../../validation/repair-operation.service'; +import { PfapiStoreDelegateService } from '../../../pfapi/pfapi-store-delegate.service'; +import { PfapiService } from '../../../pfapi/pfapi.service'; import { SyncProviderServiceInterface, OperationSyncCapable, OpUploadResponse, OpDownloadResponse, SyncOperation, -} from '../../../../pfapi/api/sync/sync-provider.interface'; -import { SyncProviderId } from '../../../../pfapi/api/pfapi.const'; -import { SuperSyncPrivateCfg } from '../../../../pfapi/api/sync/providers/super-sync/super-sync.model'; +} from '../../../pfapi/api/sync/sync-provider.interface'; +import { SyncProviderId } from '../../../pfapi/api/pfapi.const'; +import { SuperSyncPrivateCfg } from '../../../pfapi/api/sync/providers/super-sync/super-sync.model'; import { provideMockStore } from '@ngrx/store/testing'; -import { EntityConflict, OpType, Operation, VectorClock } from '../operation.types'; +import { + EntityConflict, + OpType, + Operation, + VectorClock, +} from '../../core/operation.types'; import { compareVectorClocks, mergeVectorClocks, VectorClockComparison, -} from '../../../../pfapi/api/util/vector-clock'; -import { toEntityKey } from '../entity-key.util'; +} from '../../../pfapi/api/util/vector-clock'; +import { toEntityKey } from '../../util/entity-key.util'; import { MatDialog } from '@angular/material/dialog'; -import { UserInputWaitStateService } from '../../../../imex/sync/user-input-wait-state.service'; -import { SnackService } from '../../../snack/snack.service'; +import { UserInputWaitStateService } from '../../../imex/sync/user-input-wait-state.service'; +import { SnackService } from '../../../core/snack/snack.service'; import { resetTestUuidCounter } from './helpers/test-client.helper'; -import { LockService } from '../sync/lock.service'; -import { SchemaMigrationService } from '../store/schema-migration.service'; -import { decrypt, encrypt } from '../../../../pfapi/api/encryption/encryption'; +import { LockService } from '../../sync/lock.service'; +import { SchemaMigrationService } from '../../store/schema-migration.service'; +import { decrypt, encrypt } from '../../../pfapi/api/encryption/encryption'; import { TranslateService } from '@ngx-translate/core'; // Mock Sync Provider that supports operation sync diff --git a/src/app/core/persistence/operation-log/integration/state-consistency.integration.spec.ts b/src/app/op-log/testing/integration/state-consistency.integration.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/integration/state-consistency.integration.spec.ts rename to src/app/op-log/testing/integration/state-consistency.integration.spec.ts index 402323bda..799853ad2 100644 --- a/src/app/core/persistence/operation-log/integration/state-consistency.integration.spec.ts +++ b/src/app/op-log/testing/integration/state-consistency.integration.spec.ts @@ -1,8 +1,8 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { VectorClockService } from '../sync/vector-clock.service'; -import { OpType, VectorClock } from '../operation.types'; -import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { VectorClockService } from '../../sync/vector-clock.service'; +import { OpType, VectorClock } from '../../core/operation.types'; +import { CURRENT_SCHEMA_VERSION } from '../../store/schema-migration.service'; import { TestClient, resetTestUuidCounter } from './helpers/test-client.helper'; import { createTaskOperation, diff --git a/src/app/core/persistence/operation-log/integration/sync-scenarios.integration.spec.ts b/src/app/op-log/testing/integration/sync-scenarios.integration.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/integration/sync-scenarios.integration.spec.ts rename to src/app/op-log/testing/integration/sync-scenarios.integration.spec.ts index 23139f0b8..b68e74b5c 100644 --- a/src/app/core/persistence/operation-log/integration/sync-scenarios.integration.spec.ts +++ b/src/app/op-log/testing/integration/sync-scenarios.integration.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { OpType } from '../operation.types'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { OpType } from '../../core/operation.types'; import { resetTestUuidCounter } from './helpers/test-client.helper'; import { MockSyncServer } from './helpers/mock-sync-server.helper'; import { SimulatedClient } from './helpers/simulated-client.helper'; diff --git a/src/app/core/persistence/operation-log/integration/vector-clock-sync.integration.spec.ts b/src/app/op-log/testing/integration/vector-clock-sync.integration.spec.ts similarity index 97% rename from src/app/core/persistence/operation-log/integration/vector-clock-sync.integration.spec.ts rename to src/app/op-log/testing/integration/vector-clock-sync.integration.spec.ts index 646376dad..290dabfef 100644 --- a/src/app/core/persistence/operation-log/integration/vector-clock-sync.integration.spec.ts +++ b/src/app/op-log/testing/integration/vector-clock-sync.integration.spec.ts @@ -1,8 +1,8 @@ import { TestBed } from '@angular/core/testing'; -import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { VectorClockService } from '../sync/vector-clock.service'; -import { Operation, OpType, EntityType, VectorClock } from '../operation.types'; -import { uuidv7 } from '../../../../util/uuid-v7'; +import { OperationLogStoreService } from '../../store/operation-log-store.service'; +import { VectorClockService } from '../../sync/vector-clock.service'; +import { Operation, OpType, EntityType, VectorClock } from '../../core/operation.types'; +import { uuidv7 } from '../../../util/uuid-v7'; import { resetTestUuidCounter } from './helpers/test-client.helper'; /** diff --git a/src/app/core/persistence/operation-log/client-id.provider.ts b/src/app/op-log/util/client-id.provider.ts similarity index 96% rename from src/app/core/persistence/operation-log/client-id.provider.ts rename to src/app/op-log/util/client-id.provider.ts index e576896b6..1f24e399b 100644 --- a/src/app/core/persistence/operation-log/client-id.provider.ts +++ b/src/app/op-log/util/client-id.provider.ts @@ -1,5 +1,5 @@ import { inject, InjectionToken, Injector } from '@angular/core'; -import { PfapiService } from '../../../pfapi/pfapi.service'; +import { PfapiService } from '../../pfapi/pfapi.service'; /** * Interface for providing the sync client ID. diff --git a/src/app/core/persistence/operation-log/entity-key.util.spec.ts b/src/app/op-log/util/entity-key.util.spec.ts similarity index 98% rename from src/app/core/persistence/operation-log/entity-key.util.spec.ts rename to src/app/op-log/util/entity-key.util.spec.ts index b5a75eb88..f2ffc275a 100644 --- a/src/app/core/persistence/operation-log/entity-key.util.spec.ts +++ b/src/app/op-log/util/entity-key.util.spec.ts @@ -1,5 +1,5 @@ import { toEntityKey, parseEntityKey } from './entity-key.util'; -import { EntityType } from './operation.types'; +import { EntityType } from '../core/operation.types'; describe('entity-key utility', () => { describe('toEntityKey', () => { diff --git a/src/app/core/persistence/operation-log/entity-key.util.ts b/src/app/op-log/util/entity-key.util.ts similarity index 94% rename from src/app/core/persistence/operation-log/entity-key.util.ts rename to src/app/op-log/util/entity-key.util.ts index 2a83527e0..c039b8c8b 100644 --- a/src/app/core/persistence/operation-log/entity-key.util.ts +++ b/src/app/op-log/util/entity-key.util.ts @@ -1,4 +1,4 @@ -import { EntityType } from './operation.types'; +import { EntityType } from '../core/operation.types'; /** * Creates a unique key for an entity by combining its type and ID. diff --git a/src/app/core/persistence/operation-log/processing/repair-operation.service.spec.ts b/src/app/op-log/validation/repair-operation.service.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/processing/repair-operation.service.spec.ts rename to src/app/op-log/validation/repair-operation.service.spec.ts index 100af948b..598623fef 100644 --- a/src/app/core/persistence/operation-log/processing/repair-operation.service.spec.ts +++ b/src/app/op-log/validation/repair-operation.service.spec.ts @@ -3,7 +3,7 @@ import { RepairOperationService } from './repair-operation.service'; import { OperationLogStoreService } from '../store/operation-log-store.service'; import { LockService } from '../sync/lock.service'; import { VectorClockService } from '../sync/vector-clock.service'; -import { RepairSummary, OpType } from '../operation.types'; +import { RepairSummary, OpType } from '../core/operation.types'; import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; import { TranslateService } from '@ngx-translate/core'; diff --git a/src/app/core/persistence/operation-log/processing/repair-operation.service.ts b/src/app/op-log/validation/repair-operation.service.ts similarity index 93% rename from src/app/core/persistence/operation-log/processing/repair-operation.service.ts rename to src/app/op-log/validation/repair-operation.service.ts index b0a8d0921..fa5598f5b 100644 --- a/src/app/core/persistence/operation-log/processing/repair-operation.service.ts +++ b/src/app/op-log/validation/repair-operation.service.ts @@ -1,16 +1,16 @@ import { Injectable, inject } from '@angular/core'; import { OperationLogStoreService } from '../store/operation-log-store.service'; -import { Operation, OpType, RepairPayload, RepairSummary } from '../operation.types'; -import { uuidv7 } from '../../../../util/uuid-v7'; -import { incrementVectorClock } from '../../../../pfapi/api/util/vector-clock'; +import { Operation, OpType, RepairPayload, RepairSummary } from '../core/operation.types'; +import { uuidv7 } from '../../util/uuid-v7'; +import { incrementVectorClock } from '../../pfapi/api/util/vector-clock'; import { LockService } from '../sync/lock.service'; -import { T } from '../../../../t.const'; -import { OpLog } from '../../../log'; +import { T } from '../../t.const'; +import { OpLog } from '../../core/log'; import { VectorClockService } from '../sync/vector-clock.service'; import { CURRENT_SCHEMA_VERSION } from '../store/schema-migration.service'; -import { devError } from '../../../../util/dev-error'; +import { devError } from '../../util/dev-error'; import { TranslateService } from '@ngx-translate/core'; -import { LOCK_NAMES } from '../operation-log.const'; +import { LOCK_NAMES } from '../core/operation-log.const'; /** * Service responsible for creating REPAIR operations. diff --git a/src/app/core/persistence/operation-log/processing/validate-operation-payload.spec.ts b/src/app/op-log/validation/validate-operation-payload.spec.ts similarity index 99% rename from src/app/core/persistence/operation-log/processing/validate-operation-payload.spec.ts rename to src/app/op-log/validation/validate-operation-payload.spec.ts index 5cbdf937a..348f892df 100644 --- a/src/app/core/persistence/operation-log/processing/validate-operation-payload.spec.ts +++ b/src/app/op-log/validation/validate-operation-payload.spec.ts @@ -1,5 +1,5 @@ import { validateOperationPayload } from './validate-operation-payload'; -import { Operation, OpType, EntityType } from '../operation.types'; +import { Operation, OpType, EntityType } from '../core/operation.types'; describe('validateOperationPayload', () => { const createTestOperation = (overrides: Partial = {}): Operation => ({ diff --git a/src/app/core/persistence/operation-log/processing/validate-operation-payload.ts b/src/app/op-log/validation/validate-operation-payload.ts similarity index 99% rename from src/app/core/persistence/operation-log/processing/validate-operation-payload.ts rename to src/app/op-log/validation/validate-operation-payload.ts index 8f06c8ccf..9ebaf2273 100644 --- a/src/app/core/persistence/operation-log/processing/validate-operation-payload.ts +++ b/src/app/op-log/validation/validate-operation-payload.ts @@ -4,9 +4,9 @@ import { OpType, isMultiEntityPayload, EntityChange, -} from '../operation.types'; -import { OpLog } from '../../../log'; -import { getPayloadKey, getAllPayloadKeys } from '../entity-registry'; +} from '../core/operation.types'; +import { OpLog } from '../../core/log'; +import { getPayloadKey, getAllPayloadKeys } from '../core/entity-registry'; /** * Result of validating an operation payload. diff --git a/src/app/core/persistence/operation-log/processing/validate-state.service.spec.ts b/src/app/op-log/validation/validate-state.service.spec.ts similarity index 91% rename from src/app/core/persistence/operation-log/processing/validate-state.service.spec.ts rename to src/app/op-log/validation/validate-state.service.spec.ts index 89683b833..cd66cb4c6 100644 --- a/src/app/core/persistence/operation-log/processing/validate-state.service.spec.ts +++ b/src/app/op-log/validation/validate-state.service.spec.ts @@ -2,10 +2,10 @@ import { TestBed } from '@angular/core/testing'; import { provideMockStore } from '@ngrx/store/testing'; import { ValidateStateService } from './validate-state.service'; import { RepairOperationService } from './repair-operation.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; -import { AppDataCompleteNew, PFAPI_MODEL_CFGS } from '../../../../pfapi/pfapi-config'; -import { MenuTreeKind } from '../../../../features/menu-tree/store/menu-tree.model'; -import { environment } from '../../../../../environments/environment'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; +import { AppDataCompleteNew, PFAPI_MODEL_CFGS } from '../../pfapi/pfapi-config'; +import { MenuTreeKind } from '../../features/menu-tree/store/menu-tree.model'; +import { environment } from '../../../environments/environment'; describe('ValidateStateService', () => { let service: ValidateStateService; diff --git a/src/app/core/persistence/operation-log/processing/validate-state.service.ts b/src/app/op-log/validation/validate-state.service.ts similarity index 94% rename from src/app/core/persistence/operation-log/processing/validate-state.service.ts rename to src/app/op-log/validation/validate-state.service.ts index ba5441d26..f9fc32256 100644 --- a/src/app/core/persistence/operation-log/processing/validate-state.service.ts +++ b/src/app/op-log/validation/validate-state.service.ts @@ -1,18 +1,18 @@ import { inject, Injectable } from '@angular/core'; import { IValidation } from 'typia'; -import { validateFull } from '../../../../pfapi/validate/validation-fn'; +import { validateFull } from '../../pfapi/validate/validation-fn'; // TEMPORARILY DISABLED - repair is disabled for debugging -// import { dataRepair } from '../../../../pfapi/repair/data-repair'; -// import { isDataRepairPossible } from '../../../../pfapi/repair/is-data-repair-possible.util'; -import { AppDataCompleteNew } from '../../../../pfapi/pfapi-config'; -import { RepairSummary } from '../operation.types'; -import { OpLog } from '../../../log'; +// import { dataRepair } from '../../pfapi/repair/data-repair'; +// import { isDataRepairPossible } from '../../pfapi/repair/is-data-repair-possible.util'; +import { AppDataCompleteNew } from '../../pfapi/pfapi-config'; +import { RepairSummary } from '../core/operation.types'; +import { OpLog } from '../../core/log'; // DISABLED: Repair system is non-functional // import { RepairOperationService } from './repair-operation.service'; -import { PfapiStoreDelegateService } from '../../../../pfapi/pfapi-store-delegate.service'; +import { PfapiStoreDelegateService } from '../../pfapi/pfapi-store-delegate.service'; // DISABLED: Repair system is non-functional -// import { PfapiService } from '../../../../pfapi/pfapi.service'; -// import { loadAllData } from '../../../../root-store/meta/load-all-data.action'; +// import { PfapiService } from '../../pfapi/pfapi.service'; +// import { loadAllData } from '../../root-store/meta/load-all-data.action'; /* DISABLED: Repair system helper types and functions - unused while repair is disabled interface EntityState { ids: string[]; entities: Record; } diff --git a/src/app/pfapi/api/pfapi.const.ts b/src/app/pfapi/api/pfapi.const.ts index 503feeaf7..5fed4cce6 100644 --- a/src/app/pfapi/api/pfapi.const.ts +++ b/src/app/pfapi/api/pfapi.const.ts @@ -70,7 +70,7 @@ export enum DBNames { * - `ModelSyncService.updateLocalMainModelsFromRemoteMetaFile()`: Uses this filter * * @see src/app/pfapi/pfapi-store-delegate.service.ts - * @see src/app/core/persistence/operation-log/processing/operation-applier.service.ts - * @see src/app/core/persistence/operation-log/processing/archive-operation-handler.service.ts + * @see src/app/op-log/apply/operation-applier.service.ts + * @see src/app/op-log/apply/archive-operation-handler.service.ts */ export const ALLOWED_DB_WRITE_KEYS_DURING_SYNC = ['archiveYoung', 'archiveOld'] as const; diff --git a/src/app/pfapi/api/pfapi.ts b/src/app/pfapi/api/pfapi.ts index f4fb8491a..83c1b907a 100644 --- a/src/app/pfapi/api/pfapi.ts +++ b/src/app/pfapi/api/pfapi.ts @@ -37,7 +37,7 @@ import { promiseTimeout } from '../../util/promise-timeout'; import { PFEventEmitter } from './util/events'; import { MigrationService } from './migration/migration.service'; import { IValidation } from 'typia'; -import { OperationLogSyncService } from '../../core/persistence/operation-log/sync/operation-log-sync.service'; +import { OperationLogSyncService } from '../../op-log/sync/operation-log-sync.service'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import { inject } from '@angular/core'; // Inject is used here diff --git a/src/app/pfapi/api/sync/sync.service.spec.ts b/src/app/pfapi/api/sync/sync.service.spec.ts index ce496daeb..b99f7845e 100644 --- a/src/app/pfapi/api/sync/sync.service.spec.ts +++ b/src/app/pfapi/api/sync/sync.service.spec.ts @@ -13,7 +13,7 @@ import { RevMismatchForModelError, } from '../errors/errors'; import { EncryptAndCompressHandlerService } from './encrypt-and-compress-handler.service'; -import { OperationLogSyncService } from '../../../core/persistence/operation-log/sync/operation-log-sync.service'; +import { OperationLogSyncService } from '../../../op-log/sync/operation-log-sync.service'; interface FakeModel { id: string; diff --git a/src/app/pfapi/api/sync/sync.service.ts b/src/app/pfapi/api/sync/sync.service.ts index 5ba1ff49b..9c61269ce 100644 --- a/src/app/pfapi/api/sync/sync.service.ts +++ b/src/app/pfapi/api/sync/sync.service.ts @@ -37,7 +37,7 @@ import { sanitizeVectorClock, } from '../util/vector-clock'; import { getVectorClock } from '../util/backwards-compat'; -import { OperationLogSyncService } from '../../../core/persistence/operation-log/sync/operation-log-sync.service'; +import { OperationLogSyncService } from '../../../op-log/sync/operation-log-sync.service'; /** * Sync Service for Super Productivity diff --git a/src/app/pfapi/migrate/cross-model-migrations.ts b/src/app/pfapi/migrate/cross-model-migrations.ts index 41b7cec5c..c23198396 100644 --- a/src/app/pfapi/migrate/cross-model-migrations.ts +++ b/src/app/pfapi/migrate/cross-model-migrations.ts @@ -19,7 +19,7 @@ import { crossModelMigration4_5 } from './cross-model-4_5'; * ⚠️ DO NOT ADD NEW MIGRATIONS HERE ⚠️ * * For all new schema changes, use the Operation Log's `SchemaMigrationService` - * located in `src/app/core/persistence/operation-log/schema-migration.service.ts`. + * located in `src/app/op-log/store/schema-migration.service.ts`. */ export const CROSS_MODEL_MIGRATIONS: CrossModelMigrations = { 2: crossModelMigration2, diff --git a/src/app/pfapi/pfapi.service.spec.ts b/src/app/pfapi/pfapi.service.spec.ts index eeb7e36c4..6e63c02e3 100644 --- a/src/app/pfapi/pfapi.service.spec.ts +++ b/src/app/pfapi/pfapi.service.spec.ts @@ -7,8 +7,8 @@ import { DataInitStateService } from '../core/data-init/data-init-state.service' import { GlobalProgressBarService } from '../core-ui/global-progress-bar/global-progress-bar.service'; import { ImexViewService } from '../imex/imex-meta/imex-view.service'; import { PfapiStoreDelegateService } from './pfapi-store-delegate.service'; -import { OperationLogStoreService } from '../core/persistence/operation-log/store/operation-log-store.service'; -import { VectorClockService } from '../core/persistence/operation-log/sync/vector-clock.service'; +import { OperationLogStoreService } from '../op-log/store/operation-log-store.service'; +import { VectorClockService } from '../op-log/sync/vector-clock.service'; import { loadAllData } from '../root-store/meta/load-all-data.action'; import { AppDataCompleteNew, CROSS_MODEL_VERSION } from './pfapi-config'; import { of, Observable, BehaviorSubject } from 'rxjs'; diff --git a/src/app/pfapi/pfapi.service.ts b/src/app/pfapi/pfapi.service.ts index b8e2ddf2e..67b9a5562 100644 --- a/src/app/pfapi/pfapi.service.ts +++ b/src/app/pfapi/pfapi.service.ts @@ -35,13 +35,13 @@ import { DataInitStateService } from '../core/data-init/data-init-state.service' import { GlobalProgressBarService } from '../core-ui/global-progress-bar/global-progress-bar.service'; import { PFLog } from '../core/log'; import { PfapiStoreDelegateService } from './pfapi-store-delegate.service'; -import { OperationLogStoreService } from '../core/persistence/operation-log/store/operation-log-store.service'; -import { Operation, OpType } from '../core/persistence/operation-log/operation.types'; -import { CURRENT_SCHEMA_VERSION } from '../core/persistence/operation-log/store/schema-migration.service'; +import { OperationLogStoreService } from '../op-log/store/operation-log-store.service'; +import { Operation, OpType } from '../op-log/core/operation.types'; +import { CURRENT_SCHEMA_VERSION } from '../op-log/store/schema-migration.service'; import { incrementVectorClock } from './api/util/vector-clock'; import { uuidv7 } from '../util/uuid-v7'; import { loadAllData } from '../root-store/meta/load-all-data.action'; -import { VectorClockService } from '../core/persistence/operation-log/sync/vector-clock.service'; +import { VectorClockService } from '../op-log/sync/vector-clock.service'; import { SnackService } from '../core/snack/snack.service'; @Injectable({ diff --git a/src/app/plugins/plugin-bridge.service.ts b/src/app/plugins/plugin-bridge.service.ts index 88913851f..1ec2421a3 100644 --- a/src/app/plugins/plugin-bridge.service.ts +++ b/src/app/plugins/plugin-bridge.service.ts @@ -51,7 +51,7 @@ import { Log, PluginLog } from '../core/log'; import { TaskCopy } from '../features/tasks/task.model'; import { ProjectCopy } from '../features/project/project.model'; import { TagCopy } from '../features/tag/tag.model'; -import { MAX_BATCH_OPERATIONS_SIZE } from '../core/persistence/operation-log/operation-log.const'; +import { MAX_BATCH_OPERATIONS_SIZE } from '../op-log/core/operation-log.const'; // New imports for simple counters import { selectAllSimpleCounters } from '../features/simple-counter/store/simple-counter.reducer'; diff --git a/src/app/plugins/store/plugin.actions.ts b/src/app/plugins/store/plugin.actions.ts index cbebcb66d..a043d2e43 100644 --- a/src/app/plugins/store/plugin.actions.ts +++ b/src/app/plugins/store/plugin.actions.ts @@ -1,6 +1,6 @@ import { createAction } from '@ngrx/store'; -import { PersistentActionMeta } from '../../core/persistence/operation-log/persistent-action.interface'; -import { OpType } from '../../core/persistence/operation-log/operation.types'; +import { PersistentActionMeta } from '../../op-log/core/persistent-action.interface'; +import { OpType } from '../../op-log/core/operation.types'; import { PluginUserData, PluginMetadata } from '../plugin-persistence.model'; // Plugin User Data actions diff --git a/src/app/root-store/feature-stores.module.ts b/src/app/root-store/feature-stores.module.ts index 33be4daa0..c8c300e4b 100644 --- a/src/app/root-store/feature-stores.module.ts +++ b/src/app/root-store/feature-stores.module.ts @@ -77,13 +77,13 @@ import { ReminderCountdownEffects } from '../features/reminder/store/reminder-co import { SyncEffects } from '../imex/sync/sync.effects'; import { boardsFeature } from '../features/boards/store/boards.reducer'; import { timeTrackingFeature } from '../features/time-tracking/store/time-tracking.reducer'; -import { ArchiveOperationHandlerEffects } from '../core/persistence/operation-log/processing/archive-operation-handler.effects'; +import { ArchiveOperationHandlerEffects } from '../op-log/apply/archive-operation-handler.effects'; import { plannerFeature } from '../features/planner/store/planner.reducer'; import { PlannerEffects } from '../features/planner/store/planner.effects'; import { AppStateEffects } from './app-state/app-state.effects'; import { appStateFeature } from './app-state/app-state.reducer'; import { PluginHooksEffects } from '../plugins/plugin-hooks.effects'; -import { OperationLogEffects } from '../core/persistence/operation-log/operation-log.effects'; +import { OperationLogEffects } from '../op-log/capture/operation-log.effects'; import { PLUGIN_USER_DATA_FEATURE_NAME, pluginUserDataReducer, diff --git a/src/app/root-store/meta/meta-reducer-registry.ts b/src/app/root-store/meta/meta-reducer-registry.ts index dc0a14c25..a1fabe00f 100644 --- a/src/app/root-store/meta/meta-reducer-registry.ts +++ b/src/app/root-store/meta/meta-reducer-registry.ts @@ -1,6 +1,6 @@ import { MetaReducer } from '@ngrx/store'; -import { operationCaptureMetaReducer } from '../../core/persistence/operation-log/processing/operation-capture.meta-reducer'; -import { bulkOperationsMetaReducer } from '../../core/persistence/operation-log/bulk-hydration.meta-reducer'; +import { operationCaptureMetaReducer } from '../../op-log/capture/operation-capture.meta-reducer'; +import { bulkOperationsMetaReducer } from '../../op-log/apply/bulk-hydration.meta-reducer'; import { undoTaskDeleteMetaReducer } from './undo-task-delete.meta-reducer'; import { taskSharedCrudMetaReducer } from './task-shared-meta-reducers/task-shared-crud.reducer'; import { taskBatchUpdateMetaReducer } from './task-shared-meta-reducers/task-batch-update.reducer'; diff --git a/src/app/root-store/meta/task-shared-meta-reducers/index.ts b/src/app/root-store/meta/task-shared-meta-reducers/index.ts index 794a5f1b1..82f13d28a 100644 --- a/src/app/root-store/meta/task-shared-meta-reducers/index.ts +++ b/src/app/root-store/meta/task-shared-meta-reducers/index.ts @@ -12,4 +12,4 @@ export { lwwUpdateMetaReducer } from './lww-update.meta-reducer'; export { operationCaptureMetaReducer, setOperationCaptureService, -} from '../../../core/persistence/operation-log/processing/operation-capture.meta-reducer'; +} from '../../../op-log/capture/operation-capture.meta-reducer'; diff --git a/src/app/root-store/meta/task-shared-meta-reducers/lww-update.meta-reducer.ts b/src/app/root-store/meta/task-shared-meta-reducers/lww-update.meta-reducer.ts index 43668a66e..95f7e3c56 100644 --- a/src/app/root-store/meta/task-shared-meta-reducers/lww-update.meta-reducer.ts +++ b/src/app/root-store/meta/task-shared-meta-reducers/lww-update.meta-reducer.ts @@ -1,11 +1,8 @@ import { Action, ActionReducer, MetaReducer } from '@ngrx/store'; import { EntityAdapter } from '@ngrx/entity'; import { RootState } from '../../root-state'; -import { EntityType } from '../../../core/persistence/operation-log/operation.types'; -import { - getEntityConfig, - isAdapterEntity, -} from '../../../core/persistence/operation-log/entity-registry'; +import { EntityType } from '../../../op-log/core/operation.types'; +import { getEntityConfig, isAdapterEntity } from '../../../op-log/core/entity-registry'; import { PROJECT_FEATURE_NAME, projectAdapter, diff --git a/src/app/root-store/meta/task-shared.actions.ts b/src/app/root-store/meta/task-shared.actions.ts index 9df1615ae..6b8069305 100644 --- a/src/app/root-store/meta/task-shared.actions.ts +++ b/src/app/root-store/meta/task-shared.actions.ts @@ -4,8 +4,8 @@ import { Task, TaskWithSubTasks } from '../../features/tasks/task.model'; import { IssueDataReduced } from '../../features/issue/issue.model'; import { WorkContextType } from '../../features/work-context/work-context.model'; import { BatchOperation } from '@super-productivity/plugin-api'; -import { PersistentActionMeta } from '../../core/persistence/operation-log/persistent-action.interface'; -import { OpType } from '../../core/persistence/operation-log/operation.types'; +import { PersistentActionMeta } from '../../op-log/core/persistent-action.interface'; +import { OpType } from '../../op-log/core/operation.types'; /** * Shared actions that affect multiple reducers (tasks, projects, tags) diff --git a/src/app/util/skip-during-sync-window.operator.ts b/src/app/util/skip-during-sync-window.operator.ts index 6993aa2e3..3ae421a66 100644 --- a/src/app/util/skip-during-sync-window.operator.ts +++ b/src/app/util/skip-during-sync-window.operator.ts @@ -1,7 +1,7 @@ import { inject } from '@angular/core'; import { MonoTypeOperatorFunction } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { HydrationStateService } from '../core/persistence/operation-log/processing/hydration-state.service'; +import { HydrationStateService } from '../op-log/apply/hydration-state.service'; /** * RxJS operator that skips emissions during the full sync window, diff --git a/src/app/util/skip-during-sync.operator.ts b/src/app/util/skip-during-sync.operator.ts index 2f3938e8f..3184fccd7 100644 --- a/src/app/util/skip-during-sync.operator.ts +++ b/src/app/util/skip-during-sync.operator.ts @@ -1,7 +1,7 @@ import { inject } from '@angular/core'; import { MonoTypeOperatorFunction } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { HydrationStateService } from '../core/persistence/operation-log/processing/hydration-state.service'; +import { HydrationStateService } from '../op-log/apply/hydration-state.service'; /** * RxJS operator that skips emissions during remote operation application diff --git a/src/main.ts b/src/main.ts index 376ca8234..12c98dc44 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,8 +39,8 @@ import { APP_ROUTES } from './app/app.routes'; import { StoreModule } from '@ngrx/store'; import { META_REDUCERS } from './app/root-store/meta/meta-reducer-registry'; import { setOperationCaptureService } from './app/root-store/meta/task-shared-meta-reducers'; -import { OperationCaptureService } from './app/core/persistence/operation-log/processing/operation-capture.service'; -import { ImmediateUploadService } from './app/core/persistence/operation-log/sync/immediate-upload.service'; +import { OperationCaptureService } from './app/op-log/capture/operation-capture.service'; +import { ImmediateUploadService } from './app/op-log/sync/immediate-upload.service'; import { EffectsModule } from '@ngrx/effects'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import { ReactiveFormsModule } from '@angular/forms';