@contember/bindx 0.1.49 → 0.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/core/actions.d.ts +3 -3
  2. package/dist/core/actions.d.ts.map +1 -1
  3. package/dist/errors/index.d.ts +1 -1
  4. package/dist/errors/index.d.ts.map +1 -1
  5. package/dist/errors/types.d.ts +11 -0
  6. package/dist/errors/types.d.ts.map +1 -1
  7. package/dist/handles/FieldHandle.d.ts +3 -3
  8. package/dist/handles/FieldHandle.d.ts.map +1 -1
  9. package/dist/handles/types.d.ts +9 -8
  10. package/dist/handles/types.d.ts.map +1 -1
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/persistence/BatchPersister.d.ts +6 -0
  14. package/dist/persistence/BatchPersister.d.ts.map +1 -1
  15. package/dist/store/ErrorStore.d.ts +3 -3
  16. package/dist/store/ErrorStore.d.ts.map +1 -1
  17. package/dist/store/HasManyStore.d.ts +10 -0
  18. package/dist/store/HasManyStore.d.ts.map +1 -1
  19. package/dist/store/HasOneStore.d.ts +10 -0
  20. package/dist/store/HasOneStore.d.ts.map +1 -1
  21. package/dist/store/PlannedDeleteIndex.d.ts +19 -0
  22. package/dist/store/PlannedDeleteIndex.d.ts.map +1 -0
  23. package/dist/store/RelationOwnerIndex.d.ts +8 -0
  24. package/dist/store/RelationOwnerIndex.d.ts.map +1 -0
  25. package/dist/store/RelationStore.d.ts +7 -0
  26. package/dist/store/RelationStore.d.ts.map +1 -1
  27. package/dist/store/SnapshotStore.d.ts +8 -2
  28. package/dist/store/SnapshotStore.d.ts.map +1 -1
  29. package/package.json +2 -2
  30. package/src/core/ActionDispatcher.ts +1 -1
  31. package/src/core/actions.ts +4 -4
  32. package/src/errors/index.ts +2 -0
  33. package/src/errors/types.ts +17 -0
  34. package/src/handles/FieldHandle.ts +4 -4
  35. package/src/handles/types.ts +18 -15
  36. package/src/index.ts +2 -0
  37. package/src/persistence/BatchPersister.ts +48 -0
  38. package/src/store/ErrorStore.ts +15 -12
  39. package/src/store/HasManyStore.ts +39 -3
  40. package/src/store/HasOneStore.ts +41 -3
  41. package/src/store/PlannedDeleteIndex.ts +33 -0
  42. package/src/store/RelationOwnerIndex.ts +31 -0
  43. package/src/store/RelationStore.ts +10 -0
  44. package/src/store/SnapshotStore.ts +12 -3
