Skip to content

feat: presence sync engine UI#40469

Merged
ggazzo merged 48 commits into
release-8.6.0from
feat/presence-expiration-ui
Jun 26, 2026
Merged

feat: presence sync engine UI#40469
ggazzo merged 48 commits into
release-8.6.0from
feat/presence-expiration-ui

Conversation

@ricardogarim

@ricardogarim ricardogarim commented May 9, 2026

Copy link
Copy Markdown
Member

Proposed changes

Frontend for status expiration. Consumes statusSource and statusExpiresAt from the presence engine.

Figma

Changes

  • User menu Status section — when a custom status is set, the "Custom Status" entry is replaced by the active custom-status row (status indicator + emoji + statusText, "Until …" with clock icon, pencil edit addon). Header simplified to avatar + name. Away removed from quick statuses.
  • Edit status modal — removed the top "Current status" block and the bottom Callout; the warning is now an inline hint. Duration options trimmed to Don't clear, 30 minutes, 1 hour, and Choose date and time. Stays open on save failure; expiration validation errors render inline. Sends expiresAt to /v1/users.setStatus.
  • /account/profile — new Status section: status text input with status menu, "Clear status after" select, conditional date/time inputs with validation, bracketed by dividers from the surrounding fields. Same expiresAt round-trip as the modal.
  • Inline status displayUserStatusText surfaces statusText + "Until …" in user card, user info, and room topic. DM and room-members rows show the same info as a hover tooltip, prefixed with the localized presence ("Online - …").
  • Client state — presence store, user data sync, and user statuses updated to handle statusSource and statusExpiresAt from DDP streams.
  • i18n — added `Status_expiration_date` / `Status_expiration_time` keys; rewrote `Status_new_status_warning`.
  • Tests — E2E for validation (past/missing), modal preset + custom flows, custom-status replacement in the menu, and profile → expiration round-trip. Client store tests for `statusSource` / `statusExpiresAt`.

Issue(s)

Steps to test or reproduce

See the use case matrix for the full set of scenarios.

Further comments

Frontend only — backend lives in #40274.

Summary by CodeRabbit

  • New Features

    • Added support for setting custom statuses with optional expiration times, including preset durations and custom date/time.
    • Status details now appear more consistently across user menus, profiles, room headers, and sidebars.
    • Media calls can now automatically update your presence while a call is active.
  • Bug Fixes

    • Direct-message topics and room headers no longer reuse the wrong status text.
    • Presence updates and status expiration are now handled more reliably across the app.
    • Improved validation and feedback when saving status changes.

@dionisio-bot

dionisio-bot Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

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

@changeset-bot

changeset-bot Bot commented May 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dba082e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The PR threads statusId, statusExpiresAt, and clear-after status data through presence contracts, client helpers, editing UI, status surfaces, and server presence sources. It also updates calendar and media-call presence handling plus related tests.

Changes

Status Expiration and Presence Claims

Layer / File(s) Summary
Presence contracts and claim resolution
packages/core-typings/src/IUser.ts, packages/rest-typings/src/v1/users.ts, packages/core-services/src/types/IPresence.ts, packages/apps-engine/src/definition/..., packages/apps/src/server/..., packages/apps/tests/test-data/bridges/userBridge.ts, ee/packages/presence/..., packages/model-typings/src/models/IUsersModel.ts, packages/models/src/models/Users.ts, apps/meteor/tests/end-to-end/apps/presence-state.ts
statusId, statusSource, and statusExpiresAt now flow through shared presence types, active-state bridges, the presence engine, and active-state lifecycle tests.
Status text and expiration helpers
apps/meteor/client/hooks/..., apps/meteor/client/components/UserStatusText/..., apps/meteor/client/lib/presence.ts, apps/meteor/client/lib/userData.ts, packages/i18n/src/locales/en.i18n.json
Presence notifications and status-text helpers now read statusExpiresAt, format translated until text, and expose tooltip/status text rendering from reactive presence data.
Status editing and profile forms
apps/meteor/app/api/server/v1/users.ts, apps/meteor/client/components/UserStatusMenu.tsx, apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/..., apps/meteor/client/lib/getUserInitialStatus.ts, apps/meteor/client/lib/statusDurations.ts, apps/meteor/client/views/account/profile/..., packages/i18n/src/locales/en.i18n.json, apps/meteor/tests/e2e/page-objects/..., apps/meteor/tests/e2e/presence.spec.ts, apps/meteor/tests/end-to-end/api/users.ts
The user menu modal and account profile form now edit custom status text, status type, and clear-after values, with conditional message submission and new duration validation.
Status surfaces and DM tooltips
apps/meteor/client/lib/utils/..., apps/meteor/client/components/UserCard/UserCard.tsx, apps/meteor/client/components/UserInfo/..., apps/meteor/client/views/admin/users/AdminUserInfoWithData.tsx, apps/meteor/client/views/room/..., apps/meteor/client/views/navigation/sidebar/RoomList/..., apps/meteor/client/sidebar/...
User cards, room headers, sidebar items, and DM hover targets now render reactive custom status content, and RoomTopic no longer derives topic text from a DM partner status.
Calendar scheduler and busy presence
apps/meteor/app/api/server/v1/users.ts, packages/core-typings/src/ICalendarEvent.ts, packages/core-services/src/types/ICalendarService.ts, packages/model-typings/src/models/ICalendarEventModel.ts, packages/models/src/models/CalendarEvent.ts, apps/meteor/server/services/calendar/..., apps/meteor/server/services/calendar/statusEvents/..., apps/meteor/tests/data/utils.ts, apps/meteor/tests/end-to-end/api/calendar.ts, apps/meteor/tests/unit/server/services/calendar/...
Calendar scheduling now updates busy presence through Presence, removes the status-event helper paths, and the calendar model, API, and tests follow the start-only scheduler flow.
Media-call presence events
ee/packages/media-calls/..., apps/meteor/server/services/media-call/service.ts
Media-call activation and hangup events now emit call IDs and update the participating users' busy presence state and history localization.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant EditStatusModal
  participant usersSetStatus as users.setStatus
  participant Local_Custom_Status
  User->>EditStatusModal: edit status text and clear-after
  EditStatusModal->>usersSetStatus: submit message, statusType, expiresAt
  usersSetStatus-->>EditStatusModal: success or error
  EditStatusModal->>Local_Custom_Status: store status text
Loading
sequenceDiagram
  participant CallDirector
  participant MediaCallService
  participant Presence
  CallDirector->>MediaCallService: emit callActivated
  MediaCallService->>Presence: setActiveState(BUSY, statusId=callId)
  CallDirector->>MediaCallService: emit callEnded
  MediaCallService->>Presence: endActiveState(callId)
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90+ minutes

Possibly related PRs

