Catching Operation Failed with SetCustomProperties with Check And Swap for Properties (CAS)

Options
I'm trying to use SetCustomProperties with Check And Swap for Properties (CAS) to avoid race conditions (concurrency problems).

It seems to work great (that is properties only update when they should).

However, I cannot see how to handle the CAS update failed situation - that is be notified so I can act on the failure (show in the console). Where do I implement an OnOperationFailed, method or similar? Or do I need to somehow use the webForward hook to get this?

Or am I supposed to simply wait a second or so and check if the update was successful on the cached values?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @drdavient,

    Thank you for choosing Photon!
    You do raise a good point.
    What you can do for the time being:
    Patch PUN code to detect OpSetProperties failure response. You may want to cache the operation params in case of CAS to know which call failed exactly or compare with cached local properties.

    We are discussing if a new callback is needed thank to you. :smile:
  • drdavient
    Options
    Thanks @JohnTube

    Glad I wasn't missing something. I've patched in a static event in Networking Peer that can be used for now. Though since I'm also caching the local properties it seems I can get the information this way too.

    cheers