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

Add userpresence #68

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft

Add userpresence #68

wants to merge 19 commits into from

Conversation

marcduiker
Copy link
Contributor

@marcduiker marcduiker commented Feb 18, 2022

Description

This feature introduces the back-end implementation for a online/offline indicator for a user profile.

  1. UserPresenceService publishes a UserPresenceMessage message to the user-presence-<userId> Ably channel.
  2. A Reactor event is configured that triggers on user-presence-* channels and calls the api/presence-update function.
  3. The api/presence-update HTTPTrigger function:
    • Updates the User profile (via UserService).
    • Gets the channels the user is part of (via ChannelService).
    • Updates the onlineCount for the relevant channels.
  4. The event-integrations/presence-publish TimerTrigger function:
    • Get's all the channels
    • Publishes a ChannelPresenceMessage[] to the utility-channel Ably channel.

I duplicated some code from api/common to event-integrations/common since the latter now reads from CosmosDB.

Not done yet:

  • Call UserPresenceService when users logs on/off.
  • Adding all users to the utility-channel, subscribing to the channel-presence messages and handling the receiving these messages (updating the UI).

PR Checklist

Please use this checklist to track the completeness of your PR. We're always happy to assist you in completing these steps!

  • No linting errors/warnings are introduced.
  • Unit tests are all passing.
  • The feature/fix has been tested locally.
  • The feature/fix satisfies the acceptance criteria described in issue: #.

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gentle-dune-0fec87f03-68.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gentle-dune-0fec87f03-68.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gentle-dune-0fec87f03-68.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gentle-dune-0fec87f03-68.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gentle-dune-0fec87f03-68.westeurope.azurestaticapps.net

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gentle-dune-0fec87f03-68.westeurope.azurestaticapps.net

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

Successfully merging this pull request may close these issues.

1 participant