question

plourdegui avatar image
plourdegui asked

How to guard against a CloudScript successfully executing but never returning to client?

What is the best practice to guard against a CloudScript successfully executing but never returning to client?

The scenario I'm wondering about is:

The CS is successfully invoked and executed but the player's network drops in-between; before the http call returns from the server.

In my case, I would need to disconnect the player from its game session so he logs back in with latest data taken from the server.

However, I don't know how to "simulate" this kind of scenario.

Is it possible to introduce some "sleep" function in a CS to force a 5 sec timeout so I have time to manually disconnect my network?

Has any article ever been written regarding Cloud Script error management best practices?

apisCloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
pfnathan avatar image
pfnathan answered

Your scenario would be best to test with a client-side mock of the API call. We currently don't have support for a forced connection close from CloudScript.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.