Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplify REST requests should not automatically retry on serverside errors #13093

Open
3 tasks done
severi opened this issue Mar 6, 2024 · 7 comments
Open
3 tasks done
Assignees
Labels
API Related to REST API issues feature-request Request a new feature Gen 2 Issues related to Gen 2 Amplify projects GraphQL Related to GraphQL API issues pending-maintainer-response Issue is pending a response from the Amplify team.

Comments

@severi
Copy link

severi commented Mar 6, 2024

Before opening, please confirm:

JavaScript Framework

Not applicable

Amplify APIs

REST API

Amplify Version

v6

Amplify Categories

api

Backend

None

Environment information

# Put output below this line
not applicable

Describe the bug

Amplify should never automatically try to retry API requests if they fail on serverside errors (500, 502, 503, 504)

https://github.com/aws-amplify/amplify-js/blob/main/packages/core/src/clients/middleware/retry/defaultRetryDecider.ts#L26C4-L26C21

This behaviour is just plain wrong and should not exists OR at the very least should be possible to be disabled

Expected behavior

Api request fails once and is not retryed

Reproduction steps

server responds with error code 500, amplify post request automatically retries 2 times after the failed attempt

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

@severi severi added the pending-triage Issue is pending triage label Mar 6, 2024
@nadetastic nadetastic self-assigned this Mar 6, 2024
@chrisbonifacio chrisbonifacio self-assigned this Mar 7, 2024
@chrisbonifacio chrisbonifacio removed the pending-triage Issue is pending triage label Mar 7, 2024
@chrisbonifacio
Copy link
Member

Hi @severi Thank you for raising this issue.
We were able to reproduce the issue.

image

We'll bring this to the team's attention and see how we can address it, whether it be through changing the behavior or exposing a way to disable this behavior.

@chrisbonifacio chrisbonifacio added the feature-request Request a new feature label Mar 7, 2024
@nadetastic nadetastic removed their assignment Mar 7, 2024
@chrisbonifacio chrisbonifacio added API Related to REST API issues and removed API-REST labels Mar 21, 2024
@Philip-Bro
Copy link

any updates for this

@EricDAllen
Copy link

I'm picturing a badly-coded server that is starting to fail when it gets overloaded. Arbitrarily tripling the number of requests sent to it really doesn't seem helpful.

@metuuu
Copy link

metuuu commented Apr 25, 2024

I am using TanStack Query and would like to use its retrying system rather than amplify's.
Is it even possible currently to disable amplify api retrying completely?

@chris-xylem
Copy link

chris-xylem commented Jun 19, 2024

Checking to see if there has been an update on this bug?

@alexlilleyxylem
Copy link

I see there was a PR opened a couple weeks ago. Any updates/movement on that?

@chrisbonifacio chrisbonifacio added GraphQL Related to GraphQL API issues Gen 2 Issues related to Gen 2 Amplify projects labels Aug 14, 2024
@chris-xylem
Copy link

chris-xylem commented Oct 24, 2024

Any update on this issue? I see a PR for this issue has been open for 3 months now: #13641

@github-actions github-actions bot added the pending-maintainer-response Issue is pending a response from the Amplify team. label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Related to REST API issues feature-request Request a new feature Gen 2 Issues related to Gen 2 Amplify projects GraphQL Related to GraphQL API issues pending-maintainer-response Issue is pending a response from the Amplify team.
Projects
None yet
Development

No branches or pull requests

8 participants