Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no presence.enter event when the first user enters #6

Open
ossandust opened this issue Feb 14, 2021 · 1 comment
Open

no presence.enter event when the first user enters #6

ossandust opened this issue Feb 14, 2021 · 1 comment

Comments

@ossandust
Copy link

(Probably also the cause for issue #3 "Room is not created")
How to reproduce (possibly only occurs after a long time of inactivity) :
on https://quiz.ably.dev/ , click "host a randomly chosen quiz", "create my quiz room".
The button caption changes to "creating your quiz room" and remains disabled forever.
Solution :
Refresh the browser window (Ctrl-R) and do the same. This time the quiz room is created.

After having added the necessary logging, it is clear that the server is correctly subscribed to the presence.enter event of channel 'main-quiz-thread', the client correctly calls presence.enter on this channel (CreateQuizRoom.vue enterMainThread()), but the listener at the server side is never called.
"Solved" by calling .leave() and .enter() again at the client side. After doing so the worker thread is correctly created and the player link is generated.

Not being able to rely on the 'presence.enter' subscription requires a lot of overhead code, adding failure checks and retries, making sure to unsubscribe earlier subscriptions again in order to avoid receiving messages twice, etc.

Not sure but this issue might be related to issue #4 , as the serverside subscription to presence.enter happens only once at server startup, while the client may enter hours later. If this would silently fail due to re-authentication failure, it would explain why only the very first enter event is being missed and things work as expected after that.

@ossandust
Copy link
Author

You can ignore the last comment about re-authentication, it was just a wild guess which probably doesn't make much sense. The client is correctly authenticated when opening the homepage in the browser for the first time (= when the error occurs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant