fix(utils): classify validation errors strictly over network substring heuristics - #1155
Open
MsfPablo wants to merge 1 commit into
Open
fix(utils): classify validation errors strictly over network substring heuristics#1155MsfPablo wants to merge 1 commit into
MsfPablo wants to merge 1 commit into
Conversation
…g heuristics createErrorInfo flagged a validation message containing "connection" or "fetch" as both a validation and a network error, because isNetworkError matched on loose .includes() substrings. Validation now takes strict precedence over the network/timeout substring checks. Closes Nano-Collective#1136.
MsfPablo
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
September 2, 2026 12:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createErrorInfomisclassified validation errors as network errors when the message happened to contain a network-sounding substring likeconnectionorfetch(#1136). TheisNetworkError/isTimeoutErrorhelpers match on loose.includes()substrings, so a message such as"validation failed for connection"was flagged as both a validation and a network error.Validation now takes strict precedence over the network/timeout substring heuristics: when an error is a validation error,
isNetworkErrorandisTimeoutErrorare forced tofalse. Real network errors (identified by errorcodesuch asECONNREFUSED/ETIMEDOUT, or messages without a validation cue) are unaffected.Behavior
validation failed for connectionfailed to fetch: connection refusedrequest failed+code: ETIMEDOUTTesting
pnpm run test:typesclean;error-formatter.spec.ts28/28 in isolation; biome clean.createErrorInfonetwork/timeout specs continue to pass.Closes #1136.