Atomic status update

Hello,

Having status being sent automatically to subscribers gives an opportunity to share with the followers the match the user is currently in. So originally I updated status in MatchJoin with the current room, and removed it in MatchLeave.

As it appeared, the client is designed the way where it concurrently enters new room while leaving the current one. As status update is not atomic, read-update-write routines get interleaved and the status ends up wrong.

What is the expected StreamUserUpdate usage? Can it be synchronized in any way? Should I request a new feature on GitHub for an API like StreamUserUpdateIfEqual?

Thanks!

  1. Versions: Nakama 3.5.9, Linux binary
  2. Server Framework Runtime language: Go

Hi @f1avalanche, can you post code samples demonstrating this?

As it appeared, the client is designed the way where it concurrently enters new room while leaving the current one. As status update is not atomic, read-update-write routines get interleaved and the status ends up wrong.

Do I understand correctly that there are different processes for a Join and a Leave and you can’t sync them?