Skip to content

Conversation

@ricardogarim
Copy link
Contributor

@ricardogarim ricardogarim commented Mar 12, 2025

Currently, Rocket.Chat users can receive a daily digest of their Outlook Calendar events and get notifications for upcoming meetings. However, their presence status does not automatically sync with their scheduled meetings. This means that even if a user is in a meeting according to their calendar, their Rocket.Chat presence remains unchanged unless they manually update it.

This feature bridges that gap by automatically updating a user’s presence status in Rocket.Chat based on their scheduled calendar events. When a meeting starts, their status changes to “busy”, and when it ends, the presence reverts to the user’s previous status—unless manually changed by the user during the meeting.

Proposed changes (including videos or screenshots)

  • Presence status updates based on startTime and endTime from the calendarEvent entity.
  • Addition of endTime attribute in the calendarEvent entity.
  • New workspace setting Calendar_BusyStatus_Enabled to enable/disable calendar presence sync.

Issue(s)

Steps to test or reproduce

  1. Set Calendar_BusyStatus_Enabled setting to true.
  2. Login to Rocket.Chat workspace GUI to ensure the test user is online.
  3. Create a calendar event via API: Send a POST request to /api/v1/calendar-events.create with a random event that MUST contain the endTime attribute.
Create calendar event request example
curl --location 'http://localhost:3000/api/v1/calendar-events.create' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Referer: http://localhost:3000/admin/subscription' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-origin' \
--header 'Sec-GPC: 1' \
--header 'X-Auth-Token: xxxx' \
--header 'X-User-Id: rocketchat.internal.admin.test' \
--header 'Content-Type: application/json' \
--data '{
    "startTime": "2025-03-12T16:42:00.000Z",
    "endTime": "2025-03-12T16:43:00.000Z",
    "subject": "Subjectttt8",
    "description": "Descriptionnnn8",
    "reminderMinutesBeforeStart": 10
}'
Auth request example
curl --location 'http://localhost:3000/api/v1/login' \
--header 'Content-Type: application/json' \
--data '{
    "user": "rocketchat.internal.admin.test",
    "password": "rocketchat.internal.admin.test"
}'

Items to check

  • Wait for the event to start and verify that the user’s status changes to “busy”.
  • Wait for the event to end and ensure the presence status reverts to the user’s previous status.
  • Manually change the status during the event to something else (e.g., "away") and check that it does not revert when the event ends.
  • Create overlapping events and verify that the presence remains "busy" until the last overlapping event has ended.

Further comments

Out of scope:

  • No orchestration for competing presence status changes from other applications (e.g., a different calendar or presence service).
  • Presence will not change if a user joins a meeting early or stays beyond the scheduled time—status updates are strictly based on the shared event times.
  • No support for custom presence statuses (e.g., "In a meeting," "Do not disturb"). Only "busy" is set.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Mar 12, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 12, 2025

🦋 Changeset detected

Latest commit: d00460d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@rocket.chat/core-services Minor
@rocket.chat/rest-typings Minor
@rocket.chat/models Minor
@rocket.chat/meteor Minor
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/network-broker Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/api-client Patch
@rocket.chat/ddp-client Patch
@rocket.chat/ui-contexts Major
@rocket.chat/cron Patch
@rocket.chat/instance-status Patch
@rocket.chat/livechat Patch
@rocket.chat/mock-providers Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major
@rocket.chat/web-ui-registration Major
@rocket.chat/core-typings Minor
@rocket.chat/apps Patch
@rocket.chat/freeswitch Patch
@rocket.chat/model-typings Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-35474/

Built to branch gh-pages at 2025-03-20 22:01 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 84.41558% with 12 lines in your changes missing coverage. Please review.

Project coverage is 59.72%. Comparing base (05a23b4) to head (d00460d).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #35474      +/-   ##
===========================================
+ Coverage    59.66%   59.72%   +0.05%     
===========================================
  Files         2826     2830       +4     
  Lines        68266    68395     +129     
  Branches     15123    15168      +45     
===========================================
+ Hits         40732    40846     +114     
- Misses       24925    24932       +7     
- Partials      2609     2617       +8     
Flag Coverage Δ
unit 75.92% <84.41%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ricardogarim ricardogarim added this to the 7.5.0 milestone Mar 13, 2025
@ricardogarim ricardogarim marked this pull request as ready for review March 13, 2025 13:03
@ricardogarim ricardogarim requested review from a team as code owners March 13, 2025 13:03
@ricardogarim ricardogarim requested a review from a team as a code owner March 19, 2025 15:39
@ricardogarim ricardogarim force-pushed the feat/set-busy-status-on-calendar-appointments branch from 64d521c to f6de7b7 Compare March 19, 2025 15:56
gabriellsh
gabriellsh previously approved these changes Mar 20, 2025
@ricardogarim ricardogarim dismissed stale reviews from gabriellsh and MarcosSpessatto via 2655c48 March 20, 2025 14:19
@ricardogarim ricardogarim requested a review from gabriellsh March 20, 2025 16:43
@kodiakhq kodiakhq bot merged commit 6c7f9ea into develop Mar 20, 2025
48 checks passed
@kodiakhq kodiakhq bot deleted the feat/set-busy-status-on-calendar-appointments branch March 20, 2025 22:55
ggazzo pushed a commit that referenced this pull request Mar 21, 2025
Co-authored-by: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com>
Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com>
abhinavkrin pushed a commit that referenced this pull request Mar 24, 2025
Co-authored-by: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com>
Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com>
abhinavkrin pushed a commit that referenced this pull request Mar 24, 2025
Co-authored-by: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com>
Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants