aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.12k forks source link

Add timeout on GET and POST api calls #13426

Open jonats2020 opened 4 months ago

jonats2020 commented 4 months ago

Is this related to a new or existing framework?

React

Is this related to a new or existing API?

REST API

Is this related to another service?

No response

Describe the feature you'd like to request

Can't find a solid documentation regarding adding timeout for api calls on v6. My current task is to migrate from v5 to v6 and our api calls has timeout on them but it seems disregarded on v6. it has to be specific for each api call because there are some that really takes time

Describe the solution you'd like

add timeout on each API calls

Describe alternatives you've considered

might use axios if there aren't any way to add timeout for each api call

Additional context

No response

Is this something that you'd be interested in working on?

cwomack commented 4 months ago

Hey, @jonats2020 👋. Thanks for creating this issue as it is an undocumented parity issue from v5 to v6 when it comes to using Axios (which is no longer a third party dependency included in v6) to insert the timeout as an additional param in an AJAX call. While we don't plan on bringing back Axios as a third party dependency, we'll want to keep this open as a useful feature for v6 of Amplify and make up for that gap in migrating from v5.

Related #8458 and #6526.

jonats2020 commented 4 months ago

Hi @cwomack , thanks the response. May I know if there is a target date to when it will be added?

jpcammar commented 3 months ago

Hey @cwomack, I'm also curious about this issue's target date.

cwomack commented 3 months ago

@jonats2020 and @jpcammar, we don't have a concrete target date for this feature at this point. As we make progress or have any updates, we'll be sure to leave a comment here!

jpcammar commented 3 months ago

@jonats2020 and @jpcammar, we don't have a concrete target date for this feature at this point. As we make progress or have any updates, we'll be sure to leave a comment here!

Thank you @cwomack !