@expo/entity 0.42.0 → 0.44.0

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 (66) hide show
  1. package/build/AuthorizationResultBasedEntityMutator.d.ts +87 -2
  2. package/build/AuthorizationResultBasedEntityMutator.js +122 -8
  3. package/build/AuthorizationResultBasedEntityMutator.js.map +1 -1
  4. package/build/EntityFieldDefinition.d.ts +1 -1
  5. package/build/EntityFieldDefinition.js +1 -1
  6. package/build/EntityFieldDefinition.js.map +1 -1
  7. package/build/EntityLoaderUtils.d.ts +15 -3
  8. package/build/EntityLoaderUtils.js +25 -10
  9. package/build/EntityLoaderUtils.js.map +1 -1
  10. package/build/EntityQueryContext.d.ts +53 -7
  11. package/build/EntityQueryContext.js +65 -10
  12. package/build/EntityQueryContext.js.map +1 -1
  13. package/build/EntityQueryContextProvider.d.ts +5 -1
  14. package/build/EntityQueryContextProvider.js +11 -4
  15. package/build/EntityQueryContextProvider.js.map +1 -1
  16. package/build/IEntityGenericCacher.d.ts +2 -2
  17. package/build/internal/CompositeFieldHolder.d.ts +13 -0
  18. package/build/internal/CompositeFieldHolder.js +7 -0
  19. package/build/internal/CompositeFieldHolder.js.map +1 -1
  20. package/build/internal/CompositeFieldValueMap.d.ts +3 -0
  21. package/build/internal/CompositeFieldValueMap.js +3 -0
  22. package/build/internal/CompositeFieldValueMap.js.map +1 -1
  23. package/build/internal/EntityDataManager.d.ts +22 -3
  24. package/build/internal/EntityDataManager.js +99 -11
  25. package/build/internal/EntityDataManager.js.map +1 -1
  26. package/build/internal/EntityFieldTransformationUtils.d.ts +20 -0
  27. package/build/internal/EntityFieldTransformationUtils.js +15 -0
  28. package/build/internal/EntityFieldTransformationUtils.js.map +1 -1
  29. package/build/internal/EntityLoadInterfaces.d.ts +8 -0
  30. package/build/internal/EntityLoadInterfaces.js +2 -0
  31. package/build/internal/EntityLoadInterfaces.js.map +1 -1
  32. package/build/internal/EntityTableDataCoordinator.d.ts +2 -0
  33. package/build/internal/EntityTableDataCoordinator.js +2 -0
  34. package/build/internal/EntityTableDataCoordinator.js.map +1 -1
  35. package/build/internal/ReadThroughEntityCache.d.ts +8 -0
  36. package/build/internal/ReadThroughEntityCache.js +5 -0
  37. package/build/internal/ReadThroughEntityCache.js.map +1 -1
  38. package/build/internal/SingleFieldHolder.d.ts +7 -0
  39. package/build/internal/SingleFieldHolder.js +7 -0
  40. package/build/internal/SingleFieldHolder.js.map +1 -1
  41. package/build/metrics/EntityMetricsUtils.d.ts +4 -3
  42. package/build/metrics/EntityMetricsUtils.js +6 -3
  43. package/build/metrics/EntityMetricsUtils.js.map +1 -1
  44. package/build/metrics/IEntityMetricsAdapter.d.ts +21 -0
  45. package/build/metrics/IEntityMetricsAdapter.js.map +1 -1
  46. package/package.json +13 -13
  47. package/src/AuthorizationResultBasedEntityMutator.ts +133 -15
  48. package/src/EntityFieldDefinition.ts +1 -1
  49. package/src/EntityLoaderUtils.ts +43 -12
  50. package/src/EntityQueryContext.ts +68 -13
  51. package/src/EntityQueryContextProvider.ts +20 -3
  52. package/src/IEntityGenericCacher.ts +2 -2
  53. package/src/__tests__/AuthorizationResultBasedEntityLoader-test.ts +98 -0
  54. package/src/__tests__/EntityQueryContext-test.ts +141 -26
  55. package/src/internal/CompositeFieldHolder.ts +15 -0
  56. package/src/internal/CompositeFieldValueMap.ts +3 -0
  57. package/src/internal/EntityDataManager.ts +170 -10
  58. package/src/internal/EntityFieldTransformationUtils.ts +20 -0
  59. package/src/internal/EntityLoadInterfaces.ts +8 -0
  60. package/src/internal/EntityTableDataCoordinator.ts +2 -0
  61. package/src/internal/ReadThroughEntityCache.ts +8 -0
  62. package/src/internal/SingleFieldHolder.ts +7 -0
  63. package/src/internal/__tests__/EntityDataManager-test.ts +708 -186
  64. package/src/metrics/EntityMetricsUtils.ts +7 -0
  65. package/src/metrics/IEntityMetricsAdapter.ts +27 -0
  66. package/src/utils/__testfixtures__/StubDatabaseAdapter.ts +13 -1
@@ -11,7 +11,93 @@ import EntityPrivacyPolicy from './EntityPrivacyPolicy';
11
11
  import { EntityQueryContext, EntityTransactionalQueryContext } from './EntityQueryContext';
12
12
  import ViewerContext from './ViewerContext';
13
13
  import IEntityMetricsAdapter from './metrics/IEntityMetricsAdapter';
14
- declare abstract class AuthorizationResultBasedBaseMutator<TFields extends Record<string, any>, TIDField extends keyof NonNullable<Pick<TFields, TSelectedFields>>, TViewerContext extends ViewerContext, TEntity extends Entity<TFields, TIDField, TViewerContext, TSelectedFields>, TPrivacyPolicy extends EntityPrivacyPolicy<TFields, TIDField, TViewerContext, TEntity, TSelectedFields>, TSelectedFields extends keyof TFields> {
14
+ /**
15
+ * Base class for entity mutators. Mutators are builder-like class instances that are
16
+ * responsible for creating, updating, and deleting entities, and for calling out to
17
+ * the loader at appropriate times to invalidate the cache(s). The loader is responsible
18
+ * for deciding which cache entries to invalidate for the entity being mutated.
19
+ *
20
+ * ## Notes on invalidation
21
+ *
22
+ * The primary goal of invalidation is to ensure that at any point in time, a load
23
+ * for an entity through a cache or layers of caches will return the most up-to-date
24
+ * value for that entity according to the source of truth stored in the database, and thus
25
+ * the read-through cache must be kept consistent (only current values are stored, others are invalidated).
26
+ *
27
+ * This is done by invalidating the cache for the entity being mutated at the end of the transaction
28
+ * in which the mutation is performed. This ensures that the cache is invalidated as close as possible
29
+ * to when the source-of-truth is updated in the database, as to reduce the likelihood of
30
+ * collisions with loads done at the same time on other machines.
31
+ *
32
+ * <blockquote>
33
+ * The easiest way to demonstrate this reasoning is via some counter-examples.
34
+ * For sake of demonstration, let's say we did invalidation immediately after the mutation instead of
35
+ * at the end of the transaction.
36
+ *
37
+ * Example 1:
38
+ * - t=0. A transaction is started on machine A and within this transaction a new entity is created.
39
+ * The cache for the entity is invalidated.
40
+ * - t=1. Machine B tries to load the same entity outside of a transaction. It does not yet exist
41
+ * so it negatively caches the entity.
42
+ * - t=2. Machine A commits the transaction.
43
+ * - t=3. Machine C tries to load the same entity outside of a transaction. It is negatively cached
44
+ * so it returns null, even though it exists in the database.
45
+ *
46
+ * One can see that it's strictly better to invalidate the transaction at t=2 as it would remove the
47
+ * negative cache entry for the entity, thus leaving the cache consistent with the database.
48
+ *
49
+ * Example 2:
50
+ * - t=0. Entity A is created and read into the cache (everthing is consistent at this point in time).
51
+ * - t=1. Machine A starts a transaction, reads entity A, updates it, and invalidates the cache.
52
+ * - t=2. Machine B reads entity A outside of a transaction. Since the transaction from the step above
53
+ * has not yet been committed, the changes within that transaction are not yet visible. It stores
54
+ * the entity in the cache.
55
+ * - t=3. Machine A commits the transaction.
56
+ * - t=4. Machine C reads entity A outside of a transaction. It returns the entity from the cache which
57
+ * is now inconsistent with the database.
58
+ *
59
+ * Again, one can see that it's strictly better to invalidate the transaction at t=3 as it would remove the
60
+ * stale cache entry for the entity, thus leaving the cache consistent with the database.
61
+ *
62
+ * For deletions, one can imagine a similar series of events occurring.
63
+ * </blockquote>
64
+ *
65
+ * #### Invalidation as it pertains to transactions and nested transactions
66
+ *
67
+ * Invalidation becomes slightly more complex when nested transactions are considered. The general
68
+ * guiding principle here is that over-invalidation is strictly better than under-invalidation
69
+ * as far as consistency goes. This is because the database is the source of truth.
70
+ *
71
+ * For the visible-to-the-outside-world caches (cache adapters), the invalidations are done at the
72
+ * end of the outermost transaction (as discussed above), plus at the end of each nested transaction.
73
+ * While only the outermost transaction is strictly necessary for these cache adapter invalidations,
74
+ * the mental model of doing it at the end of each transaction, nested or otherwise, is easier to reason about.
75
+ *
76
+ * For the dataloader caches (per-transaction local caches), the invalidation is done multiple times
77
+ * (over-invalidation) to better ensure that the caches are always consistent with the database as read within
78
+ * the transaction or nested transaction.
79
+ * 1. Immediately after the mutation is performed (but before the transaction or nested transaction is committed).
80
+ * 2. At the end of the transaction (or nested transaction) itself.
81
+ * 3. At the end of the outermost transaction (if this is a nested transaction) and all of that transactions's nested transactions recursively.
82
+ *
83
+ * This over-invalidation is done because transaction isolation semantics are not consistent across all
84
+ * databases (some databases don't even have true nested transactions at all), meaning that whether
85
+ * a change made in a nested transaction is visible to the parent transaction(s) is not necessarily known.
86
+ * This means that the only way to ensure that the dataloader caches are consistent
87
+ * with the database is to invalidate them often, thus delegating consistency to the database. Invalidation
88
+ * of local caches is synchronous and immediate, so the performance impact of over-invalidation is negligible.
89
+ *
90
+ * #### Invalidation pitfalls
91
+ *
92
+ * One may have noticed that the above invalidation strategy still isn't perfect. Cache invalidation is hard.
93
+ * There still exists a very short moment in time between when invalidation occurs and when the transaction is committed,
94
+ * so dirty cache writes are still possible, especially in systems reading an object frequently and writing to the same object.
95
+ * For now, the entity framework does not attempt to provide a further solution to this problem since it is likely
96
+ * solutions will be case-specific. Some fun reads on the topic:
97
+ * - https://engineering.fb.com/2013/06/25/core-infra/tao-the-power-of-the-graph/
98
+ * - https://hazelcast.com/blog/a-hitchhikers-guide-to-caching-patterns/
99
+ */
100
+ export declare abstract class AuthorizationResultBasedBaseMutator<TFields extends Record<string, any>, TIDField extends keyof NonNullable<Pick<TFields, TSelectedFields>>, TViewerContext extends ViewerContext, TEntity extends Entity<TFields, TIDField, TViewerContext, TSelectedFields>, TPrivacyPolicy extends EntityPrivacyPolicy<TFields, TIDField, TViewerContext, TEntity, TSelectedFields>, TSelectedFields extends keyof TFields> {
15
101
  protected readonly companionProvider: EntityCompanionProvider;
16
102
  protected readonly viewerContext: TViewerContext;
17
103
  protected readonly queryContext: EntityQueryContext;
@@ -102,4 +188,3 @@ export declare class AuthorizationResultBasedDeleteMutator<TFields extends Recor
102
188
  */
103
189
  private processEntityDeletionForInboundEdgesAsync;
104
190
  }
105
- export {};
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AuthorizationResultBasedDeleteMutator = exports.AuthorizationResultBasedUpdateMutator = exports.AuthorizationResultBasedCreateMutator = void 0;
6
+ exports.AuthorizationResultBasedDeleteMutator = exports.AuthorizationResultBasedUpdateMutator = exports.AuthorizationResultBasedCreateMutator = exports.AuthorizationResultBasedBaseMutator = void 0;
7
7
  const results_1 = require("@expo/results");
8
8
  const invariant_1 = __importDefault(require("invariant"));
9
9
  const EntityFieldDefinition_1 = require("./EntityFieldDefinition");
@@ -13,6 +13,92 @@ const EntityInvalidFieldValueError_1 = __importDefault(require("./errors/EntityI
13
13
  const EntityMetricsUtils_1 = require("./metrics/EntityMetricsUtils");
14
14
  const IEntityMetricsAdapter_1 = require("./metrics/IEntityMetricsAdapter");
15
15
  const maps_1 = require("./utils/collections/maps");
16
+ /**
17
+ * Base class for entity mutators. Mutators are builder-like class instances that are
18
+ * responsible for creating, updating, and deleting entities, and for calling out to
19
+ * the loader at appropriate times to invalidate the cache(s). The loader is responsible
20
+ * for deciding which cache entries to invalidate for the entity being mutated.
21
+ *
22
+ * ## Notes on invalidation
23
+ *
24
+ * The primary goal of invalidation is to ensure that at any point in time, a load
25
+ * for an entity through a cache or layers of caches will return the most up-to-date
26
+ * value for that entity according to the source of truth stored in the database, and thus
27
+ * the read-through cache must be kept consistent (only current values are stored, others are invalidated).
28
+ *
29
+ * This is done by invalidating the cache for the entity being mutated at the end of the transaction
30
+ * in which the mutation is performed. This ensures that the cache is invalidated as close as possible
31
+ * to when the source-of-truth is updated in the database, as to reduce the likelihood of
32
+ * collisions with loads done at the same time on other machines.
33
+ *
34
+ * <blockquote>
35
+ * The easiest way to demonstrate this reasoning is via some counter-examples.
36
+ * For sake of demonstration, let's say we did invalidation immediately after the mutation instead of
37
+ * at the end of the transaction.
38
+ *
39
+ * Example 1:
40
+ * - t=0. A transaction is started on machine A and within this transaction a new entity is created.
41
+ * The cache for the entity is invalidated.
42
+ * - t=1. Machine B tries to load the same entity outside of a transaction. It does not yet exist
43
+ * so it negatively caches the entity.
44
+ * - t=2. Machine A commits the transaction.
45
+ * - t=3. Machine C tries to load the same entity outside of a transaction. It is negatively cached
46
+ * so it returns null, even though it exists in the database.
47
+ *
48
+ * One can see that it's strictly better to invalidate the transaction at t=2 as it would remove the
49
+ * negative cache entry for the entity, thus leaving the cache consistent with the database.
50
+ *
51
+ * Example 2:
52
+ * - t=0. Entity A is created and read into the cache (everthing is consistent at this point in time).
53
+ * - t=1. Machine A starts a transaction, reads entity A, updates it, and invalidates the cache.
54
+ * - t=2. Machine B reads entity A outside of a transaction. Since the transaction from the step above
55
+ * has not yet been committed, the changes within that transaction are not yet visible. It stores
56
+ * the entity in the cache.
57
+ * - t=3. Machine A commits the transaction.
58
+ * - t=4. Machine C reads entity A outside of a transaction. It returns the entity from the cache which
59
+ * is now inconsistent with the database.
60
+ *
61
+ * Again, one can see that it's strictly better to invalidate the transaction at t=3 as it would remove the
62
+ * stale cache entry for the entity, thus leaving the cache consistent with the database.
63
+ *
64
+ * For deletions, one can imagine a similar series of events occurring.
65
+ * </blockquote>
66
+ *
67
+ * #### Invalidation as it pertains to transactions and nested transactions
68
+ *
69
+ * Invalidation becomes slightly more complex when nested transactions are considered. The general
70
+ * guiding principle here is that over-invalidation is strictly better than under-invalidation
71
+ * as far as consistency goes. This is because the database is the source of truth.
72
+ *
73
+ * For the visible-to-the-outside-world caches (cache adapters), the invalidations are done at the
74
+ * end of the outermost transaction (as discussed above), plus at the end of each nested transaction.
75
+ * While only the outermost transaction is strictly necessary for these cache adapter invalidations,
76
+ * the mental model of doing it at the end of each transaction, nested or otherwise, is easier to reason about.
77
+ *
78
+ * For the dataloader caches (per-transaction local caches), the invalidation is done multiple times
79
+ * (over-invalidation) to better ensure that the caches are always consistent with the database as read within
80
+ * the transaction or nested transaction.
81
+ * 1. Immediately after the mutation is performed (but before the transaction or nested transaction is committed).
82
+ * 2. At the end of the transaction (or nested transaction) itself.
83
+ * 3. At the end of the outermost transaction (if this is a nested transaction) and all of that transactions's nested transactions recursively.
84
+ *
85
+ * This over-invalidation is done because transaction isolation semantics are not consistent across all
86
+ * databases (some databases don't even have true nested transactions at all), meaning that whether
87
+ * a change made in a nested transaction is visible to the parent transaction(s) is not necessarily known.
88
+ * This means that the only way to ensure that the dataloader caches are consistent
89
+ * with the database is to invalidate them often, thus delegating consistency to the database. Invalidation
90
+ * of local caches is synchronous and immediate, so the performance impact of over-invalidation is negligible.
91
+ *
92
+ * #### Invalidation pitfalls
93
+ *
94
+ * One may have noticed that the above invalidation strategy still isn't perfect. Cache invalidation is hard.
95
+ * There still exists a very short moment in time between when invalidation occurs and when the transaction is committed,
96
+ * so dirty cache writes are still possible, especially in systems reading an object frequently and writing to the same object.
97
+ * For now, the entity framework does not attempt to provide a further solution to this problem since it is likely
98
+ * solutions will be case-specific. Some fun reads on the topic:
99
+ * - https://engineering.fb.com/2013/06/25/core-infra/tao-the-power-of-the-graph/
100
+ * - https://hazelcast.com/blog/a-hitchhikers-guide-to-caching-patterns/
101
+ */
16
102
  class AuthorizationResultBasedBaseMutator {
17
103
  companionProvider;
18
104
  viewerContext;
@@ -65,6 +151,7 @@ class AuthorizationResultBasedBaseMutator {
65
151
  await Promise.all(triggers.map((trigger) => trigger.executeAsync(this.viewerContext, entity, mutationInfo)));
66
152
  }
67
153
  }
154
+ exports.AuthorizationResultBasedBaseMutator = AuthorizationResultBasedBaseMutator;
68
155
  /**
69
156
  * Mutator for creating a new entity.
70
157
  */
@@ -85,7 +172,7 @@ class AuthorizationResultBasedCreateMutator extends AuthorizationResultBasedBase
85
172
  * @returns authorized, cached, newly-created entity result, where result error can be UnauthorizedError
86
173
  */
87
174
  async createAsync() {
88
- return await (0, EntityMetricsUtils_1.timeAndLogMutationEventAsync)(this.metricsAdapter, IEntityMetricsAdapter_1.EntityMetricsMutationType.CREATE, this.entityClass.name)(this.createInTransactionAsync());
175
+ return await (0, EntityMetricsUtils_1.timeAndLogMutationEventAsync)(this.metricsAdapter, IEntityMetricsAdapter_1.EntityMetricsMutationType.CREATE, this.entityClass.name, this.queryContext)(this.createInTransactionAsync());
89
176
  }
90
177
  async createInTransactionAsync() {
91
178
  return await this.queryContext.runInTransactionIfNotInTransactionAsync((innerQueryContext) => this.createInternalAsync(innerQueryContext));
@@ -108,7 +195,13 @@ class AuthorizationResultBasedCreateMutator extends AuthorizationResultBasedBase
108
195
  await this.executeMutationTriggersAsync(this.mutationTriggers.beforeAll, queryContext, temporaryEntityForPrivacyCheck, { type: EntityMutationInfo_1.EntityMutationType.CREATE });
109
196
  await this.executeMutationTriggersAsync(this.mutationTriggers.beforeCreate, queryContext, temporaryEntityForPrivacyCheck, { type: EntityMutationInfo_1.EntityMutationType.CREATE });
110
197
  const insertResult = await this.databaseAdapter.insertAsync(queryContext, this.fieldsForEntity);
111
- queryContext.appendPostCommitInvalidationCallback(entityLoader.utils.invalidateFieldsAsync.bind(entityLoader, insertResult));
198
+ // Invalidate all caches for the new entity so that any previously-negatively-cached loads
199
+ // are removed from the caches.
200
+ queryContext.appendPostCommitInvalidationCallback(async () => {
201
+ entityLoader.utils.invalidateFieldsForTransaction(queryContext, insertResult);
202
+ await entityLoader.utils.invalidateFieldsAsync(insertResult);
203
+ });
204
+ entityLoader.utils.invalidateFieldsForTransaction(queryContext, insertResult);
112
205
  const unauthorizedEntityAfterInsert = entityLoader.utils.constructEntity(insertResult);
113
206
  const newEntity = await (0, results_1.enforceAsyncResult)(entityLoader.loadByIDAsync(unauthorizedEntityAfterInsert.getID()));
114
207
  await this.executeMutationTriggersAsync(this.mutationTriggers.afterCreate, queryContext, newEntity, { type: EntityMutationInfo_1.EntityMutationType.CREATE });
@@ -146,7 +239,7 @@ class AuthorizationResultBasedUpdateMutator extends AuthorizationResultBasedBase
146
239
  * @returns authorized updated entity result, where result error can be UnauthorizedError
147
240
  */
148
241
  async updateAsync() {
149
- return await (0, EntityMetricsUtils_1.timeAndLogMutationEventAsync)(this.metricsAdapter, IEntityMetricsAdapter_1.EntityMetricsMutationType.UPDATE, this.entityClass.name)(this.updateInTransactionAsync(false, null));
242
+ return await (0, EntityMetricsUtils_1.timeAndLogMutationEventAsync)(this.metricsAdapter, IEntityMetricsAdapter_1.EntityMetricsMutationType.UPDATE, this.entityClass.name, this.queryContext)(this.updateInTransactionAsync(false, null));
150
243
  }
151
244
  async updateInTransactionAsync(skipDatabaseUpdate, cascadingDeleteCause) {
152
245
  return await this.queryContext.runInTransactionIfNotInTransactionAsync((innerQueryContext) => this.updateInternalAsync(innerQueryContext, skipDatabaseUpdate, cascadingDeleteCause));
@@ -170,8 +263,23 @@ class AuthorizationResultBasedUpdateMutator extends AuthorizationResultBasedBase
170
263
  if (!skipDatabaseUpdate) {
171
264
  await this.databaseAdapter.updateAsync(queryContext, this.entityConfiguration.idField, entityAboutToBeUpdated.getID(), this.updatedFields);
172
265
  }
173
- queryContext.appendPostCommitInvalidationCallback(entityLoader.utils.invalidateFieldsAsync.bind(entityLoader, this.originalEntity.getAllDatabaseFields()));
174
- queryContext.appendPostCommitInvalidationCallback(entityLoader.utils.invalidateFieldsAsync.bind(entityLoader, this.fieldsForEntity));
266
+ // Invalidate all caches for the entity being updated so that any previously-cached loads
267
+ // are consistent. This means:
268
+ // - any query that returned this entity (pre-update) in the past should no longer have that entity in cache for that query.
269
+ // - any query that will return this entity (post-update) that would not have returned the entity in the past should not
270
+ // be negatively cached for the entity.
271
+ // To do this we simply invalidate all of the entity's caches for both the previous version of the entity and the upcoming
272
+ // version of the entity.
273
+ queryContext.appendPostCommitInvalidationCallback(async () => {
274
+ entityLoader.utils.invalidateFieldsForTransaction(queryContext, this.originalEntity.getAllDatabaseFields());
275
+ entityLoader.utils.invalidateFieldsForTransaction(queryContext, this.fieldsForEntity);
276
+ await Promise.all([
277
+ entityLoader.utils.invalidateFieldsAsync(this.originalEntity.getAllDatabaseFields()),
278
+ entityLoader.utils.invalidateFieldsAsync(this.fieldsForEntity),
279
+ ]);
280
+ });
281
+ entityLoader.utils.invalidateFieldsForTransaction(queryContext, this.originalEntity.getAllDatabaseFields());
282
+ entityLoader.utils.invalidateFieldsForTransaction(queryContext, this.fieldsForEntity);
175
283
  const updatedEntity = await (0, results_1.enforceAsyncResult)(entityLoader.loadByIDAsync(entityAboutToBeUpdated.getID())); // ID is guaranteed to be stable by ensureStableIDField
176
284
  await this.executeMutationTriggersAsync(this.mutationTriggers.afterUpdate, queryContext, updatedEntity, { type: EntityMutationInfo_1.EntityMutationType.UPDATE, previousValue: this.originalEntity, cascadingDeleteCause });
177
285
  await this.executeMutationTriggersAsync(this.mutationTriggers.afterAll, queryContext, updatedEntity, { type: EntityMutationInfo_1.EntityMutationType.UPDATE, previousValue: this.originalEntity, cascadingDeleteCause });
@@ -205,7 +313,7 @@ class AuthorizationResultBasedDeleteMutator extends AuthorizationResultBasedBase
205
313
  * @returns void result, where result error can be UnauthorizedError
206
314
  */
207
315
  async deleteAsync() {
208
- return await (0, EntityMetricsUtils_1.timeAndLogMutationEventAsync)(this.metricsAdapter, IEntityMetricsAdapter_1.EntityMetricsMutationType.DELETE, this.entityClass.name)(this.deleteInTransactionAsync(new Set(), false, null));
316
+ return await (0, EntityMetricsUtils_1.timeAndLogMutationEventAsync)(this.metricsAdapter, IEntityMetricsAdapter_1.EntityMetricsMutationType.DELETE, this.entityClass.name, this.queryContext)(this.deleteInTransactionAsync(new Set(), false, null));
209
317
  }
210
318
  async deleteInTransactionAsync(processedEntityIdentifiersFromTransitiveDeletions, skipDatabaseDeletion, cascadingDeleteCause) {
211
319
  return await this.queryContext.runInTransactionIfNotInTransactionAsync((innerQueryContext) => this.deleteInternalAsync(innerQueryContext, processedEntityIdentifiersFromTransitiveDeletions, skipDatabaseDeletion, cascadingDeleteCause));
@@ -225,7 +333,13 @@ class AuthorizationResultBasedDeleteMutator extends AuthorizationResultBasedBase
225
333
  previousValue: null,
226
334
  cascadingDeleteCause,
227
335
  });
228
- queryContext.appendPostCommitInvalidationCallback(entityLoader.utils.invalidateFieldsAsync.bind(entityLoader, this.entity.getAllDatabaseFields()));
336
+ // Invalidate all caches for the entity so that any previously-cached loads
337
+ // are removed from the caches.
338
+ queryContext.appendPostCommitInvalidationCallback(async () => {
339
+ entityLoader.utils.invalidateFieldsForTransaction(queryContext, this.entity.getAllDatabaseFields());
340
+ await entityLoader.utils.invalidateFieldsAsync(this.entity.getAllDatabaseFields());
341
+ });
342
+ entityLoader.utils.invalidateFieldsForTransaction(queryContext, this.entity.getAllDatabaseFields());
229
343
  await this.executeMutationTriggersAsync(this.mutationTriggers.afterDelete, queryContext, this.entity, { type: EntityMutationInfo_1.EntityMutationType.DELETE, cascadingDeleteCause });
230
344
  await this.executeMutationTriggersAsync(this.mutationTriggers.afterAll, queryContext, this.entity, { type: EntityMutationInfo_1.EntityMutationType.DELETE, cascadingDeleteCause });
231
345
  queryContext.appendPostCommitCallback(this.executeNonTransactionalMutationTriggersAsync.bind(this, this.mutationTriggers.afterCommit, this.entity, { type: EntityMutationInfo_1.EntityMutationType.DELETE, cascadingDeleteCause }));
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorizationResultBasedEntityMutator.js","sourceRoot":"","sources":["../src/AuthorizationResultBasedEntityMutator.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAgF;AAChF,0DAAkC;AAMlC,mEAAqE;AAErE,6DAK8B;AAS9B,+CAAoD;AACpD,yGAAiF;AACjF,qEAA4E;AAC5E,2EAAmG;AACnG,mDAAuD;AAEvD,MAAe,mCAAmC;IAe3B;IACA;IACA;IACA;IACA;IAQA;IACA;IAOA;IAOA;IAQA;IACA;IArCrB,YACqB,iBAA0C,EAC1C,aAA6B,EAC7B,YAAgC,EAChC,mBAA2D,EAC3D,WAOlB,EACkB,aAA6B,EAC7B,kBAMhB,EACgB,gBAMlB,EACkB,mBAOlB,EACkB,eAAyD,EACzD,cAAqC;QApCrC,sBAAiB,GAAjB,iBAAiB,CAAyB;QAC1C,kBAAa,GAAb,aAAa,CAAgB;QAC7B,iBAAY,GAAZ,YAAY,CAAoB;QAChC,wBAAmB,GAAnB,mBAAmB,CAAwC;QAC3D,gBAAW,GAAX,WAAW,CAO7B;QACkB,kBAAa,GAAb,aAAa,CAAgB;QAC7B,uBAAkB,GAAlB,kBAAkB,CAMlC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AAuB,CAAC,CAC7D,CACF,CACF,CAAC;wBACF,MAAM;oBACR,CAAC;oBACD,KAAK,kDAA0B,CAAC,cAAc,CAAC,CAAC,CAAC;wBAC/C,MAAM,OAAO,CAAC,GAAG,CACf,wBAAwB,CAAC,GAAG,CAAC,CAAC,sBAAsB,EAAE,EAAE,CACtD,IAAA,4BAAkB,EAChB,cAAc;6BACX,SAAS,CAAC,sBAAsB,EAAE,YAAY,CAAC;6BAC/C,wBAAwB,CACvB,0BAA0B;wBAC1B,0BAA0B,CAAC,KAAK,EAChC,uBAAuB,CACxB,CACJ,CACF,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AAnVD,sFAmVC"}
1
+ {"version":3,"file":"AuthorizationResultBasedEntityMutator.js","sourceRoot":"","sources":["../src/AuthorizationResultBasedEntityMutator.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAgF;AAChF,0DAAkC;AAMlC,mEAAqE;AAErE,6DAK8B;AAS9B,+CAAoD;AACpD,yGAAiF;AACjF,qEAA4E;AAC5E,2EAAmG;AACnG,mDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AACH,MAAsB,mCAAmC;IAelC;IACA;IACA;IACA;IACA;IAQA;IACA;IAOA;IAOA;IAQA;IACA;IArCrB,YACqB,iBAA0C,EAC1C,aAA6B,EAC7B,YAAgC,EAChC,mBAA2D,EAC3D,WAOlB,EACkB,aAA6B,EAC7B,kBAMhB,EACgB,gBAMlB,EACkB,mBAOlB,EACkB,eAAyD,EACzD,cAAqC;QApCrC,sBAAiB,GAAjB,iBAAiB,CAAyB;QAC1C,kBAAa,GAAb,aAAa,CAAgB;QAC7B,iBAAY,GAAZ,YAAY,CAAoB;QAChC,wBAAmB,GAAnB,mBAAmB,CAAwC;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BACD,KAAK,kDAA0B,CAAC,cAAc,CAAC,CAAC,CAAC;wBAC/C,MAAM,OAAO,CAAC,GAAG,CACf,wBAAwB,CAAC,GAAG,CAAC,CAAC,sBAAsB,EAAE,EAAE,CACtD,IAAA,4BAAkB,EAChB,cAAc;6BACX,SAAS,CAAC,sBAAsB,EAAE,YAAY,CAAC;6BAC/C,wBAAwB,CACvB,0BAA0B;wBAC1B,0BAA0B,CAAC,KAAK,EAChC,uBAAuB,CACxB,CACJ,CACF,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AA5VD,sFA4VC"}
@@ -133,7 +133,7 @@ export declare abstract class EntityFieldDefinition<T, TRequireExplicitCache ext
133
133
  readonly columnName: string;
134
134
  readonly cache: boolean;
135
135
  readonly association: EntityAssociationDefinition<any, any, any, any, any, any> | undefined;
136
- private readonly cacheRawSentinel;
136
+ protected readonly _cacheRawSentinel: TRequireExplicitCache;
137
137
  /**
138
138
  * @param options - options for this field definition
139
139
  */
@@ -69,7 +69,7 @@ class EntityFieldDefinition {
69
69
  association;
70
70
  // @ts-expect-error this is to ensure that different constructor requirements produce incompatible
71
71
  // objects in the eyes of the type system
72
- cacheRawSentinel;
72
+ _cacheRawSentinel;
73
73
  /**
74
74
  * @param options - options for this field definition
75
75
  */
@@ -1 +1 @@
1
- {"version":3,"file":"EntityFieldDefinition.js","sourceRoot":"","sources":["../src/EntityFieldDefinition.ts"],"names":[],"mappings":";;;AAKA,IAAY,0BA+BX;AA/BD,WAAY,0BAA0B;IACpC;;;;;;OAMG;IACH,2IAAoC,CAAA;IAEpC;;;;;OAKG;IACH,+HAA8B,CAAA;IAE9B;;;;OAIG;IACH,+FAAc,CAAA;IAEd;;;;OAIG;IACH,mFAAQ,CAAA;AACV,CAAC,EA/BW,0BAA0B,0CAA1B,0BAA0B,QA+BrC;AAED,IAAY,gDA2BX;AA3BD,WAAY,gDAAgD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2B3D;AAuGD;;;GAGG;AACH,MAAsB,qBAAqB;IAChC,UAAU,CAAS;IACnB,KAAK,CAAU;IACf,WAAW,CAAwE;IAE5F,kGAAkG;IAClG,yCAAyC;IACtB,iBAAiB,CAAwB;IAE5D;;OAEG;IACH,YACE,OAEgC;QAEhC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,KAA2B;QACnD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;CAEF;AAnCD,sDAmCC"}
@@ -2,7 +2,7 @@ import { Result } from '@expo/results';
2
2
  import { IEntityClass } from './Entity';
3
3
  import EntityConfiguration from './EntityConfiguration';
4
4
  import EntityPrivacyPolicy, { EntityPrivacyPolicyEvaluationContext } from './EntityPrivacyPolicy';
5
- import { EntityQueryContext } from './EntityQueryContext';
5
+ import { EntityQueryContext, EntityTransactionalQueryContext } from './EntityQueryContext';
6
6
  import ReadonlyEntity from './ReadonlyEntity';
7
7
  import ViewerContext from './ViewerContext';
8
8
  import EntityDataManager from './internal/EntityDataManager';
@@ -22,17 +22,29 @@ export default class EntityLoaderUtils<TFields extends Record<string, any>, TIDF
22
22
  private readonly dataManager;
23
23
  protected readonly metricsAdapter: IEntityMetricsAdapter;
24
24
  constructor(viewerContext: TViewerContext, queryContext: EntityQueryContext, privacyPolicyEvaluationContext: EntityPrivacyPolicyEvaluationContext<TFields, TIDField, TViewerContext, TEntity, TSelectedFields>, entityConfiguration: EntityConfiguration<TFields, TIDField>, entityClass: IEntityClass<TFields, TIDField, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>, entitySelectedFields: TSelectedFields[] | undefined, privacyPolicy: TPrivacyPolicy, dataManager: EntityDataManager<TFields, TIDField>, metricsAdapter: IEntityMetricsAdapter);
25
+ private getKeyValuePairsFromObjectFields;
25
26
  /**
26
- * Invalidate all caches for an entity's fields. Exposed primarily for internal use by EntityMutator.
27
+ * Invalidate all caches and local dataloaders for an entity's fields. Exposed primarily for internal use by EntityMutator.
27
28
  * @param objectFields - entity data object to be invalidated
28
29
  */
29
30
  invalidateFieldsAsync(objectFields: Readonly<TFields>): Promise<void>;
30
31
  /**
31
- * Invalidate all caches for an entity. One potential use case would be to keep the entity
32
+ * Invalidate all local dataloaders specific to a transaction for an entity's fields. Exposed primarily for internal use by EntityMutator.
33
+ * @param objectFields - entity data object to be invalidated
34
+ */
35
+ invalidateFieldsForTransaction(queryContext: EntityTransactionalQueryContext, objectFields: Readonly<TFields>): void;
36
+ /**
37
+ * Invalidate all caches and local dataloaders for an entity. One potential use case would be to keep the entity
32
38
  * framework in sync with changes made to data outside of the framework.
33
39
  * @param entity - entity to be invalidated
34
40
  */
35
41
  invalidateEntityAsync(entity: TEntity): Promise<void>;
42
+ /**
43
+ * Invalidate all local dataloaders specific to a transaction for an entity. One potential use case would be to keep the entity
44
+ * framework in sync with changes made to data outside of the framework.
45
+ * @param entity - entity to be invalidated
46
+ */
47
+ invalidateEntityForTransaction(queryContext: EntityTransactionalQueryContext, entity: TEntity): void;
36
48
  /**
37
49
  * Construct an entity from a fields object (applying field selection if applicable),
38
50
  * checking that the ID field is specified.
@@ -33,11 +33,7 @@ class EntityLoaderUtils {
33
33
  this.dataManager = dataManager;
34
34
  this.metricsAdapter = metricsAdapter;
35
35
  }
36
- /**
37
- * Invalidate all caches for an entity's fields. Exposed primarily for internal use by EntityMutator.
38
- * @param objectFields - entity data object to be invalidated
39
- */
40
- async invalidateFieldsAsync(objectFields) {
36
+ getKeyValuePairsFromObjectFields(objectFields) {
41
37
  const keys = Object.keys(objectFields);
42
38
  const singleFieldKeyValues = keys
43
39
  .map((fieldName) => {
@@ -60,19 +56,38 @@ class EntityLoaderUtils {
60
56
  : null;
61
57
  })
62
58
  .filter((kv) => kv !== null);
63
- await this.dataManager.invalidateKeyValuePairsAsync([
64
- ...singleFieldKeyValues,
65
- ...compositeFieldKeyValues,
66
- ]);
59
+ return [...singleFieldKeyValues, ...compositeFieldKeyValues];
60
+ }
61
+ /**
62
+ * Invalidate all caches and local dataloaders for an entity's fields. Exposed primarily for internal use by EntityMutator.
63
+ * @param objectFields - entity data object to be invalidated
64
+ */
65
+ async invalidateFieldsAsync(objectFields) {
66
+ await this.dataManager.invalidateKeyValuePairsAsync(this.getKeyValuePairsFromObjectFields(objectFields));
67
67
  }
68
68
  /**
69
- * Invalidate all caches for an entity. One potential use case would be to keep the entity
69
+ * Invalidate all local dataloaders specific to a transaction for an entity's fields. Exposed primarily for internal use by EntityMutator.
70
+ * @param objectFields - entity data object to be invalidated
71
+ */
72
+ invalidateFieldsForTransaction(queryContext, objectFields) {
73
+ this.dataManager.invalidateKeyValuePairsForTransaction(queryContext, this.getKeyValuePairsFromObjectFields(objectFields));
74
+ }
75
+ /**
76
+ * Invalidate all caches and local dataloaders for an entity. One potential use case would be to keep the entity
70
77
  * framework in sync with changes made to data outside of the framework.
71
78
  * @param entity - entity to be invalidated
72
79
  */
73
80
  async invalidateEntityAsync(entity) {
74
81
  await this.invalidateFieldsAsync(entity.getAllDatabaseFields());
75
82
  }
83
+ /**
84
+ * Invalidate all local dataloaders specific to a transaction for an entity. One potential use case would be to keep the entity
85
+ * framework in sync with changes made to data outside of the framework.
86
+ * @param entity - entity to be invalidated
87
+ */
88
+ invalidateEntityForTransaction(queryContext, entity) {
89
+ this.invalidateFieldsForTransaction(queryContext, entity.getAllDatabaseFields());
90
+ }
76
91
  /**
77
92
  * Construct an entity from a fields object (applying field selection if applicable),
78
93
  * checking that the ID field is specified.
@@ -1 +1 @@
1
- {"version":3,"file":"EntityLoa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AAC,KAAK,EAC3B,IAAI,CAAC,cAAc,CACpB,CACF,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAEO,oBAAoB,CAAC,aAAiC;QAC5D,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;YACxC,IAAI,CAAC;gBACH,OAAO,IAAA,gBAAM,EAAC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;YACpD,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,EAAE,CAAC;oBAC1B,MAAM,CAAC,CAAC;gBACV,CAAC;gBACD,OAAO,IAAA,gBAAM,EAAC,CAAC,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA5LD,oCA4LC"}
@@ -6,8 +6,14 @@ export declare enum TransactionIsolationLevel {
6
6
  REPEATABLE_READ = "REPEATABLE_READ",
7
7
  SERIALIZABLE = "SERIALIZABLE"
8
8
  }
9
+ export declare enum TransactionalDataLoaderMode {
10
+ ENABLED = "ENABLED",
11
+ ENABLED_BATCH_ONLY = "ENABLED_BATCH_ONLY",
12
+ DISABLED = "DISABLED"
13
+ }
9
14
  export type TransactionConfig = {
10
15
  isolationLevel?: TransactionIsolationLevel;
16
+ transactionalDataLoaderMode?: TransactionalDataLoaderMode;
11
17
  };
12
18
  /**
13
19
  * Entity framework representation of transactional and non-transactional database
@@ -19,7 +25,7 @@ export type TransactionConfig = {
19
25
  export declare abstract class EntityQueryContext {
20
26
  private readonly queryInterface;
21
27
  constructor(queryInterface: any);
22
- abstract isInTransaction(): boolean;
28
+ abstract isInTransaction(): this is EntityTransactionalQueryContext;
23
29
  getQueryInterface(): any;
24
30
  abstract runInTransactionIfNotInTransactionAsync<T>(transactionScope: (queryContext: EntityTransactionalQueryContext) => Promise<T>, transactionConfig?: TransactionConfig): Promise<T>;
25
31
  }
@@ -32,7 +38,7 @@ export declare abstract class EntityQueryContext {
32
38
  export declare class EntityNonTransactionalQueryContext extends EntityQueryContext {
33
39
  private readonly entityQueryContextProvider;
34
40
  constructor(queryInterface: any, entityQueryContextProvider: EntityQueryContextProvider);
35
- isInTransaction(): boolean;
41
+ isInTransaction(): this is EntityTransactionalQueryContext;
36
42
  runInTransactionIfNotInTransactionAsync<T>(transactionScope: (queryContext: EntityTransactionalQueryContext) => Promise<T>, transactionConfig?: TransactionConfig): Promise<T>;
37
43
  }
38
44
  /**
@@ -42,10 +48,23 @@ export declare class EntityNonTransactionalQueryContext extends EntityQueryConte
42
48
  */
43
49
  export declare class EntityTransactionalQueryContext extends EntityQueryContext {
44
50
  private readonly entityQueryContextProvider;
51
+ /**
52
+ * @internal
53
+ */
54
+ readonly transactionId: string;
55
+ readonly transactionalDataLoaderMode: TransactionalDataLoaderMode;
56
+ /**
57
+ * @internal
58
+ */
59
+ readonly childQueryContexts: EntityNestedTransactionalQueryContext[];
45
60
  private readonly postCommitInvalidationCallbacks;
46
61
  private readonly postCommitCallbacks;
47
62
  private readonly preCommitCallbacks;
48
- constructor(queryInterface: any, entityQueryContextProvider: EntityQueryContextProvider);
63
+ constructor(queryInterface: any, entityQueryContextProvider: EntityQueryContextProvider,
64
+ /**
65
+ * @internal
66
+ */
67
+ transactionId: string, transactionalDataLoaderMode: TransactionalDataLoaderMode);
49
68
  /**
50
69
  * Schedule a pre-commit callback. These will be run within the transaction right before it is
51
70
  * committed, and will be run in the order specified. Ordering of callbacks scheduled with the
@@ -67,9 +86,16 @@ export declare class EntityTransactionalQueryContext extends EntityQueryContext
67
86
  * @param callback - callback to schedule
68
87
  */
69
88
  appendPostCommitCallback(callback: PostCommitCallback): void;
89
+ /**
90
+ * @internal
91
+ */
70
92
  runPreCommitCallbacksAsync(): Promise<void>;
93
+ /**
94
+ * @internal
95
+ */
71
96
  runPostCommitCallbacksAsync(): Promise<void>;
72
- isInTransaction(): boolean;
97
+ isInTransaction(): this is EntityTransactionalQueryContext;
98
+ isInNestedTransaction(): this is EntityNestedTransactionalQueryContext;
73
99
  runInTransactionIfNotInTransactionAsync<T>(transactionScope: (queryContext: EntityTransactionalQueryContext) => Promise<T>, transactionConfig?: TransactionConfig): Promise<T>;
74
100
  runInNestedTransactionAsync<T>(transactionScope: (innerQueryContext: EntityTransactionalQueryContext) => Promise<T>): Promise<T>;
75
101
  }
@@ -82,12 +108,32 @@ export declare class EntityTransactionalQueryContext extends EntityQueryContext
82
108
  * successful commit of the nested transaction.
83
109
  */
84
110
  export declare class EntityNestedTransactionalQueryContext extends EntityTransactionalQueryContext {
85
- private readonly parentQueryContext;
111
+ /**
112
+ * @internal
113
+ */
114
+ readonly parentQueryContext: EntityTransactionalQueryContext;
86
115
  private readonly postCommitInvalidationCallbacksToTransfer;
87
116
  private readonly postCommitCallbacksToTransfer;
88
- constructor(queryInterface: any, parentQueryContext: EntityTransactionalQueryContext, entityQueryContextProvider: EntityQueryContextProvider);
117
+ constructor(queryInterface: any,
118
+ /**
119
+ * @internal
120
+ */
121
+ parentQueryContext: EntityTransactionalQueryContext, entityQueryContextProvider: EntityQueryContextProvider, transactionId: string, transactionalDataLoaderMode: TransactionalDataLoaderMode);
122
+ isInNestedTransaction(): this is EntityNestedTransactionalQueryContext;
89
123
  appendPostCommitCallback(callback: PostCommitCallback): void;
90
124
  appendPostCommitInvalidationCallback(callback: PostCommitCallback): void;
125
+ /**
126
+ * The behavior of callbacks for nested transactions are a bit different than for normal
127
+ * transactions.
128
+ * - Post-commit (non-invalidation) callbacks are run at the end of the outermost transaction
129
+ * since they often contain side-effects that only should run if the transaction doesn't roll back.
130
+ * The outermost transaction has the final say on the commit state of itself and all sub-transactions.
131
+ * - Invalidation callbacks are run at the end of both the nested transaction iteself but also transferred
132
+ * to the parent transaction to be run at the end of it (and recurse upwards, accumulating invalations).
133
+ * This is to ensure the dataloader cache is never stale no matter the DBMS transaction isolation
134
+ * semantics. See the note in `AuthorizationResultBasedBaseMutator` for more details.
135
+ *
136
+ * @internal
137
+ */
91
138
  runPostCommitCallbacksAsync(): Promise<void>;
92
- transferPostCommitCallbacksToParent(): void;
93
139
  }