Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Post data: Fetch waits until data is transferred?

ANSWERED

Hey everyone,

 

Posting data using the Fetch API in the companion app requires an internet connection
However, what happens with the data when such internet connection is not provided?

 

Does the Fetch API buffer all the post requests until a stable connection is available?
Or will all requests be lost (because internal storage is not provided inside the companion app itself)?

 

Best,

Bram

Best Answer
1 BEST ANSWER

Accepted Solutions
Best Answer
0 Votes
4 REPLIES 4

I believe that fetch() will just fail if there isn't an active internet connection. You'll need to handle that in your companion code.

Best Answer
0 Votes

Ah ok,

 

But what are the possibilities to handle such failures?

From other posts, I've concluded that it is not possible to store intermediate data in the companion app... When a post request (with e.g. data from the ionic) fails, then this data will be lost forever?

Best Answer
0 Votes
Best Answer
0 Votes

Thanks for the info!

I will provide my own fallback mechanisms when fetching the data using this internal storage as buffer.

Best Answer
0 Votes