fix(VCST-4224): aborted mutations safari error notifications#2058
Merged
ivan-kalachikov merged 2 commits intodevfrom Nov 17, 2025
Merged
fix(VCST-4224): aborted mutations safari error notifications#2058ivan-kalachikov merged 2 commits intodevfrom
ivan-kalachikov merged 2 commits intodevfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where aborted GraphQL mutations in Safari were incorrectly triggering error notifications. The fix enhances the abort detection logic to handle Safari's specific implementation of AbortError.
- Enhanced abort error detection to recognize Safari's AbortError format by checking both the error name property and message string
- Refactored to extract abort message into a variable to avoid redundant
toString()calls
Comments suppressed due to low confidence (1)
client-app/core/api/graphql/utils.ts:39
- This critical error handling function lacks test coverage. Given that:
- Other utility functions in the codebase have comprehensive test coverage (e.g.,
core/utilities/,core/composables/) - This function handles important error routing logic that affects user experience
- This PR is specifically fixing a Safari-specific bug with AbortError detection
Consider adding tests to cover:
- The explicit abort reason check
- Safari's AbortError name property
- AbortError in the message string
- Regular network errors that should trigger ServerError.Unhandled
- GraphQL errors with different error codes
export function toServerError(
networkError: NetworkError | undefined,
graphQLErrors: ReadonlyArray<GraphQLFormattedError> | undefined,
): ServerError | undefined {
const abortMessage = networkError?.toString() ?? "";
const isExplicitlyAborted =
abortMessage.includes(AbortReason.Explicit) ||
abortMessage.includes("AbortError") ||
networkError?.name === "AbortError";
if ((networkError && !isExplicitlyAborted) || hasErrorCode(graphQLErrors, GraphQLErrorCode.Unhandled)) {
return ServerError.Unhandled;
}
if (hasErrorCode(graphQLErrors, GraphQLErrorCode.Unauthorized)) {
return ServerError.Unauthorized;
}
if (hasErrorCode(graphQLErrors, GraphQLErrorCode.Forbidden)) {
return ServerError.Forbidden;
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vas11yev1work
approved these changes
Nov 17, 2025
goldenmaya
approved these changes
Nov 17, 2025
|
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.



Description
References
Jira-link:
https://virtocommerce.atlassian.net/browse/VCST-4224
Artifact URL:
https://vc3prerelease.blob.core.windows.net/packages/vc-theme-b2b-vue-2.35.0-pr-2058-c300-c3001c63.zip