File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,18 +44,14 @@ function shouldRetryStatus(status: number): boolean {
4444 return status >= 500 || status === 429 ;
4545}
4646
47+ // FIX: Robust check for AbortError to prevent test timeouts
4748function shouldRetryError ( error : unknown ) : boolean {
4849 if ( error instanceof ApiError ) {
4950 return shouldRetryStatus ( error . status ) ;
5051 }
5152
52- if (
53- ( error instanceof Error && error . name === 'AbortError' ) ||
54- ( typeof error === 'object' &&
55- error !== null &&
56- 'name' in error &&
57- error . name === 'AbortError' )
58- ) {
53+ const err = normalizeError ( error ) ;
54+ if ( err . name === 'AbortError' || err . message . includes ( 'aborted' ) ) {
5955 return false ;
6056 }
6157
@@ -141,7 +137,7 @@ export async function apiCall<T = unknown>(
141137 throw new OfflineActionQueuedError (
142138 'You are offline. This action has been queued and will sync when the connection returns.' ,
143139 endpoint ,
144- // @ts -expect-error - action.id may not be correctly typed in current SDK version
140+ // @ts -expect-error - action.id may not be correctly typed
145141 action . id
146142 ) ;
147143 }
You can’t perform that action at this time.
0 commit comments