- Versions: Nakama{3.20.1, Docker, JS client
- Server Framework Runtime language: Go, TS/JS
Our game is updated frequently, and there are sometimes changes/initializations that we want to ensure after releasing a new version.
Therefore, my question is basically: Is it possible to “catch” a Session restore? Judging by the source code, restoring a session, even after a server reboot, doesn’t make any calls to the server unless it is expired (which makes sense)- however I would like to execute some possible initializations of metadata if needed. The most logical place to do this seems to be in the after authenticate *
hooks. But, naturally, these are not called when a session is restored.
Some of the possible solutions could be:
- Use an RPC to execute an initialization after authentication and/or session restoration from the frontend;
- Force log out everybody on the server after- or directly before rebooting and/or destroying any and all existing sessions to force a re-authentication;
- Execute the initialization checks before any RPCs and/or Matches that would need to use the metadata.
Before I implement any one of these, I would love to hear if there’s possibly a better solution that I’m not seeing or I can’t find in the documentation.
Thanks!