Skip to content

CacheMutationBarrier

Defined in: packages/ddd-core/persistence/helpers/cache-barrier.helper.ts:20

Sentinel marker installed in cache during mutations (deletion or invalidation) to record that a cache key changed while a concurrent read may have been in flight.

FromCache treats a barrier as a miss, never as a snapshot. The protection against stale data comes from isCacheNewer, the default isNewer of the Cache write-through: it ranks a barrier above any snapshot, so a write-through that started before the mutation cannot overwrite it.

readonly __cacheBarrier: true

Defined in: packages/ddd-core/persistence/helpers/cache-barrier.helper.ts:21


readonly optional aggregateId?: string

Defined in: packages/ddd-core/persistence/helpers/cache-barrier.helper.ts:41

Diagnostic aggregate identifier if available on the mutated entity.


readonly createdAt: number

Defined in: packages/ddd-core/persistence/helpers/cache-barrier.helper.ts:36

Epoch timestamp when the barrier was installed.


readonly reason: CacheBarrierReason

Defined in: packages/ddd-core/persistence/helpers/cache-barrier.helper.ts:31

Reason for the barrier installation.


readonly token: string

Defined in: packages/ddd-core/persistence/helpers/cache-barrier.helper.ts:26

Unique per barrier (UUIDv7); diagnostic only.


readonly optional version?: number

Defined in: packages/ddd-core/persistence/helpers/cache-barrier.helper.ts:46

Diagnostic version number if available on the mutated entity.