Open wreiske opened 3 years ago
Same problem here.
Same problem here. My status appears offline, when I am present. Refreshing/reloading the Windows client doesn't help.
For some reason internally it thinks that you're online, so it does not do the transition online-online. If you select busy or away it changes correctly and after is possible to select back to online.
Happens also on https://open.rocket.chat .
It looks like a synchronization problem, as the user status (and statusConnection) in the db is correct. After some investigation, I noticed that the client fetches user information on startup, but by that time the user has not yet been updated on the server.
By adding a delay here the problem seems to no longer occur.
Getting user's data in Accounts.onLogin
callback seems to solve the issue. @g-thome do you think this is an acceptable solution?
diff --git a/client/startup/startup.ts b/client/startup/startup.ts
index d226716c0..d05e635bc 100644
--- a/client/startup/startup.ts
+++ b/client/startup/startup.ts
@@ -37,7 +37,7 @@ Meteor.startup(() => {
window.lastMessageWindowHistory = {};
let status: UserStatus | undefined = undefined;
- Tracker.autorun(async () => {
+ Accounts.onLogin(async () => {
const uid = Meteor.userId();
if (!uid) {
return;
Description:
The user's status stays "offline" and can't be changed to "online" after the internet connection is interrupted. This can be due to a VPN dropping, the internet going out, bad WIFI, etc....
When the internet comes back and the user reloads the page, their status shows as "offline" and can't be changed to "online" without first setting it to away and then back to online.
Steps to reproduce:
Visit open.rocket.chat
Open DevTools
Go to the Network tab and set the network state to "offline." This effectively emulates what happens when the internet goes out.
Wait a few moments, maybe a minute just to be sure, and then click around into another channel. You'll see an "undefined" error here and the channel will fail to load.
Realize "oh, my Wi-Fi disconnected" or "Oh! My VPN Dropped!" and reconnect. In this example, we'll just set the network state back to "Online"
Now that you're reconnected, hit View -> Reload.
Your status is now stuck "Offline"
Expected behavior:
After reloading, the status should be Online!
Actual behavior:
See step 7 above.
Server Setup Information:
Client Setup Information