Cloud code set max network retries

In the iOS SDK you can configure the number of times operations are retried when network issues are encountered…

let config = ParseClientConfiguration {
    $0.applicationId = "xxx"
    $0.clientKey = "xxx"
    $0.server = "xxx"
    $0.networkRetryAttempts = 3
}

I’d like to do the same thing in my cloud code so that if operations within functions fail (due to network problems) they will be retried. Is it possible to do so?

I did a cmd-f on the JavaScript API reference but couldn’t find anything about this…

I’d also be interested to know how Parse Server handles idempotency with regard to network retries, if anyone is knowledgable about that?

As long as I know there is no such option in the JavaScript SDK and Parse Server does not have any mechanism to handle idempotency with regard to network retries. Each attempt will be handled as an independent API call. It is also important to notice that, when you use the Parse SDK within a cloud code function, the API calls does not go to the network again. They are routed directly to the Parse Server handlers (it still can fail due to network problem between Parse Server and DB).

That’s all really useful information, thanks!

I think indempotency would be a great feature for Parse Server especially if it worked easily out of the box like with the Stripe API. Most of the Stripe SDKs / client libraries assign idempotency keys to appropriate requests automatically when the max network retries are configured.

I’ll create a feature request to see if people are interested in this.

1 Like