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

Initial users status not fetched #2663

Closed
zaphod534 opened this issue Nov 20, 2020 · 1 comment
Closed

Initial users status not fetched #2663

zaphod534 opened this issue Nov 20, 2020 · 1 comment

Comments

@zaphod534
Copy link
Contributor

zaphod534 commented Nov 20, 2020

Description:

On app fresh install, the users initial presence status is not fetched (all users are in offline state). On presence update all works as expected.

Environment Information:

  • Rocket.Chat Server Version: 3.8.0
  • Rocket.Chat App Version: 4.12.1
  • Device Name: iOS Simulator
  • OS Version: iOS 14.2

Steps to reproduce:

  1. Open app and connect to a server
  2. All users not have correct presence status

Expected behavior:

Users have the correct presence status immediately.

Actual behavior:

Users are in offline state on app start.

Additional context:

This used to work in 4.11.0. I noticed that the cause may be the RoomItem component (fetch and update initial presence status ware done with useEffect on connected variable which was triggered on component mount and on connected prop change).

useEffect(() => {
	if (connected && item.t === 'd' && id) {
		getUserPresence(id);
	}
}, [connected]);

Now you do this in componentDidUpdate, but to have the same behavior this should be done in componentDidMount too.

@djorkaeffalexandre
Copy link
Collaborator

Closed by #2664.

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

2 participants