Open
Description
Originally reported by @AlmirKadric
When a session is lost we're not resetting the current message ids and message list on the client. This is a problem as the backend will begin counting at 1 again. So all messages from 1 to current counter will be ignored and then start processing after the current message.
Although generally we restart the client when we lose a session, we should still handle this for any use cases we may have.
Something we already agreed on with the C# client
// Start transport client when session is acquired
mage.eventManager.on ("session.set", (object sender, JObject session) => {
_sessionKey = UnityEngine.WWW.EscapeURL(session["key"].ToString());
transportClient.start();
});
// Stop the message client when session is lost
mage.eventManager.on ("session.unset", (object sender, JObject session) => {
transportClient.stop();
currentMessageId = -1;
largestMessageId = -1;
messageQueue = new Dictionary<int, JToken>();
confirmIds = new List<string>();
_sessionKey = null;
});
Metadata
Metadata
Assignees
Labels
No labels