Suggested reviewers

  • cardoso
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the PR's main theme: new presence/status expiration UI and client sync changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • VXTRCZIDGOWYADVE-1: Request failed with status code 401
  • PRES-22: Request failed with status code 401

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.

@ricardogarim ricardogarim changed the base branch from develop to feat/presence-sync-engine May 9, 2026 12:37
@ricardogarim ricardogarim force-pushed the feat/presence-expiration-ui branch 2 times, most recently from d35ed87 to 9f10aca Compare May 11, 2026 13:58
@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.83311% with 279 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.17%. Comparing base (e479e6b) to head (dba082e).
⚠️ Report is 1 commits behind head on release-8.6.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.6.0   #40469      +/-   ##
=================================================
+ Coverage          70.15%   70.17%   +0.01%     
=================================================
  Files               3365     3371       +6     
  Lines             129983   130417     +434     
  Branches           22575    22530      -45     
=================================================
+ Hits               91192    91517     +325     
- Misses             35478    35581     +103     
- Partials            3313     3319       +6     
Flag Coverage Δ
e2e 59.41% <77.67%> (+0.09%) ⬆️
e2e-api 46.15% <46.00%> (-0.12%) ⬇️
unit 70.14% <50.22%> (-0.01%) ⬇️

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 force-pushed the feat/presence-expiration-ui branch 2 times, most recently from 5dd9075 to 24d4734 Compare May 11, 2026 20:42
@ricardogarim

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label May 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (2)
apps/meteor/client/components/UserStatusText/useExpirationText.ts (1)

7-7: ⚡ Quick win

Remove inline implementation comment.

Please drop the comment on Line 7 to match project style for implementation files.

As per coding guidelines "Avoid code comments in the implementation".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/client/components/UserStatusText/useExpirationText.ts` at line 7,
Remove the inline implementation comment in the module that begins with "Handles
Date, ISO string, and EJSON { $date }..." inside useExpirationText.ts (the
useExpirationText hook/function); simply delete that comment line so the file
conforms to the "no implementation comments" guideline and ensure the file still
builds/linters pass after removal.
apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts (1)

22-24: ⚡ Quick win

Prefer a semantic locator for the duration control.

Line 23 relies on an ID suffix and couples the page object to implementation details. Use label-based lookup for better resilience.

Proposed fix
 private get durationSelect() {
-	return this.root.locator('[id$="-clear-after"]');
+	return this.root.getByLabel('Clear status after');
 }

Based on learnings: In Rocket.Chat e2e tests, prefer semantic locators (getByRole, getByLabel, getByText, getByTitle) for reliability and maintainability.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts`
around lines 22 - 24, The durationSelect getter currently uses an ID-suffix
selector which couples the page object to implementation details; replace it
with a semantic locator such as a label- or role-based lookup. Update the
durationSelect getter (in the edit-status-modal fragment) to return
this.root.getByLabel('Clear after') or this.root.getByRole('combobox', { name:
/clear after/i }) (choose the one matching the control) so the test targets the
labeled duration control semantically.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/app/api/server/v1/users.ts`:
- Line 2005: The spread that sets statusExpiresAt from this.bodyParams.expiresAt
should validate the date before converting; create a Date from
this.bodyParams.expiresAt, check !isNaN(date.getTime()) (or Date.parse) and only
include statusExpiresAt: date when valid, otherwise either omit the property or
throw a validation error. Update the code around the spread that currently does
...(this.bodyParams.expiresAt && { statusExpiresAt: new
Date(this.bodyParams.expiresAt) }) and ensure Presence.setActiveState receives a
valid Date object (or handle invalid input by returning a 4xx response).

In `@apps/meteor/client/components/UserStatusText/useExpirationText.ts`:
- Around line 17-19: The branch in useExpirationText that handles EJSON objects
currently returns new Date((value as { $date: number }).$date) without
validating the $date, which can produce Invalid Date; update the branch (the
typeof value === 'object' && '$date' in (value as Record<string, unknown>)
check) to first extract and coerce the $date (e.g., Number((value as { $date:
unknown }).$date)), ensure it is a finite number (or parseable to a valid
timestamp) and only then return new Date(timestamp); otherwise fall through to
the same fallback/return behavior used by the other branches so an Invalid Date
is never returned from useExpirationText.

In
`@apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/EditStatusModal.tsx`:
- Around line 124-133: computeExpiresAt can produce an invalid Date when
customDate/customTime are empty or malformed; update computeExpiresAt (used with
duration, customDate, customTime and DURATION_OPTIONS) to validate the
constructed Date (e.g., check isNaN(date.getTime())) and return undefined for
invalid custom inputs, and in the save/submit path where you call
expiresAt.toISOString() (the code that consumes computeExpiresAt) add a guard to
block submission when computeExpiresAt() returns undefined (show validation
error / disable save) so you never call toISOString() on an invalid Date.
- Around line 99-100: The date input currently uses the state variable
customDate as its min which causes the selected date to become its own lower
bound; change the component to compute a stable minimum (e.g. a "today" string
in 'en-CA' format) outside of the mutable customDate state and use that stable
value for the date input's min prop. Keep the existing customDate and customTime
state initializers (useState(() => new Date().toLocaleDateString('en-CA')) and
useState(() => new Date().toTimeString().slice(0,5))) but add a separate
variable (e.g. todayMin or todayDate) computed once per render (or via useMemo)
and reference that in the date input's min attribute instead of customDate;
update references to the date input in EditStatusModal to use that new stable
min.

In `@apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx`:
- Around line 46-47: The memo comparator for the SidebarItemTemplateWithData
component is missing userId as an input, yet userId affects dmUserId (and
therefore DM presence/tooltip); update the React.memo comparator (the custom
equality function used when wrapping SidebarItemTemplateWithData) to include
props.userId in its comparison set so a change from undefined→loaded (or any
userId change) forces a re-render; ensure any places computing dmUserId (the
dmUserId variable) are covered by the comparator inputs as well.

In `@packages/rest-typings/src/v1/users.ts`:
- Line 337: The REST response typing is exposing a raw Date via
statusExpiresAt?: IUser['statusExpiresAt'];—change the property to a serialized
date type (e.g. statusExpiresAt?: string | null) so clients receive an ISO
string (or null) instead of a Date; update the type in the users REST response
interface where statusExpiresAt is defined and ensure any serializers convert
the Date to an ISO string before sending.

---

Nitpick comments:
In `@apps/meteor/client/components/UserStatusText/useExpirationText.ts`:
- Line 7: Remove the inline implementation comment in the module that begins
with "Handles Date, ISO string, and EJSON { $date }..." inside
useExpirationText.ts (the useExpirationText hook/function); simply delete that
comment line so the file conforms to the "no implementation comments" guideline
and ensure the file still builds/linters pass after removal.

In `@apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts`:
- Around line 22-24: The durationSelect getter currently uses an ID-suffix
selector which couples the page object to implementation details; replace it
with a semantic locator such as a label- or role-based lookup. Update the
durationSelect getter (in the edit-status-modal fragment) to return
this.root.getByLabel('Clear after') or this.root.getByRole('combobox', { name:
/clear after/i }) (choose the one matching the control) so the test targets the
labeled duration control semantically.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dfee8651-3f4f-44ee-a64e-9ed27c8b38d8

📥 Commits

Reviewing files that changed from the base of the PR and between 21fc0a9 and 24d4734.

⛔ Files ignored due to path filters (1)
  • apps/meteor/client/components/UserInfo/__snapshots__/UserInfo.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (36)
  • apps/meteor/app/api/server/helpers/getUserFromParams.ts
  • apps/meteor/app/api/server/v1/users.ts
  • apps/meteor/app/lib/server/functions/getFullUserData.ts
  • apps/meteor/app/notifications/client/lib/Presence.ts
  • apps/meteor/app/utils/server/functions/getBaseUserFields.ts
  • apps/meteor/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/components/UserStatusText/UserStatusText.tsx
  • apps/meteor/client/components/UserStatusText/index.ts
  • apps/meteor/client/components/UserStatusText/useExpirationText.ts
  • apps/meteor/client/components/UserStatusText/useStatusTooltip.tsx
  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/client/lib/presence.ts
  • apps/meteor/client/lib/userData.ts
  • apps/meteor/client/lib/userStatuses.ts
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/EditStatusModal.tsx
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/UserMenuHeader.tsx
  • apps/meteor/client/sidebar/RoomList/RoomList.tsx
  • apps/meteor/client/sidebar/RoomList/RoomListRow.tsx
  • apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx
  • apps/meteor/client/views/room/Header/RoomTopic.tsx
  • apps/meteor/client/views/room/UserCard/UserCardWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/server/modules/listeners/listeners.module.ts
  • apps/meteor/server/modules/notifications/notifications.module.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/end-to-end/api/users.ts
  • ee/packages/presence/src/Presence.ts
  • packages/core-services/src/events/Events.ts
  • packages/core-typings/src/IMeApiUser.ts
  • packages/core-typings/src/IUser.ts
  • packages/ddp-client/src/types/streams.ts
  • packages/i18n/src/locales/en.i18n.json
  • packages/rest-typings/src/v1/users.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: 🔨 Test UI (CE) / MongoDB 8.0 (4/4)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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/client/lib/userStatuses.ts
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/UserMenuHeader.tsx
  • apps/meteor/client/sidebar/RoomList/RoomList.tsx
  • apps/meteor/client/lib/presence.ts
  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/client/components/UserStatusText/index.ts
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/UserCard/UserCardWithData.tsx
  • ee/packages/presence/src/Presence.ts
  • apps/meteor/client/components/UserStatusText/UserStatusText.tsx
  • packages/core-typings/src/IMeApiUser.ts
  • packages/core-services/src/events/Events.ts
  • apps/meteor/app/notifications/client/lib/Presence.ts
  • apps/meteor/app/lib/server/functions/getFullUserData.ts
  • apps/meteor/client/components/UserStatusText/useStatusTooltip.tsx
  • apps/meteor/client/views/room/Header/RoomTopic.tsx
  • packages/core-typings/src/IUser.ts
  • apps/meteor/app/utils/server/functions/getBaseUserFields.ts
  • apps/meteor/client/sidebar/RoomList/RoomListRow.tsx
  • apps/meteor/client/components/UserStatusText/useExpirationText.ts
  • apps/meteor/server/modules/listeners/listeners.module.ts
  • packages/ddp-client/src/types/streams.ts
  • apps/meteor/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/lib/userData.ts
  • apps/meteor/server/modules/notifications/notifications.module.ts
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/app/api/server/v1/users.ts
  • apps/meteor/app/api/server/helpers/getUserFromParams.ts
  • apps/meteor/tests/e2e/presence.spec.ts
  • packages/rest-typings/src/v1/users.ts
  • apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/end-to-end/api/users.ts
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/EditStatusModal.tsx
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
**/*.spec.ts

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

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/tests/e2e/presence.spec.ts
apps/meteor/tests/e2e/**/*.spec.ts

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

apps/meteor/tests/e2e/**/*.spec.ts: All test files must be created in apps/meteor/tests/e2e/ directory
Avoid using page.locator() in Playwright tests - always prefer semantic locators such as page.getByRole(), page.getByLabel(), page.getByText(), or page.getByTitle()
Use test.beforeAll() and test.afterAll() for setup/teardown in Playwright tests
Use test.step() for complex test scenarios to improve organization in Playwright tests
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) for consistency in test files
Prefer web-first assertions (toBeVisible, toHaveText, etc.) in Playwright tests
Use expect matchers for assertions (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements in Playwright tests
Use page.waitFor() with specific conditions instead of hardcoded timeouts in Playwright tests
Implement proper wait strategies for dynamic content in Playwright tests
Maintain test isolation between test cases in Playwright tests
Ensure clean state for each test execution in Playwright tests
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/presence.spec.ts
apps/meteor/tests/e2e/**/*.{ts,spec.ts}

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

apps/meteor/tests/e2e/**/*.{ts,spec.ts}: Store commonly used locators in variables/constants for reuse
Follow Page Object Model pattern consistently in Playwright tests

Files:

  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
apps/meteor/tests/e2e/page-objects/**/*.ts

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

Utilize existing page objects pattern from apps/meteor/tests/e2e/page-objects/

Files:

  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
🧠 Learnings (14)
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.

Applied to files:

  • apps/meteor/client/lib/userStatuses.ts
  • apps/meteor/client/lib/presence.ts
  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/client/components/UserStatusText/index.ts
  • apps/meteor/client/components/UserStatusText/useExpirationText.ts
  • apps/meteor/client/lib/userData.ts
📚 Learning: 2026-05-11T20:30:35.265Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 40480
File: apps/meteor/client/meteor/startup/accounts.ts:59-61
Timestamp: 2026-05-11T20:30:35.265Z
Learning: In Rocket.Chat’s Meteor client code, when calling `dispatchToastMessage` with `{ type: 'error' }`, pass the raw caught error object as `message` without manual normalization. `dispatchToastMessage` is designed to accept `message: unknown` for error toasts, so avoid converting errors to strings (e.g., `String(error)`) or extracting `error.message` before passing them.

Applied to files:

  • apps/meteor/client/lib/userStatuses.ts
  • apps/meteor/client/lib/presence.ts
  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/client/components/UserStatusText/index.ts
  • apps/meteor/client/components/UserStatusText/useExpirationText.ts
  • apps/meteor/client/lib/userData.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 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/client/lib/userStatuses.ts
  • apps/meteor/client/lib/presence.ts
  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/client/components/UserStatusText/index.ts
  • ee/packages/presence/src/Presence.ts
  • packages/core-typings/src/IMeApiUser.ts
  • packages/core-services/src/events/Events.ts
  • apps/meteor/app/notifications/client/lib/Presence.ts
  • apps/meteor/app/lib/server/functions/getFullUserData.ts
  • packages/core-typings/src/IUser.ts
  • apps/meteor/app/utils/server/functions/getBaseUserFields.ts
  • apps/meteor/client/components/UserStatusText/useExpirationText.ts
  • apps/meteor/server/modules/listeners/listeners.module.ts
  • packages/ddp-client/src/types/streams.ts
  • apps/meteor/client/lib/userData.ts
  • apps/meteor/server/modules/notifications/notifications.module.ts
  • apps/meteor/app/api/server/v1/users.ts
  • apps/meteor/app/api/server/helpers/getUserFromParams.ts
  • apps/meteor/tests/e2e/presence.spec.ts
  • packages/rest-typings/src/v1/users.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/end-to-end/api/users.ts
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.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/client/lib/userStatuses.ts
  • apps/meteor/client/lib/presence.ts
  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/client/components/UserStatusText/index.ts
  • ee/packages/presence/src/Presence.ts
  • packages/core-typings/src/IMeApiUser.ts
  • packages/core-services/src/events/Events.ts
  • apps/meteor/app/notifications/client/lib/Presence.ts
  • apps/meteor/app/lib/server/functions/getFullUserData.ts
  • packages/core-typings/src/IUser.ts
  • apps/meteor/app/utils/server/functions/getBaseUserFields.ts
  • apps/meteor/client/components/UserStatusText/useExpirationText.ts
  • apps/meteor/server/modules/listeners/listeners.module.ts
  • packages/ddp-client/src/types/streams.ts
  • apps/meteor/client/lib/userData.ts
  • apps/meteor/server/modules/notifications/notifications.module.ts
  • apps/meteor/app/api/server/v1/users.ts
  • apps/meteor/app/api/server/helpers/getUserFromParams.ts
  • apps/meteor/tests/e2e/presence.spec.ts
  • packages/rest-typings/src/v1/users.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/end-to-end/api/users.ts
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/client/lib/userStatuses.ts
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/UserMenuHeader.tsx
  • apps/meteor/client/sidebar/RoomList/RoomList.tsx
  • apps/meteor/client/lib/presence.ts
  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/client/components/UserStatusText/index.ts
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/UserCard/UserCardWithData.tsx
  • ee/packages/presence/src/Presence.ts
  • apps/meteor/client/components/UserStatusText/UserStatusText.tsx
  • packages/core-typings/src/IMeApiUser.ts
  • packages/core-services/src/events/Events.ts
  • apps/meteor/app/notifications/client/lib/Presence.ts
  • apps/meteor/app/lib/server/functions/getFullUserData.ts
  • apps/meteor/client/components/UserStatusText/useStatusTooltip.tsx
  • apps/meteor/client/views/room/Header/RoomTopic.tsx
  • packages/core-typings/src/IUser.ts
  • apps/meteor/app/utils/server/functions/getBaseUserFields.ts
  • apps/meteor/client/sidebar/RoomList/RoomListRow.tsx
  • apps/meteor/client/components/UserStatusText/useExpirationText.ts
  • apps/meteor/server/modules/listeners/listeners.module.ts
  • packages/ddp-client/src/types/streams.ts
  • apps/meteor/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/lib/userData.ts
  • apps/meteor/server/modules/notifications/notifications.module.ts
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/app/api/server/v1/users.ts
  • apps/meteor/app/api/server/helpers/getUserFromParams.ts
  • apps/meteor/tests/e2e/presence.spec.ts
  • packages/rest-typings/src/v1/users.ts
  • apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/end-to-end/api/users.ts
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/EditStatusModal.tsx
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/UserMenuHeader.tsx
  • apps/meteor/client/sidebar/RoomList/RoomList.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/UserCard/UserCardWithData.tsx
  • apps/meteor/client/components/UserStatusText/UserStatusText.tsx
  • apps/meteor/client/components/UserStatusText/useStatusTooltip.tsx
  • apps/meteor/client/views/room/Header/RoomTopic.tsx
  • apps/meteor/client/sidebar/RoomList/RoomListRow.tsx
  • apps/meteor/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/EditStatusModal.tsx
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/tests/e2e/presence.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/client/lib/presence.spec.ts
  • apps/meteor/tests/e2e/presence.spec.ts
📚 Learning: 2026-02-23T17:53:06.802Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:06.802Z
Learning: During PR reviews that touch endpoint files under apps/meteor/app/api/server/v1, enforce strict scope: if a PR targets a specific endpoint (e.g., rooms.favorite), do not propose changes to unrelated endpoints (e.g., rooms.invite) unless maintainers explicitly request them. Focus feedback on the touched endpoint's behavior, API surface, and related tests; avoid broad cross-endpoint changes in the same PR unless requested.

Applied to files:

  • apps/meteor/app/api/server/v1/users.ts
📚 Learning: 2026-02-24T19:09:01.522Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:01.522Z
Learning: In Rocket.Chat OpenAPI migration PRs for endpoints under apps/meteor/app/api/server/v1, avoid introducing logic changes. Only perform scope-tight changes that preserve behavior; style-only cleanups (e.g., removing inline comments) may be deferred to follow-ups to keep the migration PR focused.

Applied to files:

  • apps/meteor/app/api/server/v1/users.ts
📚 Learning: 2026-03-15T14:31:25.380Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39647
File: apps/meteor/app/api/server/v1/users.ts:710-757
Timestamp: 2026-03-15T14:31:25.380Z
Learning: Do not flag this type/schema misalignment in the OpenAPI/migration review for apps/meteor/app/api/server/v1/users.ts. The UserCreateParamsPOST type intentionally uses non-optional fields: fields: string and settings?: IUserSettings without an AJV schema entry, carried over from the original rest-typings (PR `#39647`). Treat this as a known pre-existing divergence and document it as a separate follow-up fix; do not block or mark it as a review issue during the migration.