@@ -1 +1 @@
1
- {"version":3,"file":"SnapshotStore.d.ts","sourceRoot":"","sources":["../../src/store/SnapshotStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAE1F,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,EACjC,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAQvE,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EACX,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,MAAM,wBAAwB,CAAA;AAE/B,YAAY,EACX,kBAAkB,EAClB,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,eAAe,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AAE;IAIjE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI;IAQ9E,KAAK,IAAI,IAAI;CAgBb"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contember/bindx",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "description": "Type-safe data binding framework (core)",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "@contember/bindx-client": "0.1.49",
20
+ "@contember/bindx-client": "0.1.50",
21
21
  "@contember/graphql-client": "^2.1.0-beta.1"
22
22
  },
23
23
  "repository": {
@@ -407,7 +407,7 @@ export class ActionDispatcher {
407
407
  action.entityType,
408
408
  action.entityId,
409
409
  action.fieldName,
410
- action.source,
410
+ action.filter,
411
411
  )
412
412
  break
413
413
 
@@ -1,5 +1,5 @@
1
1
  import type { HasOneRelationState } from '../handles/types.js'
2
- import type { FieldError } from '../errors/types.js'
2
+ import type { FieldError, FieldErrorFilter } from '../errors/types.js'
3
3
 
4
4
  /**
5
5
  * Action types for the ActionDispatcher.
@@ -231,7 +231,7 @@ export interface ClearFieldErrorsAction {
231
231
  readonly entityType: string
232
232
  readonly entityId: string
233
233
  readonly fieldName: string
234
- readonly source?: 'client' | 'server'
234
+ readonly filter?: FieldErrorFilter
235
235
  }
236
236
 
237
237
  /**
@@ -471,9 +471,9 @@ export function clearFieldErrors(
471
471
  entityType: string,
472
472
  entityId: string,
473
473
  fieldName: string,
474
- source?: 'client' | 'server',
474
+ filter?: FieldErrorFilter,
475
475
  ): ClearFieldErrorsAction {
476
- return { type: 'CLEAR_FIELD_ERRORS', entityType, entityId, fieldName, source }
476
+ return { type: 'CLEAR_FIELD_ERRORS', entityType, entityId, fieldName, filter }
477
477
  }
478
478
 
479
479
  /**
@@ -8,6 +8,8 @@ export {
8
8
  type FieldError,
9
9
  type ErrorState,
10
10
  type ErrorInput,
11
+ type FieldErrorFilter,
12
+ matchesErrorFilter,
11
13
  ExecutionErrorTypes,
12
14
  isExecutionErrorType,
13
15
  classifyError,
@@ -125,6 +125,23 @@ export interface LoadError extends BindxError {
125
125
  */
126
126
  export type FieldError = ClientError | ServerError | LoadError
127
127
 
128
+ /**
129
+ * Selects which errors a clear operation removes. An omitted key matches any error.
130
+ */
131
+ export interface FieldErrorFilter {
132
+ readonly source?: FieldError['source']
133
+ readonly code?: string
134
+ }
135
+
136
+ /**
137
+ * Checks whether an error matches every key present in the filter.
138
+ */
139
+ export function matchesErrorFilter(error: FieldError, filter: FieldErrorFilter): boolean {
140
+ if (filter.source !== undefined && error.source !== filter.source) return false
141
+ if (filter.code !== undefined && error.code !== filter.code) return false
142
+ return true
143
+ }
144
+
128
145
  /**
129
146
  * Error state stored in the SnapshotStore.
130
147
  */
@@ -4,7 +4,7 @@ import type { SnapshotStore } from '../store/SnapshotStore.js'
4
4
  import { addFieldError, clearFieldErrors, setField } from '../core/actions.js'
5
5
  import { FIELD_REF_META, type FieldAccessor, type FieldRefMeta, type InputProps, type Unsubscribe } from './types.js'
6
6
  import { deepEqual } from '../utils/deepEqual.js'
7
- import { createClientError, type ErrorInput, type FieldError } from '../errors/types.js'
7
+ import { createClientError, type ErrorInput, type FieldError, type FieldErrorFilter } from '../errors/types.js'
8
8
  import type {
9
9
  FieldChangedEvent,
10
10
  FieldChangingEvent,
@@ -186,11 +186,11 @@ export class FieldHandle<T = unknown> extends EntityRelatedHandle {
186
186
  }
187
187
 
188
188
  /**
189
- * Clears all errors from this field.
189
+ * Clears errors from this field, or only those matching the filter.
190
190
  */
191
- clearErrors(): void {
191
+ clearErrors(filter?: FieldErrorFilter): void {
192
192
  this.dispatcher.dispatch(
193
- clearFieldErrors(this.entityType, this.entityId, this.fieldName),
193
+ clearFieldErrors(this.entityType, this.entityId, this.fieldName, filter),
194
194
  )
195
195
  }
196
196
 
@@ -9,6 +9,7 @@
9
9
  * - EntityRef / EntityAccessor
10
10
  */
11
11
 
12
+ import type { IsPlainObject } from '@contember/bindx-client'
12
13
  import type { FieldHandle } from './FieldHandle.js'
13
14
 
14
15
  // ============================================================================
@@ -22,7 +23,7 @@ export type HasOneRelationState =
22
23
  | 'creating'
23
24
 
24
25
  import type { ComponentBrand, AnyBrand } from '../brand/ComponentBrand.js'
25
- import type { FieldError, ErrorInput } from '../errors/types.js'
26
+ import type { FieldError, FieldErrorFilter, ErrorInput } from '../errors/types.js'
26
27
  import type {
27
28
  FieldChangedEvent,
28
29
  FieldChangingEvent,
@@ -51,8 +52,10 @@ export type { UnsubscribeType as Unsubscribe }
51
52
  // ============================================================================
52
53
 
53
54
  export type ScalarKeys<T> = {
54
- [K in keyof T]: T[K] extends (infer _U)[]
55
- ? never
55
+ [K in keyof T]: NonNullable<T[K]> extends readonly (infer U)[]
56
+ ? IsPlainObject<U> extends true
57
+ ? never
58
+ : K
56
59
  : NonNullable<T[K]> extends object
57
60
  ? K extends 'id'
58
61
  ? K
@@ -61,15 +64,15 @@ export type ScalarKeys<T> = {
61
64
  }[keyof T]
62
65
 
63
66
  export type HasManyKeys<T> = {
64
- [K in keyof T]: T[K] extends (infer U)[]
65
- ? U extends object
67
+ [K in keyof T]: NonNullable<T[K]> extends readonly (infer U)[]
68
+ ? IsPlainObject<U> extends true
66
69
  ? K
67
70
  : never
68
71
  : never
69
72
  }[keyof T]
70
73
 
71
74
  export type HasOneKeys<T> = {
72
- [K in keyof T]: T[K] extends (infer _U)[]
75
+ [K in keyof T]: NonNullable<T[K]> extends readonly (infer _U)[]
73
76
  ? never
74
77
  : NonNullable<T[K]> extends object
75
78
  ? K extends 'id'
@@ -140,7 +143,7 @@ export interface FieldRef<T> {
140
143
  readonly errors: readonly FieldError[]
141
144
  readonly hasError: boolean
142
145
  addError(error: ErrorInput): void
143
- clearErrors(): void
146
+ clearErrors(filter?: FieldErrorFilter): void
144
147
  onChange(listener: EventListener<FieldChangedEvent>): UnsubscribeType
145
148
  onChanging(interceptor: Interceptor<FieldChangingEvent>): UnsubscribeType
146
149
  }
@@ -413,8 +416,8 @@ export type EntityAccessorLike<TEntity> = EntityRefLike<TEntity> & {
413
416
  export type EntityFields<T> = {
414
417
  [K in ScalarKeys<T>]: FieldHandle<T[K]>
415
418
  } & {
416
- [K in HasManyKeys<T>]: T[K] extends (infer U)[]
417
- ? U extends object
419
+ [K in HasManyKeys<T>]: NonNullable<T[K]> extends readonly (infer U)[]
420
+ ? IsPlainObject<U> extends true
418
421
  ? HasManyAccessor<U>
419
422
  : never
420
423
  : never
@@ -427,9 +430,9 @@ export type EntityFields<T> = {
427
430
  */
428
431
  type FieldRefType<TEntity, TSelected, TSchema extends Record<string, object>, K extends keyof TEntity & keyof TSelected> =
429
432
  K extends ScalarKeys<TEntity> ? FieldRef<TEntity[K]> :
430
- K extends HasManyKeys<TEntity> ? (TEntity[K] extends (infer U)[]
431
- ? U extends object
432
- ? HasManyRef<U, ExtractNestedSelection<TSelected, K> extends (infer S)[] ? S : U, AnyBrand, EntityNameFromType<TSchema, U>, TSchema>
433
+ K extends HasManyKeys<TEntity> ? (NonNullable<TEntity[K]> extends readonly (infer U)[]
434
+ ? IsPlainObject<U> extends true
435
+ ? HasManyRef<U, ExtractNestedSelection<TSelected, K> extends readonly (infer S)[] ? S : U, AnyBrand, EntityNameFromType<TSchema, U>, TSchema>
433
436
  : never
434
437
  : never) :
435
438
  K extends HasOneKeys<TEntity> ? HasOneRef<
@@ -446,9 +449,9 @@ type FieldRefType<TEntity, TSelected, TSchema extends Record<string, object>, K
446
449
  */
447
450
  type FieldAccessorType<TEntity, TSelected, TSchema extends Record<string, object>, K extends keyof TEntity & keyof TSelected> =
448
451
  K extends ScalarKeys<TEntity> ? FieldAccessor<TEntity[K]> :
449
- K extends HasManyKeys<TEntity> ? (TEntity[K] extends (infer U)[]
450
- ? U extends object
451
- ? HasManyAccessor<U, ExtractNestedSelection<TSelected, K> extends (infer S)[] ? S : U, AnyBrand, EntityNameFromType<TSchema, U>, TSchema>
452
+ K extends HasManyKeys<TEntity> ? (NonNullable<TEntity[K]> extends readonly (infer U)[]
453
+ ? IsPlainObject<U> extends true
454
+ ? HasManyAccessor<U, ExtractNestedSelection<TSelected, K> extends readonly (infer S)[] ? S : U, AnyBrand, EntityNameFromType<TSchema, U>, TSchema>
452
455
  : never
453
456
  : never) :
454
457
  K extends HasOneKeys<TEntity> ? HasOneAccessor<
package/src/index.ts CHANGED
@@ -317,6 +317,7 @@ export type {
317
317
  ServerError,
318
318
  LoadError,
319
319
  FieldError,
320
+ FieldErrorFilter,
320
321
  ErrorState,
321
322
  ErrorInput,
322
323
  PathElement,
@@ -341,6 +342,7 @@ export {
341
342
  isLoadError,
342
343
  filterErrorsBySource,
343
344
  filterStickyErrors,
345
+ matchesErrorFilter,
344
346
  UnfetchedFieldError,
345
347
  resolveErrorPath,
346
348
  resolveAllErrors,
@@ -598,6 +598,11 @@ export class BatchPersister {
598
598
  for (const entity of entities) {
599
599
  let data: Record<string, unknown> | null = null
600
600
 
601
+ // The parent's update carries this row's nested `delete`, so a standalone
602
+ // update would target a row that no longer exists (issue #91). The entity
603
+ // stays in the dirty set so a persisting interceptor can still veto it.
604
+ if (entity.changeType === 'update' && this.store.isPlannedForDeleteByParent(entity.entityId)) continue
605
+
601
606
  if (entity.changeType === 'delete') {
602
607
  mutations.push({
603
608
  entityType: entity.entityType,
@@ -1186,9 +1191,39 @@ export class BatchPersister {
1186
1191
  )
1187
1192
  if (outcome === 'conflict') addConflict(ownerKey, relationConflictMessage(change.entityType, change.entityId, change.fieldName))
1188
1193
  }
1194
+ this.purgeChildrenDeletedByParent(execution, keys)
1189
1195
  return conflicts
1190
1196
  }
1191
1197
 
1198
+ /**
1199
+ * Drops the entities whose rows a confirmed parent mutation deleted through a
1200
+ * nested `delete`, the way a top-level delete already does — otherwise the
1201
+ * snapshot lingers and the next save writes a row that is gone (issue #91).
1202
+ */
1203
+ private purgeChildrenDeletedByParent(execution: PersistExecution, ownerKeys: ReadonlySet<string>): void {
1204
+ const targets = targetEntityTypesByRelation(execution)
1205
+ const deleted = new Set<string>()
1206
+ const collect = (entityType: string, entityId: string, fieldName: string, childId: string): void => {
1207
+ const targetType = targets.get(relationIdentityKey(entityType, entityId, fieldName))
1208
+ if (targetType) deleted.add(entityIdentityKey(targetType, childId))
1209
+ }
1210
+ for (const change of execution.hasOneChanges) {
1211
+ if (!ownerKeys.has(entityIdentityKey(change.entityType, change.entityId))) continue
1212
+ if (change.transition.operation !== 'delete') continue
1213
+ collect(change.entityType, change.entityId, change.fieldName, change.transition.targetId)
1214
+ }
1215
+ for (const change of execution.hasManyChanges) {
1216
+ if (!ownerKeys.has(entityIdentityKey(change.entityType, change.entityId))) continue
1217
+ for (const removal of change.removals) {
1218
+ if (removal.type === 'delete') collect(change.entityType, change.entityId, change.fieldName, removal.itemId)
1219
+ }
1220
+ }
1221
+ for (const key of deleted) {
1222
+ const child = splitExecutionKey(key)
1223
+ this.store.removeEntity(child.entityType, child.entityId)
1224
+ }
1225
+ }
1226
+
1192
1227
  private mapConfirmedIds(
1193
1228
  entity: ExecutionEntity,
1194
1229
  persistedId: string | undefined,
@@ -1565,3 +1600,16 @@ function splitExecutionKey(key: string): { entityType: string; entityId: string
1565
1600
  entityId: separator < 0 ? key : key.slice(separator + 1),
1566
1601
  }
1567
1602
  }
1603
+
1604
+ function relationIdentityKey(entityType: string, entityId: string, fieldName: string): string {
1605
+ return `${entityIdentityKey(entityType, entityId)}:${fieldName}`
1606
+ }
1607
+
1608
+ /** Relation key → the entity type its children have, the only source of a nested child's type. */
1609
+ function targetEntityTypesByRelation(execution: PersistExecution): ReadonlyMap<string, string> {
1610
+ const targets = new Map<string, string>()
1611
+ for (const field of execution.relationFields) {
1612
+ targets.set(relationIdentityKey(field.entityType, field.entityId, field.fieldName), field.targetEntityType)
1613
+ }
1614
+ return targets
1615
+ }
@@ -1,5 +1,5 @@
1
- import type { ErrorState, FieldError } from '../errors/types.js'
2
- import { filterStickyErrors } from '../errors/types.js'
1
+ import type { ErrorState, FieldError, FieldErrorFilter } from '../errors/types.js'
2
+ import { filterStickyErrors, matchesErrorFilter } from '../errors/types.js'
3
3
  import type { RekeyContext, Rekeyable } from './RekeyOrchestrator.js'
4
4
 
5
5
  /**
@@ -39,21 +39,24 @@ export class ErrorStore implements Rekeyable {
39
39
  }
40
40
 
41
41
  /**
42
- * Clears field errors, optionally filtering by source.
42
+ * Clears field errors, optionally narrowed to those matching the filter.
43
43
  */
44
- clearFieldErrors(fieldKey: string, source?: 'client' | 'server'): void {
44
+ clearFieldErrors(fieldKey: string, filter?: FieldErrorFilter): void {
45
45
  const existing = this.fieldErrors.get(fieldKey)
46
46
  if (!existing) return
47
47
 
48
- if (source === undefined) {
48
+ if (filter === undefined) {
49
+ this.fieldErrors.delete(fieldKey)
50
+ return
51
+ }
52
+
53
+ const filtered = existing.errors.filter(e => !matchesErrorFilter(e, filter))
54
+ if (filtered.length === existing.errors.length) return
55
+
56
+ if (filtered.length === 0) {
49
57
  this.fieldErrors.delete(fieldKey)
50
58
  } else {
51
- const filtered = existing.errors.filter(e => e.source !== source)
52
- if (filtered.length === 0) {
53
- this.fieldErrors.delete(fieldKey)
54
- } else {
55
- this.fieldErrors.set(fieldKey, { errors: filtered, version: existing.version + 1 })
56
- }
59
+ this.fieldErrors.set(fieldKey, { errors: filtered, version: existing.version + 1 })
57
60
  }
58
61
  }
59
62
 
@@ -162,7 +165,7 @@ export class ErrorStore implements Rekeyable {
162
165
 
163
166
  for (const key of this.fieldErrors.keys()) {
164
167
  if (key.startsWith(keyPrefix)) {
165
- this.clearFieldErrors(key, 'server')
168
+ this.clearFieldErrors(key, { source: 'server' })
166
169
  }
167
170
  }
168
171
 
@@ -1,5 +1,7 @@
1
1
  import { parentKeyFromOwnerPrefix, parentKeyFromRelationKey } from './relationKey.js'
2
+ import { PlannedDeleteIndex } from './PlannedDeleteIndex.js'
2
3
  import { RelationEdgeIndex } from './RelationEdgeIndex.js'
4
+ import { RelationOwnerIndex } from './RelationOwnerIndex.js'
3
5
 
4
6
  type ReconciliationResult = 'applied' | 'conflict'
5
7
 
@@ -109,6 +111,7 @@ export function computeDefaultOrderedIds(state: StoredHasManyState): string[] {
109
111
  export class HasManyStore {
110
112
  /** Has-many list states keyed by "parentType:parentId:fieldName" */
111
113
  private readonly hasManyStates = new Map<string, StoredHasManyState>()
114
+ private readonly owners = new RelationOwnerIndex()
112
115
 
113
116
  /**
114
117
  * Bidirectional live-edge index, maintained by {@link writeHasMany} /
@@ -117,6 +120,12 @@ export class HasManyStore {
117
120
  */
118
121
  private readonly edges = new RelationEdgeIndex()
119
122
 
123
+ /**
124
+ * Children some relation plans to remove with `delete`, maintained by
125
+ * {@link writeHasMany} / {@link deleteHasMany}, like {@link edges}.
126
+ */
127
+ private readonly plannedDeletes = new PlannedDeleteIndex()
128
+
120
129
  private mutationVersion = 0
121
130
 
122
131
  /**
@@ -143,12 +152,15 @@ export class HasManyStore {
143
152
  * keeps the index correct without tracking the reverse direction itself.
144
153
  */
145
154
  private writeHasMany(key: string, state: StoredHasManyState): void {
146
- const oldLive = liveHasManyChildIds(this.hasManyStates.get(key))
155
+ const previous = this.hasManyStates.get(key)
156
+ const oldLive = liveHasManyChildIds(previous)
147
157
  const newLive = liveHasManyChildIds(state)
148
158
  this.hasManyStates.set(key, state)
159
+ if (!previous) this.owners.add(key)
149
160
  const parentKey = parentKeyFromRelationKey(key)
150
161
  for (const id of newLive) if (!oldLive.has(id)) this.edges.addEdge(parentKey, id)
151
162
  for (const id of oldLive) if (!newLive.has(id)) this.edges.removeEdge(parentKey, id)
163
+ this.reconcilePlannedDeletes(plannedDeleteChildIds(previous), plannedDeleteChildIds(state))
152
164
  this.mutationVersion++
153
165
  }
154
166
 
@@ -162,9 +174,22 @@ export class HasManyStore {
162
174
  const parentKey = parentKeyFromRelationKey(key)
163
175
  for (const id of liveHasManyChildIds(existing)) this.edges.removeEdge(parentKey, id)
164
176
  this.hasManyStates.delete(key)
177
+ this.owners.delete(key)
178
+ this.reconcilePlannedDeletes(plannedDeleteChildIds(existing), new Set())
165
179
  this.mutationVersion++
166
180
  }
167
181
 
182
+ /** Applies one relation's planned-delete diff to the refcounted index. */
183
+ private reconcilePlannedDeletes(previous: ReadonlySet<string>, next: ReadonlySet<string>): void {
184
+ for (const id of next) if (!previous.has(id)) this.plannedDeletes.retain(id)
185
+ for (const id of previous) if (!next.has(id)) this.plannedDeletes.release(id)
186
+ }
187
+
188
+ /** Whether any has-many relation plans to remove {@link childId} with `delete`. */
189
+ isPlannedForDelete(childId: string): boolean {
190
+ return this.plannedDeletes.has(childId)
191
+ }
192
+
168
193
  /**
169
194
  * Gets or creates has-many list state.
170
195
  */
@@ -608,8 +633,8 @@ export class HasManyStore {
608
633
  * Collects the field names of dirty has-many relations for an entity.
609
634
  */
610
635
  collectDirtyRelations(keyPrefix: string, dirtyRelations: string[]): void {
611
- for (const [key, state] of this.hasManyStates) {
612
- if (!key.startsWith(keyPrefix)) continue
636
+ for (const key of this.owners.get(parentKeyFromOwnerPrefix(keyPrefix))) {
637
+ const state = this.hasManyStates.get(key)!
613
638
  const fieldName = key.slice(keyPrefix.length)
614
639
 
615
640
  if (state.plannedRemovals.size > 0 || state.plannedAdditions.size > 0) {
@@ -732,7 +757,9 @@ export class HasManyStore {
732
757
  */
733
758
  clear(): void {
734
759
  this.hasManyStates.clear()
760
+ this.owners.clear()
735
761
  this.edges.clear()
762
+ this.plannedDeletes.clear()
736
763
  this.mutationVersion++
737
764
  }
738
765
  }
@@ -754,6 +781,15 @@ function liveHasManyChildIds(state: StoredHasManyState | undefined): Set<string>
754
781
  return live
755
782
  }
756
783
 
784
+ function plannedDeleteChildIds(state: StoredHasManyState | undefined): Set<string> {
785
+ const ids = new Set<string>()
786
+ if (!state) return ids
787
+ for (const [id, type] of state.plannedRemovals) {
788
+ if (type === 'delete') ids.add(id)
789
+ }
790
+ return ids
791
+ }
792
+
757
793
  interface HasManyReconciliation {
758
794
  state: StoredHasManyState
759
795
  result: ReconciliationResult
@@ -1,7 +1,9 @@
1
1
  import type { HasOneRelationState } from '../handles/types.js'
2
2
  import type { EntitySnapshot } from './snapshots.js'
3
3
  import { parentKeyFromOwnerPrefix, parentKeyFromRelationKey } from './relationKey.js'
4
+ import { PlannedDeleteIndex } from './PlannedDeleteIndex.js'
4
5
  import { RelationEdgeIndex } from './RelationEdgeIndex.js'
6
+ import { RelationOwnerIndex } from './RelationOwnerIndex.js'
5
7
 
6
8
  /**
7
9
  * Relation state stored in SnapshotStore
@@ -40,6 +42,7 @@ function cloneRelationState(state: StoredRelationState): StoredRelationState {
40
42
  export class HasOneStore {
41
43
  /** Relation states keyed by "parentType:parentId:fieldName" */
42
44
  private readonly relationStates = new Map<string, StoredRelationState>()
45
+ private readonly owners = new RelationOwnerIndex()
43
46
 
44
47
  /**
45
48
  * Bidirectional live-edge index, maintained by {@link writeRelation} /
@@ -48,6 +51,12 @@ export class HasOneStore {
48
51
  */
49
52
  private readonly edges = new RelationEdgeIndex()
50
53
 
54
+ /**
55
+ * Targets this store plans to delete through their parent's mutation, maintained
56
+ * by {@link writeRelation} / {@link deleteRelation}, like {@link edges}.
57
+ */
58
+ private readonly plannedDeletes = new PlannedDeleteIndex()
59
+
51
60
  private mutationVersion = 0
52
61
 
53
62
  /**
@@ -73,14 +82,17 @@ export class HasOneStore {
73
82
  * tracking the reverse direction itself.
74
83
  */
75
84
  private writeRelation(key: string, state: StoredRelationState): void {
76
- const oldChild = liveHasOneChildId(this.relationStates.get(key))
85
+ const previous = this.relationStates.get(key)
86
+ const oldChild = liveHasOneChildId(previous)
77
87
  const newChild = liveHasOneChildId(state)
78
88
  this.relationStates.set(key, state)
89
+ if (!previous) this.owners.add(key)
79
90
  if (oldChild !== newChild) {
80
91
  const parentKey = parentKeyFromRelationKey(key)
81
92
  if (oldChild !== null) this.edges.removeEdge(parentKey, oldChild)
82
93
  if (newChild !== null) this.edges.addEdge(parentKey, newChild)
83
94
  }
95
+ this.reconcilePlannedDelete(plannedDeleteChildId(previous), plannedDeleteChildId(state))
84
96
  this.mutationVersion++
85
97
  }
86
98
 
@@ -94,9 +106,23 @@ export class HasOneStore {
94
106
  const child = liveHasOneChildId(existing)
95
107
  if (child !== null) this.edges.removeEdge(parentKeyFromRelationKey(key), child)
96
108
  this.relationStates.delete(key)
109
+ this.owners.delete(key)
110
+ this.reconcilePlannedDelete(plannedDeleteChildId(existing), null)
97
111
  this.mutationVersion++
98
112
  }
99
113
 
114
+ /** Applies one relation's planned-delete diff to the refcounted index. */
115
+ private reconcilePlannedDelete(previous: string | null, next: string | null): void {
116
+ if (previous === next) return
117
+ if (previous !== null) this.plannedDeletes.release(previous)
118
+ if (next !== null) this.plannedDeletes.retain(next)
119
+ }
120
+
121
+ /** Whether this store plans to delete {@link childId} through its parent. */
122
+ isPlannedForDelete(childId: string): boolean {
123
+ return this.plannedDeletes.has(childId)
124
+ }
125
+
100
126
  /**
101
127
  * Gets or creates relation state.
102
128
  */
@@ -289,8 +315,8 @@ export class HasOneStore {
289
315
  * Collects the field names of dirty has-one relations for an entity.
290
316
  */
291
317
  collectDirtyRelations(keyPrefix: string, dirtyRelations: string[]): void {
292
- for (const [key, state] of this.relationStates) {
293
- if (!key.startsWith(keyPrefix)) continue
318
+ for (const key of this.owners.get(parentKeyFromOwnerPrefix(keyPrefix))) {
319
+ const state = this.relationStates.get(key)!
294
320
  const fieldName = key.slice(keyPrefix.length)
295
321
 
296
322
  if (
@@ -375,7 +401,9 @@ export class HasOneStore {
375
401
  */
376
402
  clear(): void {
377
403
  this.relationStates.clear()
404
+ this.owners.clear()
378
405
  this.edges.clear()
406
+ this.plannedDeletes.clear()
379
407
  this.mutationVersion++
380
408
  }
381
409
  }
@@ -390,6 +418,16 @@ function liveHasOneChildId(state: StoredRelationState | undefined): string | nul
390
418
  return state.currentId !== null && state.state !== 'deleted' ? state.currentId : null
391
419
  }
392
420
 
421
+ /**
422
+ * The id the parent's `{ delete: true }` removes — `serverId`, not `currentId`,
423
+ * because that is the row MutationCollector deletes for a `deleted` relation, and a
424
+ * null serverId emits no delete at all.
425
+ */
426
+ function plannedDeleteChildId(state: StoredRelationState | undefined): string | null {
427
+ if (!state || state.state !== 'deleted') return null
428
+ return state.serverId
429
+ }
430
+
393
431
  interface HasOneReconciliation {
394
432
  state: StoredRelationState
395
433
  result: ReconciliationResult
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Refcounted multiset of entity ids whose row a parent relation plans to delete
3
+ * through its own mutation ({@link HasManyStore} `plannedRemovals` of type `delete`,
4
+ * {@link HasOneStore} state `deleted`).
5
+ *
6
+ * Refcounted because more than one relation may plan the same child's deletion, so
7
+ * the id stays planned until the last of them drops it. Like {@link RelationEdgeIndex},
8
+ * the index knows nothing about the rules: turning relation state into a planned-delete
9
+ * id is the owning sub-store's job, done once per write in its chokepoint by diffing
10
+ * the previous state against the next.
11
+ */
12
+ export class PlannedDeleteIndex {
13
+ private readonly counts = new Map<string, number>()
14
+
15
+ retain(childId: string): void {
16
+ this.counts.set(childId, (this.counts.get(childId) ?? 0) + 1)
17
+ }
18
+
19
+ release(childId: string): void {
20
+ const count = this.counts.get(childId)
21
+ if (count === undefined) return
22
+ if (count > 1) this.counts.set(childId, count - 1)
23
+ else this.counts.delete(childId)
24
+ }
25
+
26
+ has(childId: string): boolean {
27
+ return this.counts.has(childId)
28
+ }
29
+
30
+ clear(): void {
31
+ this.counts.clear()
32
+ }
33
+ }