LearnNewsExamplesServices
Frontmatter
id8804
titleHarden Store.load against async destruction
stateClosed
labels
enhancementaicore
assigneestobiu
createdAtJan 19, 2026, 11:58 AM
updatedAtJan 19, 2026, 12:01 PM
githubUrlhttps://github.com/neomjs/neo/issues/8804
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 19, 2026, 12:01 PM

Harden Store.load against async destruction

Closed v11.23.0 enhancementaicore
tobiu
tobiu commented on Jan 19, 2026, 11:58 AM

Update src/data/Store.mjs to use this.trap() around asynchronous data fetching operations (RPC calls, Neo.Xhr, and fs.readFile).

This ensures that if the Store is destroyed while a request is pending, the promise will be rejected with Neo.isDestroyed (which is globally suppressed), preventing execution of subsequent logic like me.data = ... on a destroyed instance.

tobiu added the enhancement label on Jan 19, 2026, 11:58 AM
tobiu added the ai label on Jan 19, 2026, 11:58 AM
tobiu added the core label on Jan 19, 2026, 11:58 AM
tobiu referenced in commit 1682bb4 - "feat: Harden Store.load against async destruction (#8804)" on Jan 19, 2026, 12:00 PM
tobiu assigned to @tobiu on Jan 19, 2026, 12:00 PM
tobiu
tobiu Jan 19, 2026, 12:01 PM

Input from Gemini 3 Pro:

✦ I have hardened src/data/Store.mjs against async destruction.

Changes:

  • Updated load() to use me.trap() around service[fn](params), readFile, and Neo.Xhr.promiseJson.
  • Updated the catch block to re-throw Neo.isDestroyed errors, ensuring the global rejection handler suppresses them while preventing subsequent logic execution in the Store.

This prevents errors when a Store is destroyed while a data load operation is pending.

tobiu closed this issue on Jan 19, 2026, 12:01 PM