Skip to content

[trees][wip] Async loading / Batched loading#533

Open
SlexAxton wants to merge 13 commits intomainfrom
alex/trees/async
Open

[trees][wip] Async loading / Batched loading#533
SlexAxton wants to merge 13 commits intomainfrom
alex/trees/async

Conversation

@SlexAxton
Copy link
Copy Markdown
Contributor

CleanShot.2026-04-19.at.01.27.20.mp4

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Apr 22, 2026 5:59am
pierrejs-docs Ready Ready Preview Apr 22, 2026 5:59am

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1e7c23613

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1544 to +1546
this.#unsubscribe?.();
this.#store = nextStore;
if (this.#loading?.mode === 'bulk' && !this.#bulkPublishingCheckpoint) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Cancel in-flight reveal loads before replacing the store

Calling resetPaths() while reveal-mode requests are still running leaves #revealInflightByPath/#revealRunningBatches untouched, so stale requests survive the store swap. In that state, expanding the same directory in the new tree can be ignored because #startRevealExplicitLoad() sees an existing in-flight request, and late responses from the old tree can still drive load-state transitions against the new store. Reset should abort and clear reveal requests before this.#store is replaced.

Useful? React with 👍 / 👎.

Comment on lines 645 to +651
public destroy(): void {
this.#unsubscribe?.();
this.#unsubscribe = null;
new Set(this.#revealInflightByPath.values()).forEach((request) => {
request.abortController.abort();
});
this.#bulkIngestListeners.clear();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Abort active bulk ingest during controller teardown

In bulk mode, destroy() clears listeners and caches but never aborts #bulkIngestAbortController, so an ongoing ingest can continue after teardown. That keeps async session work alive and can still run checkpoint/reset logic on a supposedly-destroyed controller, which is a lifecycle leak for unmounted trees. Teardown should cancel the active ingest before clearing internal state.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant