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
Login method returns UPDATE but no RESULT #11450
Comments
|
Perhaps you have a long running function on the server involving async code that never resolves. Have you tried removing any custom onLogin handlers you might have on the server? |
|
Hi! I'm one of the program coordinators of a nonprofit program called CodeDay Init, and we partner with colleges to help CS students make their first open-source contribution. We'll claim this issue for now and a group of students will be on it soon with mentorship! If this issue is no longer relevant, please let me know. |
|
Wow, that’s cool. Yes, this issue is still relevant. |
|
Hi @derwaldgeist, |
|
Hey @majumdarsr, Thanks for reaching out. Yes, we implemented our own DDP protocol, because we're using Unity as a client instead of a web app.
What exactly do you mean my that?
This is the original version from Greencoder: You should be able to reproduce the problem with this code. Our fork is here: https://github.com/derwaldgeist/unity3d-ddp-client But we haven't updated it for a while. The actual current implementation is not in this repo, since we patched it quite a bit in the meantime to care for other bugs, and this code is in a private repo. However, the issue at hand is not affected by these later changes. The issue should appear even in the Greencoder version. |
|
@derwaldgeist just to check have you tried it with more recent versions of Meteor, or are you still using 1.10? |
|
I am on 2.2.1 right now. |
|
Hi @derwaldgeist, #1: Login method with resume token - When app is put in background and back, Updated message is received but not the Result message. Expected behavior: Login with resume token returns Result message and Updated message. #2: Logout - When logout is called immediately before login, Meteor server will not aways remove the login token from the database. Expected behavior: Meteor server removes login token on logout. Clarifications:
Thank you for all your support! |
|
Hi @derwaldgeist, |
|
Thanks for the update. I never noticed the issue when testing with web app built with Meteor. It only occurs if you connect to the server via DDP directly, using the low-level protocol (in my case, inside a Unity client). |
|
Hi @derwaldgeist, Could you provide a Unity project that will reproduce this problem for us? |
|
Hi @derwaldgeist, if you can share some snapshots of your reported issue, that would be great too. |
|
Hi @derwaldgeist,
This issue is reproducible at a shorter timescale in every app built on meteor framework, browser based or otherwise. For ensuring a faster and seamless experience, the desired behavior of meteor is to ignore resume request (or “do nothing”) that arrived within 30 sec after effective websocket disconnect. Please check here. You have expectedly noticed this more often in unity as unity clients make 100 retries to keep the connection alive, before quitting. Please check here. Android OS is known to be more power intensive for their inefficient management of background apps. Please check here. Thus “effective websocket disconnect time” in android is much shorter than that appears to be. Hence your 1st issue, while valid, is a desired feature per meteor documentation.
This issue is more related to unity3d-DDP-Client and is not arising due to a bug in meteor. Logan and I are working to patch this issue. Best, |
|
Hi @derwaldgeist, |
|
It's been pretty cool to see this unfold! |
Our Unity app connects to a Meteor server via DDP, so we had to roll our own DDP protocol implementation, based on an old library by Greencoder. It works fine, but we are facing an odd behavior of the
loginmethod (with a resume token) if we re-connect the app after the user put it in the background and back (the WebSocket connection has to be re-established as well). In this case, quite often we only receive anUPDATEDmessage, but not theRESULTmessage confirming the login. This happens more often on Android than on iOS.We're wondering what the reason for this is and if there is a workaround? When experimenting with the setup, we noticed that it works more reliably if we logout explicitly immediately before logging in again. However, it's not 100% reliable, so it's not really a solution.
BTW: We also noticed that if we do call logout immediately before the login, the Meteor server won't always remove the login token from the database as it normally would. If we try the same in the regular Meteor frontend, the token will be removed reliably. The web frontend also never showed the problem that RESULT was not sent on login (we debugged this using the Meteor Dev Tools). We only see this odd behavior in our Unity app.
Meteor version: 1.10.2
The text was updated successfully, but these errors were encountered: