Skip to content

fix: Make Active Member Count Dynamic in Group Chats #37

@JustinhSE

Description

@JustinhSE

Overview

The current implementation sets the number of active members in group chats to a static value of 5. To enhance accuracy and reflect real-time activity, this count should be dynamically determined based on how many group members have logged in within the last hour. This will be achieved by utilizing the existing user schema in Firebase, specifically the lastCheckIn timestamp field.

To-Do

  • Use the lastCheckIn field in each user's document to track their most recent login time.
  • On user login, update the lastCheckIn field in their user document to the current server timestamp.
  • For each group chat, retrieve the list of member user IDs.
  • For each member, fetch their lastCheckIn timestamp from the database.
  • Count the number of members whose lastCheckIn timestamp is within the past hour.
  • Display this dynamic count as the active member count in the group chat UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions