Skip to content

Initial users status not fetched #2663

@zaphod534

Description

@zaphod534

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions