Skip to content

fix: "Join" button on Outlook Calendar bubbles event up#39363

Open
gauravsingh001-cyber wants to merge 2 commits intoRocketChat:developfrom
gauravsingh001-cyber:fix/join-button-bubbling-clean
Open

fix: "Join" button on Outlook Calendar bubbles event up#39363
gauravsingh001-cyber wants to merge 2 commits intoRocketChat:developfrom
gauravsingh001-cyber:fix/join-button-bubbling-clean

Conversation

@gauravsingh001-cyber
Copy link

@gauravsingh001-cyber gauravsingh001-cyber commented Mar 5, 2026

Closes #39356

Issue

Clicking the "Join" button inside an Outlook calendar event item also triggered the parent container's onClick handler due to event bubbling.
As a result, when users clicked the Join button to open the meeting link, the event details modal was also opened unintentionally.

This caused an inconsistent and confusing user experience because the action of joining a meeting should not trigger the modal that displays event details.


Root Cause

The OutlookEventItem component wraps the event UI inside a clickable container (Box) that opens the event modal through handleOpenEvent.

The Join button was placed inside this container without preventing the click event from propagating to the parent component.

Therefore:

  • Clicking the Join button executed openCall()
  • The event also bubbled up to the parent Box
  • This triggered handleOpenEvent
  • The event modal opened unexpectedly

Solution

To prevent this unintended behavior, the click event propagation from the Join button was stopped using:

e.stopPropagation()

This ensures that clicking the Join button only performs its intended action (opening the meeting link) without triggering the parent click handler.


Code Changes

Updated the Join button click handler in:

apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventItem.tsx

Before

<Button onClick={openCall} small>
  {t('Join')}
</Button>

After

solution7.mp4

Testing Steps

  1. Start Rocket.Chat locally
  2. Open the Outlook Calendar panel
  3. Ensure there is at least one event with a meeting URL
  4. Click the event item
    → Event modal opens (expected behavior)
  5. Click the Join button
    → Meeting link opens
    → Event modal does NOT open

Result

  • Clicking the Join button now only opens the meeting link
  • The parent event modal is no longer triggered
  • User interaction behaves as expected

Additional Notes

This change only affects the event propagation behavior and does not modify any existing UI or logic outside of the button click handler.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed an issue in Outlook Calendar where clicking the Join button to start a meeting would also open the event details modal. The Join action now runs independently so users can join meetings without unintentionally opening event details.
  • Chores

    • Added a patch release changeset documenting the fix.

@gauravsingh001-cyber gauravsingh001-cyber requested review from a team as code owners March 5, 2026 09:33
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Mar 5, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 5, 2026

🦋 Changeset detected

Latest commit: 5b39757

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

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@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/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch 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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a2375bd9-920e-4ed4-8521-513be40e2ef4

📥 Commits

Reviewing files that changed from the base of the PR and between 1d78fce and 5b39757.

📒 Files selected for processing (1)
  • .changeset/tame-tables-complain.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/tame-tables-complain.md

Walkthrough

Adds a patch changeset and prevents the Outlook Calendar "Join" button's click from bubbling to its parent container by calling stopPropagation, so clicking Join no longer opens the event details modal.

Changes

Cohort / File(s) Summary
Changeset Documentation
​.changeset/tame-tables-complain.md
Adds a patch release changeset entry describing the fix for the Outlook Calendar Join button event bubbling.
Outlook Calendar Component
apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventItem.tsx
Wraps the Join button's onClick handler with stopPropagation before calling openCall, preventing the parent onClick from firing and opening the event modal.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main bug being fixed: the Join button's click event bubbling to the parent container in the Outlook Calendar component.
Linked Issues check ✅ Passed The code changes directly address the bug in issue #39356 by adding stopPropagation to the Join button's onClick handler, preventing event bubbling to the parent container.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the Outlook Calendar Join button event bubbling issue, with no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added type: bug community type: feature Pull requests that introduces new feature labels Mar 5, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/server/services/calendar/service.ts">

<violation number="1" location="apps/meteor/server/services/calendar/service.ts:115">
P2: Search uses untrimmed text after trimmed emptiness check, causing avoidable misses for inputs with surrounding whitespace.</violation>

<violation number="2" location="apps/meteor/server/services/calendar/service.ts:115">
P2: New subject search path queries by `uid` + `subject` regex without a supporting model index, risking collection scans as data grows.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/meteor/server/services/calendar/service.ts`:
- Around line 110-116: searchBySubject validates using text?.trim() but passes
the original raw text to CalendarEvent.findBySubject, so inputs with surrounding
or extra whitespace can miss matches; normalize the input first (e.g., const
normalized = text?.trim()) and use that normalized value for both the emptiness
check and the query call to CalendarEvent.findBySubject(uid, normalized)
(optionally also apply consistent casing like .toLowerCase() if your search
expects it).

In `@packages/models/src/models/CalendarEvent.ts`:
- Around line 50-57: Add the new public method findBySubject to the model
interface so callers typed against ICalendarEventModel see the contract; update
ICalendarEventModel to declare findBySubject(uid: IUser['_id'], text: string):
FindCursor<ICalendarEvent> and ensure the interface file imports the required
types (IUser, FindCursor, ICalendarEvent) so the signature resolves correctly
and matches the CalendarEventRaw.findBySubject implementation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dbf0d5f7-41c0-45c1-9ecd-334cae89e225

📥 Commits

Reviewing files that changed from the base of the PR and between b8b8611 and 7312857.

📒 Files selected for processing (3)
  • apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventItem.tsx
  • apps/meteor/server/services/calendar/service.ts
  • packages/models/src/models/CalendarEvent.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/server/services/calendar/service.ts
  • packages/models/src/models/CalendarEvent.ts
  • apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventItem.tsx
🧠 Learnings (2)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/server/services/calendar/service.ts
  • packages/models/src/models/CalendarEvent.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/server/services/calendar/service.ts
  • packages/models/src/models/CalendarEvent.ts
🔇 Additional comments (1)
apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventItem.tsx (1)

60-66: Propagation handling is correctly fixed.

Line 63 stops bubbling before Line 64 opens the meeting URL, so clicking Join no longer triggers the parent event modal handler.

@tassoevan tassoevan changed the title Fix/join button bubbling clean fix: "Join" button on Outlook Calendar bubbles event up Mar 5, 2026
@tassoevan tassoevan force-pushed the fix/join-button-bubbling-clean branch from 7312857 to abc0782 Compare March 5, 2026 13:19
@tassoevan tassoevan force-pushed the fix/join-button-bubbling-clean branch from abc0782 to 1d78fce Compare March 5, 2026 13:22
@tassoevan tassoevan added this to the 8.3.0 milestone Mar 5, 2026
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.86%. Comparing base (b8b8611) to head (1d78fce).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #39363      +/-   ##
===========================================
- Coverage    70.92%   70.86%   -0.07%     
===========================================
  Files         3207     3207              
  Lines       113353   113353              
  Branches     20554    20534      -20     
===========================================
- Hits         80399    80328      -71     
- Misses       30908    30977      +69     
- Partials      2046     2048       +2     
Flag Coverage Δ
unit 71.55% <ø> (-0.11%) ⬇️

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.

@tassoevan tassoevan force-pushed the fix/join-button-bubbling-clean branch from 1d78fce to 5b39757 Compare March 5, 2026 13:54
Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer using usePreventPropagation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community type: bug type: feature Pull requests that introduces new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Clicking the "Join" button also opens the event modal in Outlook Calendar events list

4 participants