fix: "Join" button on Outlook Calendar bubbles event up#39363
fix: "Join" button on Outlook Calendar bubbles event up#39363gauravsingh001-cyber wants to merge 2 commits intoRocketChat:developfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 5b39757 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
apps/meteor/client/views/outlookCalendar/OutlookEventsList/OutlookEventItem.tsxapps/meteor/server/services/calendar/service.tspackages/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.tspackages/models/src/models/CalendarEvent.tsapps/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.tspackages/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.tspackages/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.
7312857 to
abc0782
Compare
abc0782 to
1d78fce
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
1d78fce to
5b39757
Compare
dougfabris
left a comment
There was a problem hiding this comment.
prefer using usePreventPropagation
Closes #39356
Issue
Clicking the "Join" button inside an Outlook calendar event item also triggered the parent container's
onClickhandler 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
OutlookEventItemcomponent wraps the event UI inside a clickable container (Box) that opens the event modal throughhandleOpenEvent.The Join button was placed inside this container without preventing the click event from propagating to the parent component.
Therefore:
openCall()BoxhandleOpenEventSolution
To prevent this unintended behavior, the click event propagation from the Join button was stopped using:
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:
Before
After
solution7.mp4
Testing Steps
→ Event modal opens (expected behavior)
→ Meeting link opens
→ Event modal does NOT open
Result
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
Chores