Applied to files:

  • apps/meteor/app/api/server/v1/users.ts
📚 Learning: 2026-03-16T23:33:11.443Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: apps/meteor/app/api/server/v1/users.ts:862-869
Timestamp: 2026-03-16T23:33:11.443Z
Learning: In rockets OpenAPI/AJV migration reviews for RocketChat/Rocket.Chat, when reviewing migrations that involve apps/meteor/app/api/server/v1/users.ts, do not require or flag a missing query AJV schema for the fields consumed by parseJsonQuery() (i.e., fields, sort, query) as part of this endpoint's migration PR. The addition of global query-param schemas for parseJsonQuery() usage is a cross-cutting concern and out of scope for individual endpoint migrations. Only flag violations related to the specific scope of the migration, not the absence of a query schema for parseJsonQuery() in this file.

Applied to files:

  • apps/meteor/app/api/server/v1/users.ts
📚 Learning: 2026-02-24T19:39:42.247Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/message.ts:7-7
Timestamp: 2026-02-24T19:39:42.247Z
Learning: In RocketChat e2e tests, avoid using data-qa attributes to locate elements. Prefer semantic locators such as getByRole, getByLabel, getByText, getByTitle and ARIA-based selectors. Apply this rule to all TypeScript files under apps/meteor/tests/e2e to improve test reliability, accessibility, and maintainability.

Applied to files:

  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
📚 Learning: 2025-12-16T17:29:40.430Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37834
File: apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-emoji.ts:12-22
Timestamp: 2025-12-16T17:29:40.430Z
Learning: In all page-object files under apps/meteor/tests/e2e/page-objects/, import expect from ../../utils/test (Playwright's async expect) instead of from Jest. Jest's expect is synchronous and incompatible with web-first assertions like toBeVisible, which can cause TypeScript errors.

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
🪛 ast-grep (0.42.2)
apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts

[warning] 40-40: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(duration)
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🔇 Additional comments (39)
apps/meteor/client/lib/userStatuses.ts (1)

16-26: LGTM!

packages/i18n/src/locales/en.i18n.json (1)

5141-5148: LGTM!

packages/core-typings/src/IUser.ts (1)

299-302: LGTM!

packages/core-typings/src/IMeApiUser.ts (1)

31-32: LGTM!

ee/packages/presence/src/Presence.ts (1)

353-353: LGTM!

packages/core-services/src/events/Events.ts (1)

162-162: LGTM!

apps/meteor/server/modules/notifications/notifications.module.ts (1)

2-2: LGTM!

Also applies to: 490-493

apps/meteor/client/components/UserStatusText/useStatusTooltip.tsx (1)

8-38: LGTM!

packages/rest-typings/src/v1/users.ts (1)

106-109: LGTM!

Also applies to: 321-328

apps/meteor/app/utils/server/functions/getBaseUserFields.ts (1)

13-14: LGTM!

apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx (1)

61-61: LGTM!

Also applies to: 92-92

apps/meteor/client/views/room/UserCard/UserCardWithData.tsx (1)

13-13: LGTM!

Also applies to: 49-50, 67-67

apps/meteor/client/lib/userData.ts (1)

21-22: LGTM!

Also applies to: 163-165

apps/meteor/client/sidebar/RoomList/RoomList.tsx (1)

23-24: LGTM!

Also applies to: 44-46

apps/meteor/app/lib/server/functions/getFullUserData.ts (1)

21-22: LGTM!

apps/meteor/client/sidebar/RoomList/RoomListRow.tsx (1)

19-19: LGTM!

Also applies to: 25-25, 51-51

apps/meteor/server/modules/listeners/listeners.module.ts (3)

160-160: LGTM!

Also applies to: 175-177, 180-182


185-194: LGTM!


197-197: LGTM!

apps/meteor/app/api/server/v1/users.ts (3)

1518-1529: LGTM!


2023-2038: LGTM!


2040-2059: LGTM!

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (1)

57-67: LGTM!

apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/UserMenuHeader.tsx (1)

33-37: LGTM!

apps/meteor/tests/e2e/presence.spec.ts (2)

97-120: LGTM!


78-95: Page object methods correctly use semantic locators.

The page object implementations for customDateInput, customTimeInput, and selectDuration all use semantic locators (getByLabel and getByRole) as required. No changes needed.

apps/meteor/client/components/UserStatusText/index.ts (1)

1-5: LGTM!

apps/meteor/client/lib/presence.ts (1)

78-86: Date conversion correctly handles REST response strings.

The conversion of statusExpiresAt from ISO string to Date object is correct for REST API responses. Based on learnings, DDP streams deliver Date objects via EJSON, but REST responses return JSON strings that require explicit conversion.

The code correctly converts only when statusExpiresAt is present. If server-side validation is added per the earlier comment on users.setStatus, this will be fully defensive.

apps/meteor/client/lib/presence.spec.ts (2)

52-76: LGTM!


78-100: LGTM!

apps/meteor/app/api/server/helpers/getUserFromParams.ts (1)

13-18: LGTM!

apps/meteor/client/views/room/Header/RoomTopic.tsx (1)

4-5: LGTM!

Also applies to: 16-16, 19-19, 26-28, 42-44

apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx (1)

4-4: LGTM!

Also applies to: 10-10, 124-125

apps/meteor/app/notifications/client/lib/Presence.ts (1)

1-1: LGTM!

Also applies to: 13-13, 17-25

packages/ddp-client/src/types/streams.ts (1)

235-236: LGTM!

Also applies to: 301-314

apps/meteor/tests/end-to-end/api/users.ts (1)

135-140: LGTM!

Also applies to: 5144-5144, 5158-5158, 5319-5357

apps/meteor/client/components/UserInfo/UserInfo.tsx (1)

25-25: LGTM!

Also applies to: 42-42, 75-75, 108-108

apps/meteor/client/components/UserStatusText/UserStatusText.tsx (1)

1-48: LGTM!

apps/meteor/tests/e2e/page-objects/fragments/navbar.ts (1)

247-265: LGTM!

Comment thread apps/meteor/app/api/server/v1/users.ts Outdated
Comment thread apps/meteor/client/hooks/useExpirationText.ts
Comment thread apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/EditStatusModal.tsx Outdated
Comment thread apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/EditStatusModal.tsx Outdated
Comment thread apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx
Comment thread packages/rest-typings/src/v1/users.ts
@ricardogarim ricardogarim marked this pull request as ready for review May 12, 2026 11:01
@ricardogarim ricardogarim requested review from a team as code owners May 12, 2026 11:01
@ricardogarim ricardogarim modified the milestone: 8.5.0 May 12, 2026
@ricardogarim ricardogarim marked this pull request as draft May 15, 2026 15:50
@ricardogarim ricardogarim force-pushed the feat/presence-expiration-ui branch from 807228e to a62ad69 Compare May 15, 2026 15:59
@ricardogarim ricardogarim force-pushed the feat/presence-sync-engine branch from 21fc0a9 to 2f88830 Compare May 15, 2026 15:59
@ricardogarim ricardogarim force-pushed the feat/presence-expiration-ui branch from a62ad69 to 9ad1e60 Compare May 15, 2026 16:01
@ricardogarim ricardogarim force-pushed the feat/presence-sync-engine branch from 2f88830 to 0c3bcd5 Compare May 15, 2026 16:01
@ricardogarim ricardogarim force-pushed the feat/presence-expiration-ui branch 2 times, most recently from 75684ed to d29edd2 Compare May 18, 2026 16:09
@ricardogarim

ricardogarim commented May 18, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

dougfabris and others added 22 commits June 26, 2026 10:04
Co-authored-by: ricardogarim <ricardogarim@users.noreply.github.com>
@ricardogarim ricardogarim dismissed stale reviews from KevLehman and dougfabris via 5bea13b June 26, 2026 13:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

♻️ Duplicate comments (2)
apps/meteor/client/components/UserInfo/UserInfo.tsx (1)

103-103: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

customStatus is always truthy here when it is a React element.

<ReactiveUserStatusText /> will make this branch render even when it resolves to null, so InfoPanelText still mounts and leaves the blank spacing/misalignment reported earlier.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/client/components/UserInfo/UserInfo.tsx` at line 103, The
conditional render around customStatus in UserInfo should not depend on its
truthiness when it may be a React element, because it can still mount
InfoPanelText even when the element resolves to null. Update the rendering logic
in UserInfo to explicitly determine whether the status actually produces visible
content before mounting InfoPanelText, so blank spacing is avoided. Use the
customStatus / ReactiveUserStatusText branch as the target location and keep the
wrapper from rendering unless there is real text or nodes to show.
apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts (1)

55-57: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use exact option matching for duration selection.

This repeats the earlier issue on this file: duration is an exact label, so regex matching is unnecessarily loose and can select the wrong option.

Suggested change
 async selectDuration(duration: string): Promise<void> {
 	await this.durationSelect.click();
-	await this.page!.getByRole('option', { name: new RegExp(duration) }).click();
+	await this.page!.getByRole('option', { name: duration, exact: true }).click();
 }

Based on learnings, prefer stable semantic Playwright locators in e2e page objects; this also matches the previously addressed feedback on the same helper.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts`
around lines 55 - 57, The duration selection in edit-status modal is using a
loose regex match, which can hit the wrong option when labels are similar.
Update selectDuration in the EditStatusModal helper to use an exact, stable
Playwright locator for the option label instead of a RegExp, so the selected
option matches the provided duration exactly.

Sources: Learnings, Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/tests/e2e/page-objects/account-profile.ts`:
- Around line 55-57: The option selection in chooseClearStatusAfter is using a
regex matcher, which can misbehave for labels containing special characters.
Update the Playwright locator in chooseClearStatusAfter to match the option by
exact accessible name using the built-in exact matching behavior instead of new
RegExp(option), so the click targets the intended clear-after option
deterministically.

In `@apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts`:
- Around line 42-44: The durationMissingError locator in edit-status-modal
should stop relying on the Fuselage CSS class and use the field error’s semantic
alert role instead. Update the getter in the EditStatusModal page object to
locate the validation message by role="alert" with the existing text filter,
keeping the same intent while making the selector resilient to styling changes.

In `@apps/meteor/tests/e2e/presence.spec.ts`:
- Around line 83-103: The presence tests are leaving shared admin status cleanup
inside the happy-path body, so a failed assertion can leave state dirty for
later cases. Move the reset logic for the custom status out of each test body in
presence.spec.ts and into a test-level afterEach hook or a finally-style
teardown around the relevant test steps, using the existing
changeUserCustomStatus flow so cleanup always runs even when assertions fail.
Apply the same isolation fix to the other affected presence tests in this suite
so each case starts from a clean state.
- Around line 83-103: Update the presence e2e test to match the intended
custom-status menu behavior: in the test named should show both Custom Status
action and active status row when a custom status is set, stop asserting that
btnCustomStatus remains visible after changeUserCustomStatus(text). Instead,
assert the active custom-status row/text in poHomeChannel.navbar.userMenu and
verify the menu action behavior reflects replacement rather than coexistence,
keeping the cleanup step unchanged.
- Around line 68-80: The presence test in presence.spec.ts only checks that
localStorage is not undefined, which still passes if the key is removed and
getItem returns null. Update the scenario around test('should not save custom
status as `undefined` if nothing changes') to capture the stored custom status
value before calling poHomeChannel.navbar.openEditStatusModal(), then after
editStatusModal.close() assert the value is exactly unchanged. Use the existing
editStatusModal and page.evaluate/localStorage access so the test detects any
reset or deletion of the stored status.

---

Duplicate comments:
In `@apps/meteor/client/components/UserInfo/UserInfo.tsx`:
- Line 103: The conditional render around customStatus in UserInfo should not
depend on its truthiness when it may be a React element, because it can still
mount InfoPanelText even when the element resolves to null. Update the rendering
logic in UserInfo to explicitly determine whether the status actually produces
visible content before mounting InfoPanelText, so blank spacing is avoided. Use
the customStatus / ReactiveUserStatusText branch as the target location and keep
the wrapper from rendering unless there is real text or nodes to show.

In `@apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts`:
- Around line 55-57: The duration selection in edit-status modal is using a
loose regex match, which can hit the wrong option when labels are similar.
Update selectDuration in the EditStatusModal helper to use an exact, stable
Playwright locator for the option label instead of a RegExp, so the selected
option matches the provided duration exactly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 329d4abf-333c-4fc0-9207-ee20c50c8eb5

📥 Commits

Reviewing files that changed from the base of the PR and between a98223d and 5bea13b.

📒 Files selected for processing (82)
  • apps/meteor/app/api/server/v1/users.ts
  • apps/meteor/app/apps/server/bridges/users.ts
  • apps/meteor/client/components/UserCard/UserCard.tsx
  • apps/meteor/client/components/UserInfo/UserInfo.stories.tsx
  • apps/meteor/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/components/UserStatusMenu.tsx
  • apps/meteor/client/components/UserStatusText/ReactiveUserStatusText.tsx
  • apps/meteor/client/components/UserStatusText/UserStatusText.tsx
  • apps/meteor/client/components/UserStatusText/index.ts
  • apps/meteor/client/hooks/useExpirationText.ts
  • apps/meteor/client/hooks/useUserPresenceListener.ts
  • apps/meteor/client/hooks/useUserStatusTooltip.tsx
  • apps/meteor/client/lib/getUserInitialStatus.ts
  • apps/meteor/client/lib/presence.ts
  • apps/meteor/client/lib/statusDurations.ts
  • apps/meteor/client/lib/userData.ts
  • apps/meteor/client/lib/utils/getUidDirectMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/getMessagePreview.ts
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/EditStatusModal.tsx
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/UserMenuHeader.tsx
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/hooks/useCustomStatusModalHandler.tsx
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/hooks/useStatusItems.tsx
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/hooks/useUserMenu.tsx
  • apps/meteor/client/sidebar/Item/Condensed.tsx
  • apps/meteor/client/sidebar/Item/Extended.tsx
  • apps/meteor/client/sidebar/Item/Medium.tsx
  • apps/meteor/client/sidebar/RoomList/RoomList.tsx
  • apps/meteor/client/sidebar/RoomList/RoomListRow.tsx
  • apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx
  • apps/meteor/client/views/account/profile/AccountProfileForm.tsx
  • apps/meteor/client/views/account/profile/getProfileInitialValues.ts
  • apps/meteor/client/views/admin/users/AdminUserInfoWithData.tsx
  • apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItem.tsx
  • apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItemWithData.tsx
  • apps/meteor/client/views/room/Header/RoomHeader.tsx
  • apps/meteor/client/views/room/Header/RoomMemberStatus.spec.tsx
  • apps/meteor/client/views/room/Header/RoomMemberStatus.tsx
  • apps/meteor/client/views/room/Header/RoomTopic.spec.tsx
  • apps/meteor/client/views/room/Header/RoomTopic.tsx
  • apps/meteor/client/views/room/UserCard/UserCardWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/server/services/calendar/service.ts
  • apps/meteor/server/services/calendar/statusEvents/applyStatusChange.ts
  • apps/meteor/server/services/calendar/statusEvents/cancelUpcomingStatusChanges.ts
  • apps/meteor/server/services/calendar/statusEvents/generateCronJobId.ts
  • apps/meteor/server/services/calendar/statusEvents/removeCronJobs.ts
  • apps/meteor/server/services/media-call/service.ts
  • apps/meteor/tests/data/utils.ts
  • apps/meteor/tests/e2e/page-objects/account-profile.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/end-to-end/api/calendar.ts
  • apps/meteor/tests/end-to-end/api/users.ts
  • apps/meteor/tests/end-to-end/apps/presence-state.ts
  • apps/meteor/tests/unit/server/services/calendar/service.tests.ts
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/applyStatusChange.ts
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/cancelUpcomingStatusChanges.tests.ts
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/generateCronJobId.tests.ts
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/handleOverlappingEvents.ts
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/removeCronJobs.tests.ts
  • ee/packages/media-calls/src/definition/IMediaCallServer.ts
  • ee/packages/media-calls/src/server/CallDirector.ts
  • ee/packages/presence/src/Presence.ts
  • ee/packages/presence/src/lib/presenceEngine.spec.ts
  • ee/packages/presence/src/lib/presenceEngine.ts
  • packages/apps-engine/src/definition/accessors/IUserUpdater.ts
  • packages/apps-engine/src/definition/users/IUser.ts
  • packages/apps/src/server/accessors/UserUpdater.ts
  • packages/apps/src/server/bridges/UserBridge.ts
  • packages/apps/tests/test-data/bridges/userBridge.ts
  • packages/core-services/src/types/ICalendarService.ts
  • packages/core-services/src/types/IPresence.ts
  • packages/core-typings/src/ICalendarEvent.ts
  • packages/core-typings/src/IUser.ts
  • packages/i18n/src/locales/en.i18n.json
  • packages/model-typings/src/models/ICalendarEventModel.ts
  • packages/model-typings/src/models/IUsersModel.ts
  • packages/models/src/models/CalendarEvent.ts
  • packages/models/src/models/Users.ts
  • packages/rest-typings/src/v1/users.ts
💤 Files with no reviewable changes (12)
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/removeCronJobs.tests.ts
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/cancelUpcomingStatusChanges.tests.ts
  • packages/model-typings/src/models/ICalendarEventModel.ts
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/generateCronJobId.tests.ts
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/handleOverlappingEvents.ts
  • apps/meteor/server/services/calendar/statusEvents/cancelUpcomingStatusChanges.ts
  • apps/meteor/tests/unit/server/services/calendar/statusEvents/applyStatusChange.ts
  • packages/core-typings/src/ICalendarEvent.ts
  • apps/meteor/server/services/calendar/statusEvents/generateCronJobId.ts
  • packages/core-services/src/types/ICalendarService.ts
  • apps/meteor/server/services/calendar/statusEvents/removeCronJobs.ts
  • apps/meteor/server/services/calendar/statusEvents/applyStatusChange.ts
✅ Files skipped from review due to trivial changes (2)
  • apps/meteor/client/sidebar/Item/Condensed.tsx
  • apps/meteor/client/components/UserCard/UserCard.tsx
🚧 Files skipped from review as they are similar to previous changes (63)
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/hooks/useUserMenu.tsx
  • apps/meteor/client/hooks/useUserPresenceListener.ts
  • apps/meteor/client/views/room/Header/RoomMemberStatus.spec.tsx
  • apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItem.tsx
  • apps/meteor/client/hooks/useUserStatusTooltip.tsx
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/UserMenuHeader.tsx
  • apps/meteor/client/lib/utils/normalizeMessagePreview/getMessagePreview.ts
  • apps/meteor/client/sidebar/Item/Medium.tsx
  • apps/meteor/client/sidebar/Item/Extended.tsx
  • apps/meteor/tests/data/utils.ts
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/hooks/useCustomStatusModalHandler.tsx
  • packages/apps-engine/src/definition/users/IUser.ts
  • ee/packages/media-calls/src/server/CallDirector.ts
  • ee/packages/media-calls/src/definition/IMediaCallServer.ts
  • apps/meteor/client/views/room/Header/RoomMemberStatus.tsx
  • packages/core-typings/src/IUser.ts
  • packages/apps/src/server/accessors/UserUpdater.ts
  • apps/meteor/client/views/room/Header/RoomTopic.spec.tsx
  • apps/meteor/client/views/room/Header/RoomHeader.tsx
  • apps/meteor/client/components/UserStatusText/UserStatusText.tsx
  • apps/meteor/client/views/account/profile/getProfileInitialValues.ts
  • apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItemWithData.tsx
  • packages/apps-engine/src/definition/accessors/IUserUpdater.ts
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • packages/rest-typings/src/v1/users.ts
  • packages/model-typings/src/models/IUsersModel.ts
  • apps/meteor/client/lib/utils/getUidDirectMessage.ts
  • apps/meteor/tests/end-to-end/apps/presence-state.ts
  • apps/meteor/client/lib/presence.ts
  • apps/meteor/client/hooks/useExpirationText.ts
  • apps/meteor/client/components/UserStatusText/ReactiveUserStatusText.tsx
  • apps/meteor/client/sidebar/RoomList/RoomListRow.tsx
  • apps/meteor/client/views/room/Header/RoomTopic.tsx
  • apps/meteor/client/lib/getUserInitialStatus.ts
  • apps/meteor/server/services/media-call/service.ts
  • apps/meteor/client/views/admin/users/AdminUserInfoWithData.tsx
  • apps/meteor/client/components/UserStatusText/index.ts
  • apps/meteor/tests/end-to-end/api/users.ts
  • packages/apps/src/server/bridges/UserBridge.ts
  • apps/meteor/client/sidebar/RoomList/RoomList.tsx
  • packages/i18n/src/locales/en.i18n.json
  • apps/meteor/client/components/UserInfo/UserInfo.stories.tsx
  • packages/core-services/src/types/IPresence.ts
  • apps/meteor/tests/end-to-end/api/calendar.ts
  • apps/meteor/app/apps/server/bridges/users.ts
  • apps/meteor/client/lib/statusDurations.ts
  • apps/meteor/client/views/room/UserCard/UserCardWithData.tsx
  • apps/meteor/tests/e2e/page-objects/fragments/navbar.ts
  • apps/meteor/tests/unit/server/services/calendar/service.tests.ts
  • packages/models/src/models/CalendarEvent.ts
  • packages/models/src/models/Users.ts
  • apps/meteor/client/lib/userData.ts
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/EditStatusModal.tsx
  • ee/packages/presence/src/Presence.ts
  • ee/packages/presence/src/lib/presenceEngine.ts
  • ee/packages/presence/src/lib/presenceEngine.spec.ts
  • packages/apps/tests/test-data/bridges/userBridge.ts
  • apps/meteor/client/components/UserStatusMenu.tsx
  • apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx
  • apps/meteor/client/views/account/profile/AccountProfileForm.tsx
  • apps/meteor/app/api/server/v1/users.ts
  • apps/meteor/client/navbar/NavBarSettingsToolbar/UserMenu/hooks/useStatusItems.tsx
  • apps/meteor/server/services/calendar/service.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
⚠️ CI failures not shown inline (2)

GitHub Actions: CI / ✅ Tests Done: feat: presence sync engine UI

Conclusion: failure

View job details

##[group]Run if [[ 'skipped' != 'success' ]]; then
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'cancelled' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mecho finished�[0m
 shell: /usr/bin/bash -e {0}
 env:
   TOOL_NODE_FLAGS: --max_old_space_size=4096
 ##[endgroup]
 ##[error]Process completed with exit code 1.

GitHub Actions: CI / 1_✅ Tests Done.txt: feat: presence sync engine UI

Conclusion: failure

View job details

##[group]Run if [[ 'skipped' != 'success' ]]; then
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'skipped' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mif [[ 'cancelled' != 'success' ]]; then�[0m
 �[36;1m  exit 1�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mecho finished�[0m
 shell: /usr/bin/bash -e {0}
 env:
   TOOL_NODE_FLAGS: --max_old_space_size=4096
 ##[endgroup]
 ##[error]Process completed with exit code 1.
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/account-profile.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
**/*.spec.ts

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

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/tests/e2e/presence.spec.ts
apps/meteor/tests/e2e/**/*.spec.ts

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

apps/meteor/tests/e2e/**/*.spec.ts: All test files must be created in apps/meteor/tests/e2e/ directory
Avoid using page.locator() in Playwright tests - always prefer semantic locators such as page.getByRole(), page.getByLabel(), page.getByText(), or page.getByTitle()
Use test.beforeAll() and test.afterAll() for setup/teardown in Playwright tests
Use test.step() for complex test scenarios to improve organization in Playwright tests
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) for consistency in test files
Prefer web-first assertions (toBeVisible, toHaveText, etc.) in Playwright tests
Use expect matchers for assertions (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements in Playwright tests
Use page.waitFor() with specific conditions instead of hardcoded timeouts in Playwright tests
Implement proper wait strategies for dynamic content in Playwright tests
Maintain test isolation between test cases in Playwright tests
Ensure clean state for each test execution in Playwright tests
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/presence.spec.ts
apps/meteor/tests/e2e/**/*.{ts,spec.ts}

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

apps/meteor/tests/e2e/**/*.{ts,spec.ts}: Store commonly used locators in variables/constants for reuse
Follow Page Object Model pattern consistently in Playwright tests

Files:

  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/account-profile.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
apps/meteor/tests/e2e/page-objects/**/*.ts

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

Utilize existing page objects pattern from apps/meteor/tests/e2e/page-objects/

Files:

  • apps/meteor/tests/e2e/page-objects/account-profile.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
🧠 Learnings (8)
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/account-profile.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/tests/e2e/presence.spec.ts
📚 Learning: 2026-02-24T19:39:42.247Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/message.ts:7-7
Timestamp: 2026-02-24T19:39:42.247Z
Learning: In RocketChat e2e tests, avoid using data-qa attributes to locate elements. Prefer semantic locators such as getByRole, getByLabel, getByText, getByTitle and ARIA-based selectors. Apply this rule to all TypeScript files under apps/meteor/tests/e2e to improve test reliability, accessibility, and maintainability.

Applied to files:

  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/account-profile.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.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 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/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/account-profile.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.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/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/account-profile.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/tests/e2e/presence.spec.ts
📚 Learning: 2025-12-16T17:29:40.430Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37834
File: apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-emoji.ts:12-22
Timestamp: 2025-12-16T17:29:40.430Z
Learning: In all page-object files under apps/meteor/tests/e2e/page-objects/, import expect from ../../utils/test (Playwright's async expect) instead of from Jest. Jest's expect is synchronous and incompatible with web-first assertions like toBeVisible, which can cause TypeScript errors.

Applied to files:

  • apps/meteor/tests/e2e/page-objects/account-profile.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts
🪛 ast-grep (0.44.0)
apps/meteor/tests/e2e/page-objects/account-profile.ts

[warning] 56-56: Do not use variable for regular expressions
Context: new RegExp(option)
Note: [CWE-1333] Inefficient Regular Expression Complexity. Security best practice.

(regexp-non-literal-typescript)


[warning] 56-56: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(option)
Note: [CWE-1333] Inefficient Regular Expression Complexity

(regexp-from-variable)

apps/meteor/tests/e2e/page-objects/fragments/modals/edit-status-modal.ts

[warning] 56-56: Do not use variable for regular expressions
Context: new RegExp(duration)
Note: [CWE-1333] Inefficient Regular Expression Complexity. Security best practice.

(regexp-non-literal-typescript)


[warning] 56-56: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(duration)
Note: [CWE-1333] Inefficient Regular Expression Complexity

(regexp-from-variable)

Comment thread apps/meteor/tests/e2e/page-objects/account-profile.ts
Comment thread apps/meteor/tests/e2e/presence.spec.ts
Comment thread apps/meteor/tests/e2e/presence.spec.ts
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 type: feature Pull requests that introduces new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants