Skip to content

Allow specifying depth of ITopicRepository.Load() #120

Closed

Description

@JeremyCaney

Replace the isRecursive: bool parameter on ITopicRepository.Load() with depth: int, because hierarchical navigation (e.g., rendering a navigation menu from a root several tiers deep) needs precise control over how much of the tree to pull. A full recursive load of the root would force the whole graph to load, defeating the purpose of lazy loading, so the goal is load exactly the region of the graph needed.

Tasks

  • C# API (depth replaces isRecursive across Load() and IsLoaded() stub modeling, tests)
  • SQL @Depth parameter on LoadTopics stored procedure w/ recursive CTE
    • This replaces existing @LoadDescendants and @LoadChildren parameters
  • Allow CachedTopicRepository's existing "sufficiency gate" (i.e., ConvergeLoadState() to be depth-aware
  • Sequentialize the HierarchicalTopicMappingService child crawl
    • This fixes the nondeterministic menu ordering and unsynchronized modification of the graph
  • Make IsVisible()'s IsHidden and IsDisabled checks non-autoloading
    • These currently trigger unnecessary loading of ExtendedAttributes and references tree traversal

Activity

  1. added this to the OnTopic 6.0.0 milestone on Jul 25, 2026
  2. self-assigned this
    on Jul 25, 2026
  3. added
    Type: BugBehavior that is inconsistent with documented or expected behavior.
    Area: RepositoriesRelates to the `ITopicRepository` interface or one of its implementations.
    Type: ImprovementImproves the functionality or interface of an existing feature.
    on Jul 25, 2026
  4. added theissue type on Jul 25, 2026
  5. added a commit that references this issue on Aug 7, 2026
  6. JeremyCaney commented on Aug 8, 2026

    @JeremyCaney
    MemberAuthor
    • C# API (depth replaces isRecursive across Load() and IsLoaded() stub modeling, tests)
      • Updated Load() to take depth not isRecursive (f09a43a)
      • Updated IsLoaded() to take depth (d370604)
      • Added Depth to TopicLoadEventArgs (28a9431)
      • Update the test stub to support Load(…, depth) (5f1a815)
      • Update remaining stubs to support Load(…, depth) (33e36c4)
      • Pre-normalize key in calls to Load(uniqueKey, …) (ca8bb8f)
      • Added unit tests for testing depth > 1 (88160a4, 24aba97)
    • SQL @Depth parameter on LoadTopics stored procedure w/ recursive CTE
      • This replaces existing @LoadDescendants and @LoadChildren parameters
      • Add @Depth parameter to GetTopics sproc (d2c405e)
      • Added a new index for ParentID (ce39fa1)
    • Allow CachedTopicRepository's existing "sufficiency gate" (i.e., ConvergeLoadState() to be depth-aware
      • Implemented gate is ITopicLazyLoadable.IsLoaded(payload, depth)
      • Updated Load() to take depth instead of isRecursive (f09a43a)
      • Updated IsLoaded() to take depth (d370604)
    • Sequentialize the HierarchicalTopicMappingService child crawl
      • Removed task queue for hierarchical mapping (1879ce8)
      • Preload the hierarchy before mapping (c223699)
      • Added unit tests for tiered hierarchical load (8fe46dc)
    • Make IsVisible()'s IsHidden and IsDisabled checks non-autoloading
      • Add unit tests for loading boolean values, confirming IsVisible and IsHidden don't trigger autoload (36f6b5f)
      • Add unit test for auto-loading BaseTopic (a13cf8a)
      • Underlying autoLoad and GetBoolean() was preiously implemented (aecee85, 42495b9, f94932d)
    • Cleanup: Remove legacy earmark (6caac08)
  7. added
    Status 5: CompleteTask is considered complete, and ready for deployment.
    and removed on Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: RepositoriesRelates to the `ITopicRepository` interface or one of its implementations.Priority: 2Severity 2: MajorStatus 5: CompleteTask is considered complete, and ready for deployment.Type: BugBehavior that is inconsistent with documented or expected behavior.Type: ImprovementImproves the functionality or interface of an existing feature.

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions