Stop reporting gateway errors as CLI crashes - #8329
Open
isaacroldan wants to merge 1 commit into
Open
Conversation
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationspackages/cli-kit/dist/private/node/api/gateway-status.d.ts/**
* Pure helpers for classifying HTTP statuses that come from the gateway in front of an API rather
* than from the API itself.
*
* This module is intentionally dependency-free: it is imported by both the request layer
* (`../api.ts`) and the crash-report suppression logic (`../../public/node/error.ts`).
* `error.ts` cannot import `../api.ts` directly — that would pull `graphql-request` into the
* module graph of every command, and `api.ts → headers.ts → error.ts` is already a cycle — so the
* shared status logic lives here, where it imports nothing from cli-kit.
*/
/**
* Whether an HTTP status indicates a gateway-level failure in front of the API.
*
* @param status - The HTTP status of the response, if known.
* @returns True when the status is 502, 503 or 504.
*/
export declare function isGatewayErrorStatus(status: number | undefined): boolean;
Existing type declarationspackages/cli-kit/dist/private/node/api.d.ts@@ -12,6 +12,7 @@ export type NetworkRetryBehaviour = {
type RequestOptions<T> = {
request: () => Promise<T>;
url: string;
+ requestIsIdempotent?: boolean;
} & NetworkRetryBehaviour;
/**
* Checks if an error is a transient network error that is likely to recover with retries.
|
isaacroldan
marked this pull request as ready for review
August 14, 2026 10:20
Assisted-By: devx/cfa7efa4-831b-4142-a418-5480cf27ac8c
isaacroldan
force-pushed
the
fix-500-reports
branch
from
August 14, 2026 10:21
6163b9c to
c2e3f30
Compare
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.
Raw
graphql-requestClientErrorobjects can reach the top-level reporter when a call site useshandleErrors: false. For HTTP 502, 503, and 504, that records an infrastructure failure as an unexpected CLI bug.Classify these gateway statuses as expected in
shouldReportErrorAsUnexpected, consistent with the handled path that maps 5xx responses toAbortError. HTTP 500 keeps its existing classification.Testing
pnpm --filter @shopify/cli-kit vitest run src/public/node/error.test.tspnpm --filter @shopify/cli-kit type-check