[trees][wip] Async loading / Batched loading#533
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 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".
| this.#unsubscribe?.(); | ||
| this.#store = nextStore; | ||
| if (this.#loading?.mode === 'bulk' && !this.#bulkPublishingCheckpoint) { |
There was a problem hiding this comment.
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 👍 / 👎.
| public destroy(): void { | ||
| this.#unsubscribe?.(); | ||
| this.#unsubscribe = null; | ||
| new Set(this.#revealInflightByPath.values()).forEach((request) => { | ||
| request.abortController.abort(); | ||
| }); | ||
| this.#bulkIngestListeners.clear(); |
There was a problem hiding this comment.
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 👍 / 👎.
48fd457 to
7a144b5
Compare
7a144b5 to
6ca8431
Compare
b0f3a0d to
2377929
Compare
CleanShot.2026-04-19.at.01.27.20.mp4