You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mapping services (both forward and reverse) fan out as concurrent tasks assuming loads complete synchronously, which was true before lazy loading, but is now false—so awaits expose concurrency races, nondeterministic ordering, and cases where checks silently force full eager loads, which defeats the point of the lazy-loading entirely.
Steps
Fix where lazy loading is being silently negated (e.g., eager evaluation of getters, un-awaited fills of extended attributes)
Concurrency safety (e.g., locking resolution of association, infinite-loop detection, guarding modification of shared lists)
Deterministic collection ordering (replacing completion-order with source-order)
ReverseTopicMappingService:
Fix a data-integrity bug where clearing relationships doesn't purge deferred entries, so deletions get silently resurrected
Sequentializing its fan-out to avoid concurrent writes to the same collections on the target Topic
EnsureLoaded() for AsAttributeDictionary() (03ed27c) with unit tests (51d0f4e, faf3639)
Ensure metadata lookup items are loaded on mapping (b88d436)
Defer GetContentTypeDescriptors() to first use, instead of eagerly loading the entire Root:Configuration tree in the constructor (4857676)
Ensure target topic is fully loaded in ReverseTopicMappingService.MapAsync(), so unchanged extended attributes aren't marked dirty (f0c65ea) with unit tests (59a8b85, f235508)
Concurrency safety (e.g., locking resolution of association, infinite-loop detection, guarding modification of shared lists)
Introduced MapPath class to detect circular vs. sibling references (b42673a) wired into the MapAsync() chain (61b1487), with unit tests (a64b1f8, dbb4798, dc88d41, 4a67bab)
Added "completion semantics" to mapped cache entries (7a5bd2c) with unit tests (28f0b07):
Activity
CachedTopicRepository#111TopicPayloadas part ofMapAsync()#133Merge pull request #144 from `improvement/lazy-loading/mapping`
Merge pull request #145 from OnTopicCMS/feature/ITopicRepository-lazy…
JeremyCaney commentedon Aug 9, 2026
Merged with 3acee3b:
GetSourceCollectionAsync()(7777ed1) with unit tests to confirm load order (6e064a1)EnsureLoaded()is awaited (d4b4020)EnsureLoaded()forAsAttributeDictionary()(03ed27c) with unit tests (51d0f4e, faf3639)GetContentTypeDescriptors()to first use, instead of eagerly loading the entireRoot:Configurationtree in the constructor (4857676)ReverseTopicMappingService.MapAsync(), so unchanged extended attributes aren't marked dirty (f0c65ea) with unit tests (59a8b85, f235508)MapPathclass to detect circular vs. sibling references (b42673a) wired into theMapAsync()chain (61b1487), with unit tests (a64b1f8, dbb4798, dc88d41, 4a67bab)TryGetValue(…, includeInitializing)(5a6b8a9)Complete()inRegister()(ee9a9a5)Fault()inMapAsync()(b197889)resolveCachedEntry()(1334a2b)AddMissingAssociations()concurrent (0f51264), applied to caller (a971aeb), with unit tests (bc73f87)RendezvousTopicLazyLoader(f6a85a2)StaggeredTopicLazyLoader(3359853)CreateGatedMappingService()helper (91d0a21)WhenAll()overWhenAny()to honor sibling source order (c5f191b) with unit tests (1a631ab)WhenAll(IEnumerable)(487ecf2)ReverseTopicMappingService:DeferredinTopic.Relationships.Clear()(3a16836) with unit tests (e308bc5, 7d5cad0)TopicPopulateTargetCollectionAsync()(c6e644d) with unit tests (23f4adf), using new test doubles:StaggeredStubTopicRepository(277edab)NestedReferenceAttributeTopicBindingModel(909121d)[Include]calls (a preexisting bug) (f287c1d) with unit tests (ec102ab, 49a6048)