Description
Hello,
I use gapi
in an application that is typically used in poor/unreliable network conditions. As a rule, all network requests from the client side are made with substantial retry logic to help mitigate failed requests. However, I can't seem to get retries to work properly for the gapi.load()
method: if I call it again after a network failure, the actual network request is not retried.
For a reduction, please see this codepen, and try the following:
- In the Chrome developer tools, in the Request Blocking tab, add a block for the pattern
gapi.loaded
. This will block the requests made bygapi.load()
- Reload the page (or load the debug view) with the console and network log open in developer tools
- Observe that, while the
setupGapi()
method is called once per second, the actual network requests are not repeated - With the page still open, disable request blocking
- Observe that, even with fully operational network conditions, the call to
gapi.load()
does not succeed
So, my question is: is it possible to effectively retry gapi.load()
in this scenario? I imagine gapi
has some sort of internal state that is set before making the network request, that is not cleared on failure, but I don't see anything documented for the public API of the SDK.
Thanks in advance!