MutableRoom.mergeCustomProperties() needs Service?

So the question is - if I need to change some properties to the room by mergeCustomProperties, is this enough to just do this call, or I need to call Service() for the changes to have the effect?

Comments

  • Hi @ufnv.

    Yes, of course you need to call service() for property changes to take effect. The clients operation requests only get queued when you call an operation and queued operation requests only get out once sendOutgoingCommands() gets called (which can be done by your own code, but is also done by service()).
    The property change operations are no exception to this rule.

    As a rule of thumb: if an action is not entirely happening locally on the client that has triggered it, but needs to reach the server or other clients, then it won't take effect until it has been transferred by sendOutgoingCommands().

    If you use CAS, then the local client won't see the property change until dispatchIncomingCommands() has processed the servers response to the property change (take latency into account - the response will not be available for processing in the same frame in which the request has been sent out).

    Your code should call service() regularly (usually multiple times per second, i.e. every 100ms or every 50ms) anyway.