Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2c89edb54
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } catch (_error: unknown) { | ||
| if (response.ok) throw new Error("Invalid JSON response"); | ||
| return undefined; |
There was a problem hiding this comment.
Preserve abort errors in successful response parsing
If the timeout aborts after fetch() resolves but during response.text(), parseJsonResponse() will reject with an abort error; this catch block rewrites that into Invalid JSON response whenever response.ok is true. That masks timeouts from isAbortAfterTimeout() in request(), so these slow/stalled 200 responses are reported as JSON errors and are no longer retried as timeout failures.
Useful? React with 👍 / 👎.
c2c89ed to
63e4c3b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63e4c3b2f0
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } catch (_error: unknown) { | ||
| if (response.ok) throw new Error("Invalid JSON response"); | ||
| return undefined; |
There was a problem hiding this comment.
Preserve abort failures when parsing error responses
Do not swallow all parsing exceptions for non-2xx responses here: if the timeout abort fires after fetch() returns headers but during response.text(), this branch returns undefined and the caller rethrows an HTTP-status GraphQLTransportError instead of Request timed out. In that scenario, stalled 4xx responses are misreported as regular HTTP failures and skip timeout-based retry behavior.
Useful? React with 👍 / 👎.
What does this PR do?
Replaces the SDK-backed GraphQL raw request transport with native Node 22
fetchwhile preserving the publicGraphQLClientAPI and existing retry/error behavior.Closes #207
Type of change
Checklist
npm run check:cipasses (lint + format)npx tsc --noEmitpasses (type check)npm testpasses (unit tests)Testing
npm run check:cinpx tsc --noEmitnpm testnpm run buildNotes for reviewers
GraphQLClientnow uses nativefetchdirectly; resolvers and@linear/sdkremain unchanged for later staged migration work.tests/unit/client/graphql-client.test.ts.graphqlis now a direct pinned production dependency becauseprint(document)is used at runtime.