Skip to content

fix aborts returning 'missing' data and standardize to AbortSignal#17

Merged
Shane98c merged 2 commits intomainfrom
Shane98c/abort-request-propagation
Apr 25, 2026
Merged

fix aborts returning 'missing' data and standardize to AbortSignal#17
Shane98c merged 2 commits intomainfrom
Shane98c/abort-request-propagation

Conversation

@Shane98c
Copy link
Copy Markdown
Collaborator

Fixes aborted reads being reported as missing data.

Refactors to standard AbortSignal instead of custom AbortError class.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the abort handling logic by replacing the custom AbortError class with a utility function isAbortError and adopting native AbortSignal.throwIfAborted() calls. A significant change is made in IcechunkStore to propagate aborts and network errors instead of swallowing them, which prevents downstream consumers from caching empty or invalid data as valid results. Feedback was provided regarding a potential TypeScript compilation error in the isAbortError utility where a type cast is recommended to safely access the name property on an unknown object.

Comment thread src/storage/storage.ts Outdated
typeof error === "object" &&
error !== null &&
"name" in error &&
error.name === "AbortError"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Accessing error.name on a variable of type unknown will trigger a TypeScript compilation error in strict mode, as the base object type does not define a name property. Even with the "name" in error check, the compiler typically requires an explicit cast or a more specific type to access the property.

Suggested change
error.name === "AbortError"
(error as { name: unknown }).name === "AbortError"

@Shane98c Shane98c merged commit 14f26f3 into main Apr 25, 2026
12 checks passed
@Shane98c Shane98c deleted the Shane98c/abort-request-propagation branch April 25, 2026 22:50
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