LearnNewsExamplesServices
Frontmatter
id9416
titleAdd Error State & Events for Async Tree Loading
stateClosed
labels
enhancementdeveloper-experienceaicore
assigneestobiu
createdAtMar 9, 2026, 3:46 PM
updatedAtMar 9, 2026, 3:51 PM
githubUrlhttps://github.com/neomjs/neo/issues/9416
authortobiu
commentsCount2
parentIssue9404
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 9, 2026, 3:51 PM

Add Error State & Events for Async Tree Loading

Closed v12.1.0 enhancementdeveloper-experienceaicore
tobiu
tobiu commented on Mar 9, 2026, 3:46 PM

Goal

Enhance the TreeStore and TreeModel to formally communicate network failures during asynchronous subtree expansion, providing both visual state hooks and application-level events.

Architecture

  1. TreeModel Update:
    • Add hasError: Boolean (defaultValue: false) to track nodes that failed to load their children.
  2. TreeStore Update (expand() method):
    • When an async load() fails (catch block):
      • Set node.isLoading = false and node.hasError = true.
      • Fire recordChange to update the Grid UI (e.g., render a warning icon).
      • Fire a custom Store event: me.fire('loadError', { record: node, error: err }). This allows ViewControllers to catch the error and show a Toast notification.
    • When expand() is called on a node that already has hasError = true (user retrying):
      • Clear the error state (node.hasError = false) before attempting the fetch again.

Dependencies

  • Depends on the core TreeStore async implementation (#9413).
tobiu added the enhancement label on Mar 9, 2026, 3:46 PM
tobiu added the developer-experience label on Mar 9, 2026, 3:46 PM
tobiu added the ai label on Mar 9, 2026, 3:46 PM
tobiu added the core label on Mar 9, 2026, 3:46 PM
tobiu added parent issue #9404 on Mar 9, 2026, 3:47 PM
tobiu assigned to @tobiu on Mar 9, 2026, 3:48 PM
tobiu referenced in commit 1ce6de0 - "feat: Add Error State & Events for Async Tree Loading (#9416) on Mar 9, 2026, 3:50 PM
tobiu
tobiu Mar 9, 2026, 3:50 PM

Input from Gemini 3.1 Pro:

✦ Implemented Error State & Events for Async Tree Loading.

  • TreeModel now includes hasError (default false).
  • TreeStore.expand() sets hasError and fires a loadError event if the fetch fails, allowing graceful app-level recovery/notifications.
  • Added self-healing logic: re-clicking a failed node clears the error state and retries the fetch.

Changes pushed to dev.

tobiu
tobiu Mar 9, 2026, 3:51 PM

Implemented Error State for Async Tree Loading. Pushed to dev.

tobiu closed this issue on Mar 9, 2026, 3:51 PM