Skip to content

Possible to retry gapi.load() after network error? #510

Open
@outoftime

Description

@outoftime

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 by gapi.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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions