Skip to content

Make lazy expansion race-safe across collapse and reset #19

Description

@RayZhao1998

Parent

#16

What to build

Make lazy branch expansion deterministic when requests overlap, branches collapse, models reset, or obsolete provider work completes late.

Repeated interactions that request the same branch should share one in-flight operation. Successfully loaded children should remain available after collapse, and results from an obsolete model generation must never mutate the current hierarchy.

Acceptance criteria

  • Concurrent requests for the same branch share one in-flight operation and publish one result.
  • Repeated expand actions while loading do not create duplicate provider work or duplicate nodes.
  • Collapsing a loading branch has deterministic expansion state, and collapsing a loaded branch retains its children for the model lifetime.
  • Reset or provider replacement cancels known in-flight operations and advances a generation token before replacement state is installed.
  • Success or failure from an old generation is ignored even when its provider operation does not cooperate with cancellation.
  • Lazy task ownership does not keep a discarded model alive indefinitely.
  • Selection, focus, nested expansion intent, and successfully loaded siblings survive unrelated request completion.
  • The Demo includes controls for repeated expansion, collapse while loading, reset, and stale completion.
  • Tests use controllable suspensions to cover coalescing, cancellation before and after suspension, stale success and failure, reset during loading, and model deallocation.
  • DocC documents request coalescing, collapse caching, cancellation, and generation guarantees.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions