-
Notifications
You must be signed in to change notification settings - Fork 13k
refactor(core-typings): Reorganize types #38052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughRename of team enum to Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #38052 +/- ##
===========================================
+ Coverage 70.66% 70.68% +0.01%
===========================================
Files 3148 3148
Lines 108850 108852 +2
Branches 19628 19611 -17
===========================================
+ Hits 76924 76941 +17
+ Misses 29922 29910 -12
+ Partials 2004 2001 -3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
65f4fcb to
20aea8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/core-typings/src/IUser.ts (1)
125-137: Duplicate'google'entry indefaultOAuthKeysarray.The
'google'key appears twice in the array (lines 126 and 131), which is likely unintentional.🔎 Proposed fix
const defaultOAuthKeys: IOAuthService[] = [ 'google', 'dolphin', 'facebook', 'github', 'gitlab', - 'google', 'ldap', 'linkedin', 'nextcloud', 'saml', 'twitter', ];packages/core-typings/src/ISession.ts (1)
37-37: MakesearchTermoptional in theISessioninterface.The
searchTermfield is currently marked as required (searchTerm: string;), but the database schema treats it as optional. This is evident from the partial MongoDB index at line 983 inpackages/models/src/models/Sessions.ts, which only indexes documents wheresearchTermexists (partialFilterExpression: { searchTerm: { $exists: true } }). Not all sessions have an associated search term—only those created in a search context. Change tosearchTerm?: string;to match actual usage.
🧹 Nitpick comments (9)
apps/meteor/client/views/room/hooks/useE2EEResetRoomKey.ts (1)
30-34: Optional: Simplify error handling.The try-catch block that simply re-throws the error is redundant. Consider removing it to let the error propagate naturally:
🔎 Proposed simplification
- try { - await resetRoomKey({ rid: roomId, e2eKeyId, e2eKey }); - } catch (error) { - throw error; - } + await resetRoomKey({ rid: roomId, e2eKeyId, e2eKey });packages/core-typings/src/userAction.ts (1)
3-5: Consider converting to an interface for naming consistency.The
Iprefix traditionally indicates an interface. Since this is a simple object shape, converting tointerface IExtraswould align with the naming convention.🔎 Proposed refactor
-export type IExtras = { +export interface IExtras { tmid?: IMessage['_id']; -}; +}packages/ui-contexts/src/UserPresenceContext.ts (1)
1-12: LGTM!The inline type definition correctly replaces the removed
Subscribableimport. The default context value properly returnsundefinedfromget()and a no-op unsubscribe function.Note: Both this file and
apps/meteor/client/lib/chats/ChatAPI.tsnow define the same subscribable pattern. If more files need this shape, consider extracting a shared type.apps/meteor/tests/end-to-end/api/teams.ts (1)
3-3: TeamType migration in tests looks correct and consistent with helpersImporting
TeamTypeand passingTeamType.PUBLIC/TeamType.PRIVATEintocreateTeammatches the helper’s typed signature and removes magic numbers in these paths. You still usetype: 0/1in raw REST payloads, which is fine for now; if you ever want to further normalize, you could also swap those literals forTeamTypevalues for readability, but that’s optional and non-blocking.Also applies to: 1182-1184, 1663-1665, 1839-1841, 2336-2339, 2714-2717, 3861-3868
packages/rest-typings/src/apps/index.ts (1)
7-15: AppRequest endpoint typings are clear; consider minor type relax/tightenThe new
AppRequest/stats shapes look good and much clearer than opaque aliases. Two small, non-blocking suggestions:
meta.filtercould useAppRequestFilterinstead ofstringto reuse the union and keep end-to-end type safety.meta.limitas25 | 50 | 100is accurate today but a bit brittle; usingnumberthere would be more future‑proof if you ever allow other page sizes.Otherwise the refactor aligns well with the new core
AppRequesttypes.Also applies to: 199-210, 212-219
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts (1)
236-244: RequiredField<IUser, 'username' | 'name'> is a good centralization of the user constraintUpdating the
userparameter type inRoomSettingsSavers,save(), and the final call to useRequiredField<IUser, 'username' | 'name'>correctly expresses the existing requirement that these savers depend onusername/namebeing present. Since the user is fetched with a projection including those fields, this is a straight type‑level improvement with no runtime impact. If you later want to avoid theascast, you could type theUsers.findOneByIdcall to returnRequiredField<IUser, 'username' | 'name'>directly, but that’s purely optional.Also applies to: 405-417, 484-490, 508-517
packages/core-typings/src/Apps.ts (1)
22-28: New app/request typings are coherent; a couple of minor consistency opportunitiesThe refactors around
AppPricingPlan.tiers,AppSubscriptionInfo.license,AppOverview,FeaturedAppsSection,AppRequestFilter, andAppRequestall look internally consistent and line up with how the REST typings are using them.If you want to tighten things further (non‑blocking):
AppOverview.purchaseTypecould use the existingPurchaseTypealias instead ofstring.AppOverview.pricingPlansis structurally the same asAppPricingPlanminustiers; if the server shape really matchesAppPricingPlan, reusing that type here would reduce duplication and potential drift over time.Overall, though, this is a solid cleanup of the app and request‑related core typings.
Also applies to: 38-54, 144-225, 227-253
packages/models/src/models/Team.ts (1)
1-1: Team model now correctly exposes TeamType in its APIUsing
TeamTypeinfindByIdsAndTypeandupdateNameAndTypematches theITeam.typedefinition and makes the model interface clearer for callers. The underlying queries still operate on the sametypefield, so runtime behavior is unchanged. If you later want full consistency,findByType(type: number)could also be tightened totype: TeamType, but that’s purely a nicety.Also applies to: 66-85, 203-221
packages/model-typings/src/models/ITeamModel.ts (1)
1-1: ITeamModel typings updated to TeamType and match implementationSwitching
findByIdsAndTypeandupdateNameAndTypeto useTeamTypein the model typings brings the public interface in line withITeam.typeand theTeamRawimplementation. This is a straightforward type‑safety win with no behavioral impact. As with the raw model,findByType(type: number)could be tightened toTeamTypein a follow‑up if you want full consistency.Also applies to: 36-50, 107-107
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (117)
apps/meteor/app/api/server/v1/channels.tsapps/meteor/app/api/server/v1/teams.tsapps/meteor/app/api/server/v1/users.tsapps/meteor/app/autotranslate/server/autotranslate.tsapps/meteor/app/autotranslate/server/deeplTranslate.tsapps/meteor/app/autotranslate/server/googleTranslate.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxapps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsxapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/lib/lists/DiscussionsList.tsapps/meteor/client/meteor/minimongo/Cursor.tsapps/meteor/client/meteor/minimongo/LocalCollection.tsapps/meteor/client/views/navigation/sidepanel/SidepanelItem/useParentTeamData.tsapps/meteor/client/views/room/Header/ParentRoom/ParentTeam.tsxapps/meteor/client/views/room/contexts/ComposerPopupContext.tsapps/meteor/client/views/room/hooks/useE2EEResetRoomKey.tsapps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.tsapps/meteor/ee/server/lib/engagementDashboard/users.tsapps/meteor/lib/typedJSONParse.tsapps/meteor/server/configuration/cas.tsapps/meteor/server/lib/cas/middleware.tsapps/meteor/server/lib/rooms/roomTypes/public.tsapps/meteor/server/services/authorization/canAccessRoom.tsapps/meteor/server/services/team/service.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/users.tsapps/meteor/tests/mocks/data/marketplace.tspackages/core-services/src/types/ITeamService.tspackages/core-typings/src/AppOverview.tspackages/core-typings/src/AppRequests.tspackages/core-typings/src/Apps.tspackages/core-typings/src/FeaturedApps.tspackages/core-typings/src/IAnalytics.tspackages/core-typings/src/IAppsTokens.tspackages/core-typings/src/IAvatar.tspackages/core-typings/src/IBaseData.tspackages/core-typings/src/ILivechatMonitorRecord.tspackages/core-typings/src/ILivechatPriority.tspackages/core-typings/src/ILivechatTrigger.tspackages/core-typings/src/ILivechatVisitor.tspackages/core-typings/src/ILogItem.tspackages/core-typings/src/IMessage/IMessage.tspackages/core-typings/src/IMessage/MessageAttachment/FieldProps.tspackages/core-typings/src/IMessage/MessageAttachment/Files/Dimensions.tspackages/core-typings/src/IMessage/MessageAttachment/Files/ImageAttachmentProps.tspackages/core-typings/src/IMessage/MessageAttachment/Files/PDFAttachmentProps.tspackages/core-typings/src/IMessage/MessageAttachment/Files/index.tspackages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentDefault.tspackages/core-typings/src/IMessage/MessageAttachment/TranslatedMessageAttachment.tspackages/core-typings/src/IMessage/MessageAttachment/index.tspackages/core-typings/src/IModerationReport.tspackages/core-typings/src/IOembed.tspackages/core-typings/src/IReadReceipt.tspackages/core-typings/src/IRocketChatAssets.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/IServerEvent.tspackages/core-typings/src/ISession.tspackages/core-typings/src/ISetting.tspackages/core-typings/src/IStats.tspackages/core-typings/src/ISubscription.tspackages/core-typings/src/ITeam.tspackages/core-typings/src/IUser.tspackages/core-typings/src/IUserAction.tspackages/core-typings/src/IUserDataFile.tspackages/core-typings/src/IVideoConference.tspackages/core-typings/src/IWebdavAccount.tspackages/core-typings/src/IWorkspaceInfo.tspackages/core-typings/src/MarketplaceRest.tspackages/core-typings/src/OauthConfig.tspackages/core-typings/src/OmnichannelSortingMechanismSettingType.tspackages/core-typings/src/Serialized.tspackages/core-typings/src/ServerAudit/IAuditServerAbacAction.tspackages/core-typings/src/ServerAudit/IAuditServerSettingEvent.tspackages/core-typings/src/ServerAudit/IAuditUserChangedEvent.tspackages/core-typings/src/SpotlightUser.tspackages/core-typings/src/Subscribable.tspackages/core-typings/src/VideoConferenceOptions.tspackages/core-typings/src/autoTranslate.tspackages/core-typings/src/cloud/Announcement.tspackages/core-typings/src/cloud/NpsSurveyAnnouncement.tspackages/core-typings/src/cloud/WorkspaceSyncPayload.tspackages/core-typings/src/cloud/index.tspackages/core-typings/src/federation/v1/events.tspackages/core-typings/src/import/IImportFileData.tspackages/core-typings/src/import/IImportMessage.tspackages/core-typings/src/import/IImporterInfo.tspackages/core-typings/src/import/ImportState.tspackages/core-typings/src/import/index.tspackages/core-typings/src/index.tspackages/core-typings/src/license/ILicenseV3.tspackages/core-typings/src/license/LicensePeriod.tspackages/core-typings/src/mediaCalls/IMediaCall.tspackages/core-typings/src/migrations/IControl.tspackages/core-typings/src/omnichannel/outbound.tspackages/core-typings/src/omnichannel/routing.tspackages/core-typings/src/omnichannel/sms.tspackages/core-typings/src/themes.tspackages/core-typings/src/userAction.tspackages/core-typings/src/utils.tspackages/model-typings/src/models/IAnalyticsModel.tspackages/model-typings/src/models/ITeamModel.tspackages/models/src/models/Analytics.tspackages/models/src/models/Team.tspackages/rest-typings/src/apps/index.tspackages/rest-typings/src/helpers/IGetRoomRoles.tspackages/rest-typings/src/index.tspackages/rest-typings/src/v1/channels/channels.tspackages/rest-typings/src/v1/groups/groups.tspackages/rest-typings/src/v1/import/import.tspackages/rest-typings/src/v1/teams/TeamsUpdateProps.tspackages/ui-contexts/src/UserPresenceContext.ts
💤 Files with no reviewable changes (27)
- packages/core-typings/src/VideoConferenceOptions.ts
- packages/core-typings/src/import/index.ts
- packages/core-typings/src/ILivechatTrigger.ts
- packages/core-typings/src/IMessage/MessageAttachment/index.ts
- packages/core-typings/src/cloud/NpsSurveyAnnouncement.ts
- packages/core-typings/src/IMessage/MessageAttachment/FieldProps.ts
- packages/core-typings/src/MarketplaceRest.ts
- packages/core-typings/src/import/IImporterInfo.ts
- packages/core-typings/src/IUserAction.ts
- packages/core-typings/src/IMessage/MessageAttachment/Files/Dimensions.ts
- packages/core-typings/src/IMessage/MessageAttachment/Files/index.ts
- packages/core-typings/src/IBaseData.ts
- packages/core-typings/src/OmnichannelSortingMechanismSettingType.ts
- packages/core-typings/src/FeaturedApps.ts
- packages/core-typings/src/ILivechatMonitorRecord.ts
- packages/core-typings/src/IMessage/MessageAttachment/Files/PDFAttachmentProps.ts
- packages/core-typings/src/Serialized.ts
- packages/core-typings/src/Subscribable.ts
- packages/core-typings/src/cloud/Announcement.ts
- packages/core-typings/src/import/IImportFileData.ts
- packages/core-typings/src/AppOverview.ts
- packages/core-typings/src/IOembed.ts
- packages/core-typings/src/autoTranslate.ts
- packages/core-typings/src/AppRequests.ts
- apps/meteor/lib/typedJSONParse.ts
- apps/meteor/server/configuration/cas.ts
- packages/core-typings/src/ILivechatPriority.ts
🧰 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:
packages/rest-typings/src/helpers/IGetRoomRoles.tspackages/core-typings/src/IUserDataFile.tsapps/meteor/server/services/authorization/canAccessRoom.tspackages/core-typings/src/license/LicensePeriod.tspackages/core-typings/src/ITeam.tsapps/meteor/tests/end-to-end/api/users.tspackages/core-typings/src/IMessage/MessageAttachment/TranslatedMessageAttachment.tspackages/core-typings/src/userAction.tsapps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.tspackages/core-typings/src/IWorkspaceInfo.tsapps/meteor/tests/end-to-end/api/miscellaneous.tspackages/core-typings/src/omnichannel/routing.tspackages/core-services/src/types/ITeamService.tspackages/core-typings/src/mediaCalls/IMediaCall.tspackages/core-typings/src/ILivechatVisitor.tspackages/core-typings/src/themes.tspackages/core-typings/src/IAvatar.tsapps/meteor/client/meteor/minimongo/Cursor.tspackages/core-typings/src/IWebdavAccount.tsapps/meteor/client/views/navigation/sidepanel/SidepanelItem/useParentTeamData.tspackages/core-typings/src/IRocketChatAssets.tsapps/meteor/app/api/server/v1/teams.tsapps/meteor/ee/server/lib/engagementDashboard/users.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/client/views/room/Header/ParentRoom/ParentTeam.tsxapps/meteor/server/lib/cas/middleware.tspackages/core-typings/src/ILogItem.tspackages/core-typings/src/migrations/IControl.tspackages/rest-typings/src/apps/index.tspackages/core-typings/src/IServerEvent.tsapps/meteor/client/lib/chats/ChatAPI.tspackages/core-typings/src/IModerationReport.tspackages/core-typings/src/import/ImportState.tsapps/meteor/client/lib/lists/DiscussionsList.tspackages/rest-typings/src/index.tsapps/meteor/client/views/room/hooks/useE2EEResetRoomKey.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/server/services/team/service.tspackages/core-typings/src/IStats.tspackages/ui-contexts/src/UserPresenceContext.tspackages/rest-typings/src/v1/teams/TeamsUpdateProps.tspackages/core-typings/src/ISetting.tsapps/meteor/app/autotranslate/server/autotranslate.tspackages/rest-typings/src/v1/groups/groups.tspackages/core-typings/src/omnichannel/outbound.tspackages/core-typings/src/ServerAudit/IAuditServerSettingEvent.tsapps/meteor/tests/end-to-end/api/rooms.tspackages/core-typings/src/IReadReceipt.tspackages/core-typings/src/federation/v1/events.tspackages/core-typings/src/omnichannel/sms.tspackages/core-typings/src/IMessage/MessageAttachment/Files/ImageAttachmentProps.tsapps/meteor/app/api/server/v1/channels.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tspackages/model-typings/src/models/ITeamModel.tsapps/meteor/client/views/room/contexts/ComposerPopupContext.tsapps/meteor/tests/data/teams.helper.tspackages/core-typings/src/utils.tspackages/model-typings/src/models/IAnalyticsModel.tsapps/meteor/app/api/server/v1/users.tsapps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsxpackages/rest-typings/src/v1/import/import.tsapps/meteor/client/meteor/minimongo/LocalCollection.tspackages/core-typings/src/license/ILicenseV3.tsapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxpackages/rest-typings/src/v1/channels/channels.tsapps/meteor/server/lib/rooms/roomTypes/public.tsapps/meteor/tests/end-to-end/api/channels.tspackages/core-typings/src/ServerAudit/IAuditUserChangedEvent.tspackages/core-typings/src/cloud/index.tspackages/core-typings/src/IVideoConference.tspackages/models/src/models/Team.tsapps/meteor/app/autotranslate/server/googleTranslate.tspackages/core-typings/src/IMessage/IMessage.tspackages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentDefault.tsapps/meteor/app/autotranslate/server/deeplTranslate.tspackages/core-typings/src/IRoom.tspackages/models/src/models/Analytics.tspackages/core-typings/src/ServerAudit/IAuditServerAbacAction.tspackages/core-typings/src/Apps.tsapps/meteor/tests/mocks/data/marketplace.tspackages/core-typings/src/SpotlightUser.tspackages/core-typings/src/ISubscription.tspackages/core-typings/src/cloud/WorkspaceSyncPayload.tspackages/core-typings/src/import/IImportMessage.tspackages/core-typings/src/IUser.tspackages/core-typings/src/index.tspackages/core-typings/src/ISession.tspackages/core-typings/src/IAnalytics.ts
🧠 Learnings (32)
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings (mapping subscription documents to room IDs), never undefined, even when user has no room subscriptions.
Applied to files:
packages/rest-typings/src/helpers/IGetRoomRoles.tsapps/meteor/tests/end-to-end/api/users.tsapps/meteor/client/views/room/hooks/useE2EEResetRoomKey.tspackages/ui-contexts/src/UserPresenceContext.tsapps/meteor/app/api/server/v1/channels.tspackages/core-typings/src/IMessage/IMessage.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/ISubscription.tspackages/core-typings/src/IUser.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings by mapping subscription documents to room IDs, never undefined, even when user has no room subscriptions.
Applied to files:
packages/rest-typings/src/helpers/IGetRoomRoles.tsapps/meteor/tests/end-to-end/api/users.tspackages/ui-contexts/src/UserPresenceContext.tsapps/meteor/app/api/server/v1/channels.tspackages/core-typings/src/IMessage/IMessage.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/ISubscription.tspackages/core-typings/src/IUser.ts
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.
Applied to files:
packages/rest-typings/src/helpers/IGetRoomRoles.tsapps/meteor/server/services/authorization/canAccessRoom.tsapps/meteor/client/views/room/Header/ParentRoom/ParentTeam.tsxapps/meteor/client/views/room/hooks/useE2EEResetRoomKey.tsapps/meteor/app/api/server/v1/channels.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/server/lib/rooms/roomTypes/public.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/ServerAudit/IAuditServerAbacAction.tspackages/core-typings/src/ISubscription.ts
📚 Learning: 2025-10-24T17:32:05.348Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37299
File: apps/meteor/ee/server/lib/ldap/Manager.ts:438-454
Timestamp: 2025-10-24T17:32:05.348Z
Learning: In Rocket.Chat, ABAC attributes can only be set on private rooms and teams (type 'p'), not on public rooms (type 'c'). Therefore, when checking for ABAC-protected rooms/teams during LDAP sync or similar operations, it's sufficient to query only private rooms using methods like `findPrivateRoomsByIdsWithAbacAttributes`.
Applied to files:
apps/meteor/server/services/authorization/canAccessRoom.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/server/services/team/service.tsapps/meteor/app/api/server/v1/channels.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/server/lib/rooms/roomTypes/public.ts
📚 Learning: 2025-10-27T14:38:46.994Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37303
File: apps/meteor/tests/end-to-end/api/abac.ts:1125-1137
Timestamp: 2025-10-27T14:38:46.994Z
Learning: In Rocket.Chat ABAC feature, when ABAC is disabled globally (ABAC_Enabled setting is false), room-level ABAC attributes are not evaluated when changing room types. This means converting a private room to public will succeed even if the room has ABAC attributes, as long as the global ABAC setting is disabled.
Applied to files:
apps/meteor/server/services/authorization/canAccessRoom.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tspackages/core-typings/src/ServerAudit/IAuditServerAbacAction.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts
Applied to files:
apps/meteor/tests/end-to-end/api/users.tsapps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`
Applied to files:
apps/meteor/tests/end-to-end/api/users.tsapps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/tests/mocks/data/marketplace.ts
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.
Applied to files:
apps/meteor/tests/end-to-end/api/users.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/client/views/room/Header/ParentRoom/ParentTeam.tsxapps/meteor/client/views/room/hooks/useE2EEResetRoomKey.tsapps/meteor/server/services/team/service.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/app/api/server/v1/channels.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/server/lib/rooms/roomTypes/public.tspackages/core-typings/src/IMessage/IMessage.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/ISubscription.ts
📚 Learning: 2025-10-16T21:09:51.816Z
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 36942
File: apps/meteor/client/lib/e2ee/keychain.ts:148-156
Timestamp: 2025-10-16T21:09:51.816Z
Learning: In the RocketChat/Rocket.Chat repository, only platforms with native crypto.randomUUID() support are targeted, so fallback implementations for crypto.randomUUID() are not required in E2EE or cryptographic code.
Applied to files:
apps/meteor/tests/end-to-end/api/users.ts
📚 Learning: 2025-10-06T20:32:23.658Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/utilities.ts:557-573
Timestamp: 2025-10-06T20:32:23.658Z
Learning: In packages/apps-engine/tests/test-data/utilities.ts, the field name `isSubscripbedViaBundle` in the `IMarketplaceSubscriptionInfo` type should not be flagged as a typo, as it may match the upstream API's field name.
Applied to files:
apps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.tsapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.tspackages/core-typings/src/Apps.tsapps/meteor/tests/mocks/data/marketplace.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/tests/mocks/data/marketplace.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory
Applied to files:
apps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-12-16T17:29:45.163Z
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:45.163Z
Learning: In page object files under `apps/meteor/tests/e2e/page-objects/`, always import `expect` from `../../utils/test` (Playwright's async expect), not from Jest. Jest's `expect` has a synchronous signature and will cause TypeScript errors when used with web-first assertions like `toBeVisible()`.
Applied to files:
apps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file
Applied to files:
apps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/miscellaneous.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.
Applied to files:
apps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-12-18T15:18:31.688Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37773
File: apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx:24-34
Timestamp: 2025-12-18T15:18:31.688Z
Learning: In apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx, for internal call history items, the item.contactId is guaranteed to always match either the caller.id or callee.id in the call data, so the contact resolution in getContact will never result in undefined.
Applied to files:
packages/core-typings/src/mediaCalls/IMediaCall.tspackages/core-typings/src/ILivechatVisitor.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/teams.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.beforeAll()` and `test.afterAll()` for setup/teardown in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/teams.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/teams.ts
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.
Applied to files:
apps/meteor/server/lib/cas/middleware.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/server/lib/rooms/roomTypes/public.ts
📚 Learning: 2025-09-16T13:33:49.237Z
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 36890
File: apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts:21-26
Timestamp: 2025-09-16T13:33:49.237Z
Learning: The im.delete API endpoint accepts either a `roomId` parameter (requiring the actual DM room _id) or a `username` parameter (for the DM partner's username). Constructing slug-like identifiers like `user2${Users.userE2EE.data.username}` doesn't work for this endpoint.
Applied to files:
apps/meteor/client/views/room/hooks/useE2EEResetRoomKey.tspackages/core-typings/src/IRoom.ts
📚 Learning: 2025-09-16T13:33:49.237Z
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 36890
File: apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts:21-26
Timestamp: 2025-09-16T13:33:49.237Z
Learning: In Rocket.Chat test files, the im.delete API endpoint accepts either a `roomId` parameter (requiring the actual DM room _id) or a `username` parameter (for the DM partner's username). It does not accept slug-like constructions such as concatenating usernames together.
Applied to files:
apps/meteor/client/views/room/hooks/useE2EEResetRoomKey.tspackages/core-typings/src/IRoom.ts
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
Applied to files:
apps/meteor/app/autotranslate/server/autotranslate.tsapps/meteor/app/autotranslate/server/googleTranslate.tsapps/meteor/app/autotranslate/server/deeplTranslate.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Applied to files:
packages/core-typings/src/utils.ts
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
Applied to files:
apps/meteor/app/api/server/v1/users.ts
📚 Learning: 2025-11-16T19:09:43.823Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37496
File: packages/apps-engine/tests/server/runtime/deno/LivenessManager.spec.ts:3-3
Timestamp: 2025-11-16T19:09:43.823Z
Learning: In Node.js, `EventEmitter` can be imported from either the 'events' module or the 'stream' module—both export the same reference. While 'events' is the canonical module, importing from 'stream' is valid and works correctly.
Applied to files:
packages/core-typings/src/ServerAudit/IAuditUserChangedEvent.ts
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.
Applied to files:
apps/meteor/app/autotranslate/server/deeplTranslate.ts
📚 Learning: 2025-10-06T20:30:45.540Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/storage/storage.ts:101-122
Timestamp: 2025-10-06T20:30:45.540Z
Learning: In `packages/apps-engine/tests/test-data/storage/storage.ts`, the stub methods (updatePartialAndReturnDocument, updateStatus, updateSetting, updateAppInfo, updateMarketplaceInfo) intentionally throw "Method not implemented." Tests using these methods must stub them using `SpyOn` from the test library rather than relying on actual implementations.
Applied to files:
apps/meteor/tests/mocks/data/marketplace.ts
📚 Learning: 2025-12-09T20:01:07.355Z
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 37532
File: ee/packages/federation-matrix/src/FederationMatrix.ts:920-927
Timestamp: 2025-12-09T20:01:07.355Z
Learning: In Rocket.Chat's federation invite handling (ee/packages/federation-matrix/src/FederationMatrix.ts), when a user rejects an invite via federationSDK.rejectInvite(), the subscription cleanup happens automatically through an event-driven flow: Matrix emits a leave event back, which is processed by handleLeave() in ee/packages/federation-matrix/src/events/member.ts, and that function calls Room.performUserRemoval() to clean up the subscription. No explicit cleanup is needed in the reject branch of handleInvite() because the leave event handler takes care of it.
<!-- </add_learning>
Applied to files:
packages/core-typings/src/ISubscription.ts
🧬 Code graph analysis (26)
apps/meteor/tests/end-to-end/api/miscellaneous.ts (1)
apps/meteor/tests/data/teams.helper.ts (1)
createTeam(5-21)
packages/core-typings/src/mediaCalls/IMediaCall.ts (1)
packages/core-typings/src/utils.ts (1)
RequiredField(21-21)
apps/meteor/tests/end-to-end/api/teams.ts (1)
apps/meteor/tests/data/teams.helper.ts (1)
createTeam(5-21)
apps/meteor/server/lib/cas/middleware.ts (1)
packages/core-typings/src/utils.ts (1)
RequiredField(21-21)
packages/rest-typings/src/apps/index.ts (1)
packages/core-typings/src/Apps.ts (2)
AppRequestFilter(227-227)AppRequest(237-253)
packages/core-typings/src/IServerEvent.ts (3)
packages/core-typings/src/ServerAudit/IAuditServerAbacAction.ts (5)
IServerEventAbacSubjectAttributeChanged(22-27)IServerEventAbacObjectAttributeChanged(29-38)IServerEventAbacAttributeChanged(40-49)IServerEventAbacActionPerformed(51-59)IServerEventAbacObjectAttributesRemoved(61-70)packages/core-typings/src/ServerAudit/IAuditServerSettingEvent.ts (1)
IServerEventSettingsChanged(4-20)packages/core-typings/src/ServerAudit/IAuditUserChangedEvent.ts (1)
IServerEventUserChanged(7-26)
apps/meteor/client/lib/chats/ChatAPI.ts (1)
packages/livechat/src/widget.ts (1)
callback(509-511)
apps/meteor/client/lib/lists/DiscussionsList.ts (1)
packages/core-typings/src/utils.ts (1)
Optional(1-1)
apps/meteor/client/views/room/hooks/useE2EEResetRoomKey.ts (1)
packages/core-typings/src/IRoom.ts (1)
IRoom(12-85)
apps/meteor/tests/end-to-end/api/incoming-integrations.ts (1)
apps/meteor/tests/data/teams.helper.ts (1)
createTeam(5-21)
packages/ui-contexts/src/UserPresenceContext.ts (1)
packages/core-typings/src/IUser.ts (1)
UserPresence(285-287)
apps/meteor/app/autotranslate/server/autotranslate.ts (1)
packages/core-typings/src/autoTranslate.ts (1)
ISupportedLanguage(10-13)
apps/meteor/tests/end-to-end/api/rooms.ts (1)
apps/meteor/tests/data/teams.helper.ts (1)
createTeam(5-21)
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts (1)
packages/core-typings/src/utils.ts (1)
RequiredField(21-21)
packages/model-typings/src/models/ITeamModel.ts (1)
packages/core-typings/src/ITeam.ts (1)
ITeam(14-20)
packages/model-typings/src/models/IAnalyticsModel.ts (1)
packages/core-typings/src/IAnalytics.ts (1)
IAnalytics(27-27)
apps/meteor/client/meteor/minimongo/LocalCollection.ts (2)
packages/core-typings/src/utils.ts (1)
Optional(1-1)apps/meteor/client/meteor/minimongo/common.ts (1)
clone(11-49)
apps/meteor/tests/end-to-end/api/channels.ts (1)
apps/meteor/tests/data/teams.helper.ts (1)
createTeam(5-21)
packages/models/src/models/Team.ts (1)
packages/core-typings/src/ITeam.ts (1)
ITeam(14-20)
packages/core-typings/src/IMessage/IMessage.ts (1)
packages/core-typings/src/IRoom.ts (1)
IRoom(12-85)
packages/core-typings/src/IRoom.ts (1)
packages/core-typings/src/IUser.ts (1)
IUser(169-239)
packages/models/src/models/Analytics.ts (2)
packages/core-typings/src/IAnalytics.ts (1)
IAnalytics(27-27)packages/model-typings/src/models/IAnalyticsModel.ts (1)
IAnalyticsModel(7-50)
packages/core-typings/src/ServerAudit/IAuditServerAbacAction.ts (2)
packages/core-typings/src/IServerEvent.ts (1)
IAuditServerEventType(65-67)packages/core-typings/src/IAbacAttribute.ts (1)
IAbacAttributeDefinition(3-14)
packages/core-typings/src/SpotlightUser.ts (1)
packages/core-typings/src/IUser.ts (1)
IUser(169-239)
packages/core-typings/src/ISubscription.ts (1)
packages/core-typings/src/IRoom.ts (1)
IRoom(12-85)
packages/core-typings/src/IUser.ts (1)
packages/core-services/src/index.ts (1)
IUserService(147-147)
⏰ 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). (4)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
There was a problem hiding this 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 117 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/meteor/client/lib/lists/DiscussionsList.ts">
<violation number="1" location="apps/meteor/client/lib/lists/DiscussionsList.ts:6">
P1: Incorrect type replacement - `Optional` makes `drid` **optional**, but the original type made it **required**. A `DiscussionMessage` must have a `drid` (discussion room ID) by definition. The correct utility type should be `RequiredField<IMessage, 'drid'>` which preserves the original semantics.</violation>
</file>
<file name="packages/core-typings/src/utils.ts">
<violation number="1" location="packages/core-typings/src/utils.ts:63">
P2: The tuple element serialization check is incorrect. The condition `T extends UnserializablePrimitive` checks the entire tuple type instead of each element. Should be `T[K] extends UnserializablePrimitive` to properly handle tuples containing unserializable elements.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
20aea8e to
6938ae3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts (1)
484-512: Consider adding runtime validation for required user fields.The type assertion on line 512 assumes
usernameandnameare non-null, but there's no runtime check after fetching the user (line 484) to verify these fields exist. While this pattern is pre-existing and Rocket.Chat users typically have these fields, adding a runtime validation would strengthen type safety:💡 Optional enhancement
const user = await Users.findOneById(userId, { projection: { username: 1, name: 1 } }); -if (!user) { +if (!user || !user.username || !user.name) { throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'saveRoomSettings', }); }
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/client/meteor/minimongo/Cursor.tsapps/meteor/client/meteor/minimongo/LocalCollection.tsapps/meteor/client/views/room/contexts/ComposerPopupContext.tsapps/meteor/server/lib/cas/middleware.tspackages/core-typings/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/meteor/client/meteor/minimongo/LocalCollection.ts
- apps/meteor/client/meteor/minimongo/Cursor.ts
🧰 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/client/views/room/contexts/ComposerPopupContext.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/server/lib/cas/middleware.tspackages/core-typings/src/index.ts
🧠 Learnings (5)
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.
Applied to files:
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/server/lib/cas/middleware.ts
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.
Applied to files:
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
📚 Learning: 2025-10-24T17:32:05.348Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37299
File: apps/meteor/ee/server/lib/ldap/Manager.ts:438-454
Timestamp: 2025-10-24T17:32:05.348Z
Learning: In Rocket.Chat, ABAC attributes can only be set on private rooms and teams (type 'p'), not on public rooms (type 'c'). Therefore, when checking for ABAC-protected rooms/teams during LDAP sync or similar operations, it's sufficient to query only private rooms using methods like `findPrivateRoomsByIdsWithAbacAttributes`.
Applied to files:
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.
Applied to files:
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
📚 Learning: 2025-10-27T14:38:46.994Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37303
File: apps/meteor/tests/end-to-end/api/abac.ts:1125-1137
Timestamp: 2025-10-27T14:38:46.994Z
Learning: In Rocket.Chat ABAC feature, when ABAC is disabled globally (ABAC_Enabled setting is false), room-level ABAC attributes are not evaluated when changing room types. This means converting a private room to public will succeed even if the room has ABAC attributes, as long as the global ABAC setting is disabled.
Applied to files:
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
🧬 Code graph analysis (3)
apps/meteor/client/views/room/contexts/ComposerPopupContext.ts (1)
packages/core-typings/src/utils.ts (1)
Optional(1-1)
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts (1)
packages/core-typings/src/utils.ts (1)
RequiredField(21-21)
apps/meteor/server/lib/cas/middleware.ts (1)
packages/core-typings/src/utils.ts (1)
RequiredField(21-21)
⏰ 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). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (8)
apps/meteor/server/lib/cas/middleware.ts (1)
5-5: LGTM! Clean refactoring to use shared utility type.The change from
IncomingMessage & Required<Pick<IncomingMessage, 'url'>>toRequiredField<IncomingMessage, 'url'>improves readability and aligns with the PR's standardization objectives. The types are semantically equivalent, and the type assertion at line 90 remains safe due to the guard check at lines 68-70.Also applies to: 18-18
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts (4)
2-3: LGTM! Clean import additions.The new imports for
RequiredFieldandTeamTypeare necessary for the type refactoring throughout the file and are correctly structured.
71-71: Consistent enum migration.The migration from
TEAM_TYPE.PRIVATEtoTeamType.PRIVATEaligns with the PR's standardization effort and maintains the same behavior.
239-239: Excellent use of the RequiredField utility type.Replacing the verbose
IUser & Required<Pick<IUser, 'username' | 'name'>>withRequiredField<IUser, 'username' | 'name'>improves readability while maintaining identical semantics.Also applies to: 409-409
254-254: LGTM! TeamType enum usage is consistent.The room type to team type mappings correctly use
TeamType.PUBLICfor channels ('c') andTeamType.PRIVATEfor private groups ('p'), consistent with the enum migration.Also applies to: 299-299
packages/core-typings/src/index.ts (2)
134-134: Export is valid and non-breaking.The module
ServerAudit/IAuditUserChangedEvent.tsexists and properly exportsIServerEventUserChanged. This additive export introduces no breaking changes.
14-14: No issues found. The export path refactoring is complete with all old module files removed, new module files in place, and no broken imports in the codebase. All consumers have been updated.apps/meteor/client/views/room/contexts/ComposerPopupContext.ts (1)
1-1: Verify theOptionalutility type semantics.The
Optional<T, K>type is defined asOmit<T, K> & Partial<T>, which makes all properties ofToptional, not just the keyK. This differs semantically from the old typeOmit<T, 'getValue'> & Partial<Pick<T, 'getValue'>>, which made onlygetValueoptional while preserving the required/optional state of other properties.In this specific case, the change works because
getValueis the only required property inComposerPopupOption<T>(all others are already optional with?), so both old and new types effectively result in all properties being optional.However, the utility type name
Optional<T, K>suggests it makes onlyKoptional, when it actually makes everything optional viaPartial<T>. While this behavior appears intentional across the codebase (used in database models, services, and configurations for partial/optional document patterns), the naming is semantically misleading and could cause confusion for future maintenance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Fix all issues with AI Agents 🤖
In @packages/core-typings/src/utils.ts:
- Around line 56-72: The Serialized<T> conditional type treats functions as
objects because the `T extends object` branch comes before checking for
unserializable primitives; move the `T extends UnserializablePrimitive` (and `T
extends SerializablePrimitive`) checks so they run before the `T extends object`
branch (or explicitly add `T extends Function ? undefined`), ensuring that
function types (and other unserializable primitives defined by
UnserializablePrimitive) resolve to undefined/null like JSON.stringify does
instead of producing an object mapping; update the conditional order in the
Serialized<T> definition (references: Serialized<T>, UnserializablePrimitive,
SerializablePrimitive, CustomSerializable) accordingly.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/core-typings/src/utils.ts
🧰 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:
packages/core-typings/src/utils.ts
🧠 Learnings (1)
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Applied to files:
packages/core-typings/src/utils.ts
⏰ 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). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (2)
packages/core-typings/src/utils.ts (2)
12-21: Well-documented utility types.The JSDoc comments clearly explain the use cases for
AtLeastandRequiredField, making these utilities easy to understand and apply correctly.
43-45: Clean branding implementation.The nominal typing pattern using unique symbols is a standard and effective approach for creating branded types in TypeScript.
a7c80e4 to
485670e
Compare
75d8d8c to
49aaf35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🤖 Fix all issues with AI Agents
In @packages/core-typings/src/license/LicensePeriod.ts:
- Line 4: Remove the unused exported type by deleting the exported Timestamp
type declaration (Timestamp) from LicensePeriod.ts; ensure no other code relies
on it and, if the file only contained that export, remove the file or adjust
remaining exports accordingly so there are no dangling/unused exports.
In @packages/rest-typings/src/apps/index.ts:
- Around line 200-209: The GET handler's input types allow limit?: number while
the response meta.limit is restricted to 25 | 50 | 100; update the GET params
signature (the GET: (params: { appId: string; q?: AppRequestFilter; sort?:
string; limit?: number }) => ...) so the limit parameter is typed as limit?: 25
| 50 | 100 to match the response contract and prevent callers from passing
unsupported numeric values; ensure any callers are updated to pass only those
literal values or validate/convert inputs before calling this method.
🧹 Nitpick comments (7)
packages/core-typings/src/Apps.ts (2)
193-193: Avoidanytype for better type safety.Using
any[]undermines TypeScript's type checking. Consider typing this properly, e.g.,string[]if these are app IDs.🔎 Proposed fix
- bundledAppIds: any[]; + bundledAppIds: string[];
204-212: Use the existingPurchaseTypeunion for consistency.
purchaseTypeshould use thePurchaseTypetype defined at line 61 instead of a plainstringto maintain type consistency with theApptype.Additionally, the inline
pricingPlanstype omits thetiersproperty present inAppPricingPlan. Consider reusingAppPricingPlanif the structures should align, or document if this omission is intentional for overview purposes.🔎 Proposed fix
- purchaseType: string; - pricingPlans: { - id: string; - enabled: boolean; - price: number; - trialDays: number; - strategy: string; - isPerSeat: boolean; - }[]; + purchaseType: PurchaseType; + pricingPlans: Omit<AppPricingPlan, 'tiers'>[];packages/rest-typings/src/apps/index.ts (1)
213-218: Consider extracting the inline return type if reused elsewhere.The inline return type is clear and correct. If this structure is used in multiple endpoints or consumed by multiple clients, consider extracting it to a named type for better reusability:
export type AppRequestStats = { data: { totalSeen: number; totalUnseen: number; }; };Otherwise, the inline definition is acceptable for a single-use case.
packages/core-typings/src/IUserDataFile.ts (1)
3-3: Consider the value of converting to an empty interface.Converting from a type alias to an empty interface that only extends
IUploaddoesn't provide clear benefits unless you plan to add properties later or require declaration merging. Type aliases are more explicit for simple re-exports.packages/core-typings/src/IWebdavAccount.ts (1)
15-23: Consider retaining as a type alias.The conversion from a type alias to an interface for
IWebdavNodedoesn't provide obvious benefits. For simple object shapes without inheritance requirements or declaration merging needs, type aliases are equally valid and more explicit about being a fixed structure.apps/meteor/tests/end-to-end/api/teams.ts (1)
3-3: TeamType usage in teams API tests aligns with shared helper typingsUsing
TeamType.PUBLIC/TeamType.PRIVATEfor thecreateTeamhelper and importingTeamTypealongside the existing core typings keeps these tests type-safe and consistent with the updated helper signature.As a follow-up (non-blocking), you could replace remaining
type: 0/1usages in directteams.createcalls with the correspondingTeamTypemembers for consistency and stronger typing; verify with a TS build that all call sites still compile cleanly.Also applies to: 1182-1184, 1663-1665, 1840-1841, 2337-2339, 2715-2717
packages/models/src/models/Team.ts (1)
1-1: TeamRaw now typed directly against TeamType for ID/type queries and updatesSwitching
findByIdsAndTypeandupdateNameAndTypeto accepttype: TeamType(imported as a type) aligns this model withITeam['type']and the rest of the core typings, while keeping the Mongo queries unchanged and correctly handlingtype = 0via explicittypeof ... !== 'undefined'checks.Optionally, you could later narrow
findByType(type: number)totype: TeamTypefor full consistency withITeam, then run TS checks to confirm all callers satisfy the stricter signature.Also applies to: 66-69, 72-80, 203-221
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (117)
apps/meteor/app/api/server/v1/channels.tsapps/meteor/app/api/server/v1/teams.tsapps/meteor/app/api/server/v1/users.tsapps/meteor/app/autotranslate/server/autotranslate.tsapps/meteor/app/autotranslate/server/deeplTranslate.tsapps/meteor/app/autotranslate/server/googleTranslate.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.tsapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxapps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsxapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/meteor/minimongo/Cursor.tsapps/meteor/client/meteor/minimongo/LocalCollection.tsapps/meteor/client/views/navigation/sidepanel/SidepanelItem/useParentTeamData.tsapps/meteor/client/views/room/Header/ParentRoom/ParentTeam.tsxapps/meteor/client/views/room/contexts/ComposerPopupContext.tsapps/meteor/client/views/room/hooks/useE2EEResetRoomKey.tsapps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.tsapps/meteor/ee/server/lib/engagementDashboard/users.tsapps/meteor/lib/typedJSONParse.tsapps/meteor/server/configuration/cas.tsapps/meteor/server/lib/cas/middleware.tsapps/meteor/server/lib/rooms/roomTypes/public.tsapps/meteor/server/services/authorization/canAccessRoom.tsapps/meteor/server/services/team/service.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/rooms.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/users.tsapps/meteor/tests/mocks/data/marketplace.tspackages/core-services/src/types/ITeamService.tspackages/core-typings/src/AppOverview.tspackages/core-typings/src/AppRequests.tspackages/core-typings/src/Apps.tspackages/core-typings/src/FeaturedApps.tspackages/core-typings/src/IAnalytics.tspackages/core-typings/src/IAppsTokens.tspackages/core-typings/src/IAvatar.tspackages/core-typings/src/IBaseData.tspackages/core-typings/src/ILivechatMonitorRecord.tspackages/core-typings/src/ILivechatPriority.tspackages/core-typings/src/ILivechatTrigger.tspackages/core-typings/src/ILivechatVisitor.tspackages/core-typings/src/ILogItem.tspackages/core-typings/src/IMessage/IMessage.tspackages/core-typings/src/IMessage/MessageAttachment/FieldProps.tspackages/core-typings/src/IMessage/MessageAttachment/Files/Dimensions.tspackages/core-typings/src/IMessage/MessageAttachment/Files/ImageAttachmentProps.tspackages/core-typings/src/IMessage/MessageAttachment/Files/PDFAttachmentProps.tspackages/core-typings/src/IMessage/MessageAttachment/Files/index.tspackages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentDefault.tspackages/core-typings/src/IMessage/MessageAttachment/TranslatedMessageAttachment.tspackages/core-typings/src/IMessage/MessageAttachment/index.tspackages/core-typings/src/IModerationReport.tspackages/core-typings/src/IOembed.tspackages/core-typings/src/IReadReceipt.tspackages/core-typings/src/IRocketChatAssets.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/IServerEvent.tspackages/core-typings/src/ISession.tspackages/core-typings/src/ISetting.tspackages/core-typings/src/IStats.tspackages/core-typings/src/ISubscription.tspackages/core-typings/src/ITeam.tspackages/core-typings/src/IUser.tspackages/core-typings/src/IUserAction.tspackages/core-typings/src/IUserDataFile.tspackages/core-typings/src/IVideoConference.tspackages/core-typings/src/IWebdavAccount.tspackages/core-typings/src/IWorkspaceInfo.tspackages/core-typings/src/MarketplaceRest.tspackages/core-typings/src/OauthConfig.tspackages/core-typings/src/OmnichannelSortingMechanismSettingType.tspackages/core-typings/src/Serialized.tspackages/core-typings/src/ServerAudit/IAuditServerAbacAction.tspackages/core-typings/src/ServerAudit/IAuditServerSettingEvent.tspackages/core-typings/src/ServerAudit/IAuditUserChangedEvent.tspackages/core-typings/src/SpotlightUser.tspackages/core-typings/src/Subscribable.tspackages/core-typings/src/VideoConferenceOptions.tspackages/core-typings/src/autoTranslate.tspackages/core-typings/src/cloud/Announcement.tspackages/core-typings/src/cloud/NpsSurveyAnnouncement.tspackages/core-typings/src/cloud/WorkspaceSyncPayload.tspackages/core-typings/src/cloud/index.tspackages/core-typings/src/federation/v1/events.tspackages/core-typings/src/import/IImportFileData.tspackages/core-typings/src/import/IImportMessage.tspackages/core-typings/src/import/IImporterInfo.tspackages/core-typings/src/import/ImportState.tspackages/core-typings/src/import/index.tspackages/core-typings/src/index.tspackages/core-typings/src/license/ILicenseV3.tspackages/core-typings/src/license/LicensePeriod.tspackages/core-typings/src/mediaCalls/IMediaCall.tspackages/core-typings/src/migrations/IControl.tspackages/core-typings/src/omnichannel/outbound.tspackages/core-typings/src/omnichannel/routing.tspackages/core-typings/src/omnichannel/sms.tspackages/core-typings/src/themes.tspackages/core-typings/src/userAction.tspackages/core-typings/src/utils.tspackages/model-typings/src/models/IAnalyticsModel.tspackages/model-typings/src/models/ITeamModel.tspackages/models/src/models/Analytics.tspackages/models/src/models/Team.tspackages/rest-typings/src/apps/index.tspackages/rest-typings/src/helpers/IGetRoomRoles.tspackages/rest-typings/src/index.tspackages/rest-typings/src/v1/channels/channels.tspackages/rest-typings/src/v1/groups/groups.tspackages/rest-typings/src/v1/import/import.tspackages/rest-typings/src/v1/teams/TeamsUpdateProps.tspackages/ui-contexts/src/UserPresenceContext.ts
💤 Files with no reviewable changes (27)
- packages/core-typings/src/Subscribable.ts
- packages/core-typings/src/import/index.ts
- packages/core-typings/src/ILivechatTrigger.ts
- apps/meteor/server/configuration/cas.ts
- apps/meteor/lib/typedJSONParse.ts
- packages/core-typings/src/IUserAction.ts
- packages/core-typings/src/IMessage/MessageAttachment/Files/Dimensions.ts
- packages/core-typings/src/cloud/Announcement.ts
- packages/core-typings/src/import/IImportFileData.ts
- packages/core-typings/src/import/IImporterInfo.ts
- packages/core-typings/src/cloud/NpsSurveyAnnouncement.ts
- packages/core-typings/src/autoTranslate.ts
- packages/core-typings/src/VideoConferenceOptions.ts
- packages/core-typings/src/IMessage/MessageAttachment/Files/index.ts
- packages/core-typings/src/ILivechatPriority.ts
- packages/core-typings/src/IMessage/MessageAttachment/Files/PDFAttachmentProps.ts
- packages/core-typings/src/AppOverview.ts
- packages/core-typings/src/IOembed.ts
- packages/core-typings/src/IMessage/MessageAttachment/FieldProps.ts
- packages/core-typings/src/IMessage/MessageAttachment/index.ts
- packages/core-typings/src/AppRequests.ts
- packages/core-typings/src/MarketplaceRest.ts
- packages/core-typings/src/ILivechatMonitorRecord.ts
- packages/core-typings/src/FeaturedApps.ts
- packages/core-typings/src/Serialized.ts
- packages/core-typings/src/IBaseData.ts
- packages/core-typings/src/OmnichannelSortingMechanismSettingType.ts
✅ Files skipped from review due to trivial changes (1)
- packages/core-typings/src/omnichannel/routing.ts
🚧 Files skipped from review as they are similar to previous changes (42)
- apps/meteor/client/meteor/minimongo/LocalCollection.ts
- packages/core-typings/src/federation/v1/events.ts
- apps/meteor/app/autotranslate/server/autotranslate.ts
- apps/meteor/server/services/authorization/canAccessRoom.ts
- packages/core-typings/src/ILivechatVisitor.ts
- apps/meteor/tests/mocks/data/marketplace.ts
- apps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.ts
- packages/core-typings/src/SpotlightUser.ts
- apps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsx
- apps/meteor/app/autotranslate/server/googleTranslate.ts
- packages/core-typings/src/ITeam.ts
- packages/rest-typings/src/index.ts
- apps/meteor/server/lib/rooms/roomTypes/public.ts
- apps/meteor/app/api/server/v1/teams.ts
- apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
- apps/meteor/server/services/team/service.ts
- packages/core-typings/src/IMessage/MessageAttachment/Files/ImageAttachmentProps.ts
- apps/meteor/tests/end-to-end/api/rooms.ts
- apps/meteor/server/lib/cas/middleware.ts
- packages/core-typings/src/IVideoConference.ts
- packages/rest-typings/src/v1/teams/TeamsUpdateProps.ts
- packages/core-typings/src/migrations/IControl.ts
- apps/meteor/client/lib/chats/ChatAPI.ts
- packages/model-typings/src/models/ITeamModel.ts
- apps/meteor/app/api/server/v1/users.ts
- apps/meteor/tests/end-to-end/api/incoming-integrations.ts
- packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentDefault.ts
- packages/core-typings/src/userAction.ts
- packages/core-typings/src/cloud/index.ts
- apps/meteor/client/views/room/hooks/useE2EEResetRoomKey.ts
- apps/meteor/tests/data/teams.helper.ts
- apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts
- apps/meteor/tests/end-to-end/api/miscellaneous.ts
- packages/core-services/src/types/ITeamService.ts
- apps/meteor/client/views/room/Header/ParentRoom/ParentTeam.tsx
- packages/core-typings/src/themes.ts
- packages/core-typings/src/IReadReceipt.ts
- packages/core-typings/src/IWorkspaceInfo.ts
- apps/meteor/client/views/room/contexts/ComposerPopupContext.ts
- packages/core-typings/src/omnichannel/outbound.ts
- apps/meteor/client/meteor/minimongo/Cursor.ts
- packages/core-typings/src/IStats.ts
🧰 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/app/api/server/v1/channels.tspackages/core-typings/src/ILogItem.tsapps/meteor/tests/end-to-end/api/teams.tspackages/core-typings/src/ServerAudit/IAuditServerSettingEvent.tspackages/core-typings/src/license/LicensePeriod.tsapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxapps/meteor/client/views/navigation/sidepanel/SidepanelItem/useParentTeamData.tsapps/meteor/tests/end-to-end/api/channels.tspackages/core-typings/src/IRocketChatAssets.tsapps/meteor/app/autotranslate/server/deeplTranslate.tspackages/rest-typings/src/apps/index.tspackages/core-typings/src/omnichannel/sms.tspackages/core-typings/src/ServerAudit/IAuditUserChangedEvent.tsapps/meteor/tests/end-to-end/api/users.tspackages/core-typings/src/Apps.tspackages/core-typings/src/ISetting.tsapps/meteor/ee/server/lib/engagementDashboard/users.tspackages/core-typings/src/IModerationReport.tspackages/core-typings/src/utils.tspackages/core-typings/src/IRoom.tspackages/rest-typings/src/v1/groups/groups.tspackages/core-typings/src/IUser.tspackages/core-typings/src/IServerEvent.tspackages/models/src/models/Team.tspackages/core-typings/src/ServerAudit/IAuditServerAbacAction.tspackages/ui-contexts/src/UserPresenceContext.tspackages/rest-typings/src/v1/import/import.tspackages/core-typings/src/IMessage/MessageAttachment/TranslatedMessageAttachment.tspackages/core-typings/src/ISession.tspackages/rest-typings/src/helpers/IGetRoomRoles.tspackages/core-typings/src/IUserDataFile.tspackages/core-typings/src/license/ILicenseV3.tspackages/core-typings/src/IAvatar.tspackages/models/src/models/Analytics.tspackages/core-typings/src/cloud/WorkspaceSyncPayload.tspackages/core-typings/src/mediaCalls/IMediaCall.tspackages/core-typings/src/IAnalytics.tspackages/core-typings/src/IWebdavAccount.tspackages/model-typings/src/models/IAnalyticsModel.tspackages/core-typings/src/index.tspackages/core-typings/src/import/IImportMessage.tspackages/rest-typings/src/v1/channels/channels.tspackages/core-typings/src/import/ImportState.tspackages/core-typings/src/ISubscription.tspackages/core-typings/src/IMessage/IMessage.ts
🧠 Learnings (29)
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.
Applied to files:
apps/meteor/app/api/server/v1/channels.tsapps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/users.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/ISubscription.tspackages/core-typings/src/IMessage/IMessage.ts
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.
Applied to files:
apps/meteor/app/api/server/v1/channels.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/ServerAudit/IAuditServerAbacAction.tspackages/rest-typings/src/helpers/IGetRoomRoles.tspackages/core-typings/src/ISubscription.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings by mapping subscription documents to room IDs, never undefined, even when user has no room subscriptions.
Applied to files:
apps/meteor/app/api/server/v1/channels.tsapps/meteor/tests/end-to-end/api/users.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/IUser.tspackages/ui-contexts/src/UserPresenceContext.tspackages/rest-typings/src/helpers/IGetRoomRoles.tspackages/core-typings/src/ISubscription.tspackages/core-typings/src/IMessage/IMessage.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings (mapping subscription documents to room IDs), never undefined, even when user has no room subscriptions.
Applied to files:
apps/meteor/app/api/server/v1/channels.tsapps/meteor/tests/end-to-end/api/users.tspackages/core-typings/src/IRoom.tspackages/core-typings/src/IUser.tspackages/ui-contexts/src/UserPresenceContext.tspackages/rest-typings/src/helpers/IGetRoomRoles.tspackages/core-typings/src/ISubscription.tspackages/core-typings/src/IMessage/IMessage.ts
📚 Learning: 2025-10-24T17:32:05.348Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37299
File: apps/meteor/ee/server/lib/ldap/Manager.ts:438-454
Timestamp: 2025-10-24T17:32:05.348Z
Learning: In Rocket.Chat, ABAC attributes can only be set on private rooms and teams (type 'p'), not on public rooms (type 'c'). Therefore, when checking for ABAC-protected rooms/teams during LDAP sync or similar operations, it's sufficient to query only private rooms using methods like `findPrivateRoomsByIdsWithAbacAttributes`.
Applied to files:
apps/meteor/app/api/server/v1/channels.tsapps/meteor/tests/end-to-end/api/teams.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`
Applied to files:
apps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/tests/end-to-end/api/users.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts
Applied to files:
apps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/tests/end-to-end/api/users.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory
Applied to files:
apps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file
Applied to files:
apps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/tests/end-to-end/api/users.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/tests/end-to-end/api/users.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.
Applied to files:
apps/meteor/tests/end-to-end/api/teams.tsapps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.beforeAll()` and `test.afterAll()` for setup/teardown in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/teams.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/teams.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/teams.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-10-06T20:32:23.658Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/utilities.ts:557-573
Timestamp: 2025-10-06T20:32:23.658Z
Learning: In packages/apps-engine/tests/test-data/utilities.ts, the field name `isSubscripbedViaBundle` in the `IMarketplaceSubscriptionInfo` type should not be flagged as a typo, as it may match the upstream API's field name.
Applied to files:
apps/meteor/tests/end-to-end/api/channels.tspackages/core-typings/src/Apps.tspackages/core-typings/src/ISubscription.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.step()` for complex test scenarios to improve organization in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
Applied to files:
apps/meteor/app/autotranslate/server/deeplTranslate.ts
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.
Applied to files:
apps/meteor/app/autotranslate/server/deeplTranslate.ts
📚 Learning: 2025-11-16T19:09:43.823Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37496
File: packages/apps-engine/tests/server/runtime/deno/LivenessManager.spec.ts:3-3
Timestamp: 2025-11-16T19:09:43.823Z
Learning: In Node.js, `EventEmitter` can be imported from either the 'events' module or the 'stream' module—both export the same reference. While 'events' is the canonical module, importing from 'stream' is valid and works correctly.
Applied to files:
packages/core-typings/src/ServerAudit/IAuditUserChangedEvent.ts
📚 Learning: 2025-10-16T21:09:51.816Z
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 36942
File: apps/meteor/client/lib/e2ee/keychain.ts:148-156
Timestamp: 2025-10-16T21:09:51.816Z
Learning: In the RocketChat/Rocket.Chat repository, only platforms with native crypto.randomUUID() support are targeted, so fallback implementations for crypto.randomUUID() are not required in E2EE or cryptographic code.
Applied to files:
apps/meteor/tests/end-to-end/api/users.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Applied to files:
packages/core-typings/src/utils.ts
📚 Learning: 2025-09-16T13:33:49.237Z
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 36890
File: apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts:21-26
Timestamp: 2025-09-16T13:33:49.237Z
Learning: The im.delete API endpoint accepts either a `roomId` parameter (requiring the actual DM room _id) or a `username` parameter (for the DM partner's username). Constructing slug-like identifiers like `user2${Users.userE2EE.data.username}` doesn't work for this endpoint.
Applied to files:
packages/core-typings/src/IRoom.ts
📚 Learning: 2025-09-16T13:33:49.237Z
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 36890
File: apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts:21-26
Timestamp: 2025-09-16T13:33:49.237Z
Learning: In Rocket.Chat test files, the im.delete API endpoint accepts either a `roomId` parameter (requiring the actual DM room _id) or a `username` parameter (for the DM partner's username). It does not accept slug-like constructions such as concatenating usernames together.
Applied to files:
packages/core-typings/src/IRoom.ts
📚 Learning: 2025-10-27T14:38:46.994Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37303
File: apps/meteor/tests/end-to-end/api/abac.ts:1125-1137
Timestamp: 2025-10-27T14:38:46.994Z
Learning: In Rocket.Chat ABAC feature, when ABAC is disabled globally (ABAC_Enabled setting is false), room-level ABAC attributes are not evaluated when changing room types. This means converting a private room to public will succeed even if the room has ABAC attributes, as long as the global ABAC setting is disabled.
Applied to files:
packages/core-typings/src/ServerAudit/IAuditServerAbacAction.ts
📚 Learning: 2025-12-18T15:18:31.688Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37773
File: apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx:24-34
Timestamp: 2025-12-18T15:18:31.688Z
Learning: In apps/meteor/client/views/mediaCallHistory/MediaCallHistoryInternal.tsx, for internal call history items, the item.contactId is guaranteed to always match either the caller.id or callee.id in the call data, so the contact resolution in getContact will never result in undefined.
Applied to files:
packages/core-typings/src/mediaCalls/IMediaCall.ts
📚 Learning: 2025-11-19T18:20:37.116Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: apps/meteor/server/services/media-call/service.ts:141-141
Timestamp: 2025-11-19T18:20:37.116Z
Learning: In apps/meteor/server/services/media-call/service.ts, the sendHistoryMessage method should use call.caller.id or call.createdBy?.id as the message author, not call.transferredBy?.id. Even for transferred calls, the message should appear in the DM between the two users who are calling each other, not sent by the person who transferred the call.
Applied to files:
packages/core-typings/src/mediaCalls/IMediaCall.ts
📚 Learning: 2025-12-09T20:01:07.355Z
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 37532
File: ee/packages/federation-matrix/src/FederationMatrix.ts:920-927
Timestamp: 2025-12-09T20:01:07.355Z
Learning: In Rocket.Chat's federation invite handling (ee/packages/federation-matrix/src/FederationMatrix.ts), when a user rejects an invite via federationSDK.rejectInvite(), the subscription cleanup happens automatically through an event-driven flow: Matrix emits a leave event back, which is processed by handleLeave() in ee/packages/federation-matrix/src/events/member.ts, and that function calls Room.performUserRemoval() to clean up the subscription. No explicit cleanup is needed in the reject branch of handleInvite() because the leave event handler takes care of it.
<!-- </add_learning>
Applied to files:
packages/core-typings/src/ISubscription.ts
🧬 Code graph analysis (16)
apps/meteor/tests/end-to-end/api/teams.ts (1)
apps/meteor/tests/data/teams.helper.ts (1)
createTeam(5-21)
apps/meteor/tests/end-to-end/api/channels.ts (1)
apps/meteor/tests/data/teams.helper.ts (1)
createTeam(5-21)
packages/rest-typings/src/apps/index.ts (1)
packages/core-typings/src/Apps.ts (2)
AppRequestFilter(227-227)AppRequest(237-253)
packages/core-typings/src/IRoom.ts (1)
packages/core-typings/src/IUser.ts (1)
IUser(169-239)
packages/core-typings/src/IUser.ts (1)
packages/core-services/src/index.ts (1)
IUserService(147-147)
packages/core-typings/src/IServerEvent.ts (3)
packages/core-typings/src/ServerAudit/IAuditServerAbacAction.ts (5)
IServerEventAbacSubjectAttributeChanged(22-27)IServerEventAbacObjectAttributeChanged(29-38)IServerEventAbacAttributeChanged(40-49)IServerEventAbacActionPerformed(51-59)IServerEventAbacObjectAttributesRemoved(61-70)packages/core-typings/src/ServerAudit/IAuditServerSettingEvent.ts (1)
IServerEventSettingsChanged(4-20)packages/core-typings/src/ServerAudit/IAuditUserChangedEvent.ts (1)
IServerEventUserChanged(7-26)
packages/models/src/models/Team.ts (1)
packages/core-typings/src/ITeam.ts (1)
ITeam(14-20)
packages/core-typings/src/ServerAudit/IAuditServerAbacAction.ts (2)
packages/core-typings/src/IServerEvent.ts (1)
IAuditServerEventType(65-67)packages/core-typings/src/IAbacAttribute.ts (1)
IAbacAttributeDefinition(3-14)
packages/ui-contexts/src/UserPresenceContext.ts (2)
packages/core-typings/src/IUser.ts (1)
UserPresence(285-287)packages/livechat/src/widget.ts (1)
callback(509-511)
packages/core-typings/src/IMessage/MessageAttachment/TranslatedMessageAttachment.ts (1)
packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentDefault.ts (1)
MessageAttachmentDefault(7-35)
packages/models/src/models/Analytics.ts (2)
packages/core-typings/src/IAnalytics.ts (1)
IAnalytics(27-27)packages/model-typings/src/models/IAnalyticsModel.ts (1)
IAnalyticsModel(7-50)
packages/core-typings/src/cloud/WorkspaceSyncPayload.ts (1)
packages/core-typings/src/cloud/index.ts (2)
IAnnouncement(3-3)WorkspaceCommsResponsePayload(7-7)
packages/core-typings/src/mediaCalls/IMediaCall.ts (1)
packages/core-typings/src/utils.ts (1)
RequiredField(21-21)
packages/model-typings/src/models/IAnalyticsModel.ts (1)
packages/core-typings/src/IAnalytics.ts (1)
IAnalytics(27-27)
packages/core-typings/src/ISubscription.ts (1)
packages/core-typings/src/IRoom.ts (1)
IRoom(12-85)
packages/core-typings/src/IMessage/IMessage.ts (1)
packages/core-typings/src/IRoom.ts (1)
IRoom(12-85)
⏰ 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). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
e7b85b3 to
10e2737
Compare
3f3d86f to
c49bd12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/meteor/client/lib/chats/ChatAPI.ts (1)
100-111: Consider extendingSubscribablefor consistency.
UploadsAPIalready hasget()andsubscribe()with matching signatures. Using the localSubscribabletype could improve readability and make the intent clearer.♻️ Optional refactor
-export type UploadsAPI = { - get(): readonly Upload[]; - subscribe(callback: () => void): () => void; +export type UploadsAPI = Subscribable<readonly Upload[]> & { wipeFailedOnes(): void; cancel(id: Upload['id']): void; send( file: File, { description, msg, t, e2e }: { description?: string; msg?: string; t?: IMessage['t']; e2e?: IMessage['e2e'] }, getContent?: (fileId: string, fileUrl: string) => Promise<IE2EEMessage['content']>, fileContent?: { raw: Partial<IUpload>; encrypted: IE2EEMessage['content'] }, ): Promise<void>; };apps/meteor/ee/server/lib/engagementDashboard/users.ts (1)
30-35: Consider awaiting the async insertions.The
forEachloop fires offAnalytics.insertOnecalls without awaiting them. This means the function may return before all insertions complete, and any insertion errors become unhandled promise rejections.This is a pre-existing issue outside the scope of this PR, but worth addressing for reliability.
♻️ Suggested improvement
- users.forEach((user) => - Analytics.insertOne({ - ...user, - date: parseInt(user.date), - }), - ); + await Promise.all( + users.map((user) => + Analytics.insertOne({ + ...user, + date: parseInt(user.date), + }), + ), + );
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (30)
apps/meteor/app/api/server/v1/channels.tsapps/meteor/app/api/server/v1/teams.tsapps/meteor/app/api/server/v1/users.tsapps/meteor/app/autotranslate/server/autotranslate.tsapps/meteor/app/autotranslate/server/deeplTranslate.tsapps/meteor/app/autotranslate/server/googleTranslate.tsapps/meteor/app/channel-settings/server/methods/saveRoomSettings.tsapps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.tsapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxapps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsxapps/meteor/client/lib/chats/ChatAPI.tsapps/meteor/client/meteor/minimongo/Cursor.tsapps/meteor/client/meteor/minimongo/LocalCollection.tsapps/meteor/client/views/navigation/sidepanel/SidepanelItem/useParentTeamData.tsapps/meteor/client/views/room/Header/ParentRoom/ParentTeam.tsxapps/meteor/client/views/room/contexts/ComposerPopupContext.tsapps/meteor/client/views/room/hooks/useE2EEResetRoomKey.tsapps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.tsapps/meteor/ee/server/lib/engagementDashboard/users.tsapps/meteor/lib/typedJSONParse.tsapps/meteor/server/configuration/cas.tsapps/meteor/server/lib/cas/middleware.tsapps/meteor/server/lib/rooms/roomTypes/public.tsapps/meteor/server/services/authorization/canAccessRoom.tsapps/meteor/server/services/team/service.tsapps/meteor/tests/data/teams.helper.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/tests/end-to-end/api/incoming-integrations.tsapps/meteor/tests/end-to-end/api/miscellaneous.tsapps/meteor/tests/end-to-end/api/rooms.ts
💤 Files with no reviewable changes (2)
- apps/meteor/lib/typedJSONParse.ts
- apps/meteor/server/configuration/cas.ts
🚧 Files skipped from review as they are similar to previous changes (19)
- apps/meteor/app/api/server/v1/channels.ts
- apps/meteor/server/lib/rooms/roomTypes/public.ts
- apps/meteor/app/autotranslate/server/autotranslate.ts
- apps/meteor/server/services/team/service.ts
- apps/meteor/tests/end-to-end/api/miscellaneous.ts
- apps/meteor/tests/data/teams.helper.ts
- apps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsx
- apps/meteor/tests/end-to-end/api/incoming-integrations.ts
- apps/meteor/client/meteor/minimongo/LocalCollection.ts
- apps/meteor/app/autotranslate/server/deeplTranslate.ts
- apps/meteor/client/views/room/hooks/useE2EEResetRoomKey.ts
- apps/meteor/server/lib/cas/middleware.ts
- apps/meteor/client/views/navigation/sidepanel/SidepanelItem/useParentTeamData.ts
- apps/meteor/app/autotranslate/server/googleTranslate.ts
- apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
- apps/meteor/app/api/server/v1/users.ts
- apps/meteor/client/views/room/contexts/ComposerPopupContext.ts
- apps/meteor/tests/end-to-end/api/rooms.ts
- apps/meteor/client/views/room/Header/ParentRoom/ParentTeam.tsx
🧰 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/authorization/canAccessRoom.tsapps/meteor/tests/end-to-end/api/channels.tsapps/meteor/app/api/server/v1/teams.tsapps/meteor/client/meteor/minimongo/Cursor.tsapps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.tsapps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.tsapps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsxapps/meteor/ee/server/lib/engagementDashboard/users.tsapps/meteor/client/lib/chats/ChatAPI.ts
🧠 Learnings (12)
📚 Learning: 2025-10-24T17:32:05.348Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37299
File: apps/meteor/ee/server/lib/ldap/Manager.ts:438-454
Timestamp: 2025-10-24T17:32:05.348Z
Learning: In Rocket.Chat, ABAC attributes can only be set on private rooms and teams (type 'p'), not on public rooms (type 'c'). Therefore, when checking for ABAC-protected rooms/teams during LDAP sync or similar operations, it's sufficient to query only private rooms using methods like `findPrivateRoomsByIdsWithAbacAttributes`.
Applied to files:
apps/meteor/server/services/authorization/canAccessRoom.ts
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.
Applied to files:
apps/meteor/server/services/authorization/canAccessRoom.ts
📚 Learning: 2025-10-27T14:38:46.994Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37303
File: apps/meteor/tests/end-to-end/api/abac.ts:1125-1137
Timestamp: 2025-10-27T14:38:46.994Z
Learning: In Rocket.Chat ABAC feature, when ABAC is disabled globally (ABAC_Enabled setting is false), room-level ABAC attributes are not evaluated when changing room types. This means converting a private room to public will succeed even if the room has ABAC attributes, as long as the global ABAC setting is disabled.
Applied to files:
apps/meteor/server/services/authorization/canAccessRoom.ts
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.
Applied to files:
apps/meteor/server/services/authorization/canAccessRoom.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`
Applied to files:
apps/meteor/tests/end-to-end/api/channels.tsapps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.
Applied to files:
apps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts
Applied to files:
apps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
Applied to files:
apps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory
Applied to files:
apps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file
Applied to files:
apps/meteor/tests/end-to-end/api/channels.ts
📚 Learning: 2025-10-06T20:32:23.658Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/utilities.ts:557-573
Timestamp: 2025-10-06T20:32:23.658Z
Learning: In packages/apps-engine/tests/test-data/utilities.ts, the field name `isSubscripbedViaBundle` in the `IMarketplaceSubscriptionInfo` type should not be flagged as a typo, as it may match the upstream API's field name.
Applied to files:
apps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.tsapps/meteor/client/lib/chats/ChatAPI.ts
🧬 Code graph analysis (3)
apps/meteor/tests/end-to-end/api/channels.ts (1)
apps/meteor/tests/data/teams.helper.ts (1)
createTeam(5-21)
apps/meteor/client/meteor/minimongo/Cursor.ts (3)
packages/core-typings/src/utils.ts (1)
Optional(1-1)apps/meteor/client/meteor/minimongo/IdMap.ts (1)
clone(70-76)apps/meteor/client/meteor/minimongo/common.ts (1)
clone(11-49)
apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts (3)
packages/core-typings/src/utils.ts (1)
Serialized(59-72)packages/core-typings/src/cloud/WorkspaceSyncPayload.ts (1)
IAnnouncement(59-63)packages/core-typings/src/cloud/index.ts (1)
IAnnouncement(3-3)
⏰ 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). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (14)
apps/meteor/ee/server/apps/marketplace/appRequestNotifyUsers.ts (1)
1-1: LGTM! Clean type import removal.The
Paginationtype annotation was unnecessary here since TypeScript can correctly infer the type from the object literal{ limit: DEFAULT_LIMIT, offset: 0 }. This aligns well with the PR's goal of cleaning up type imports.Also applies to: 52-52
apps/meteor/server/services/authorization/canAccessRoom.ts (2)
3-3: LGTM!The import correctly brings in
TeamTypeenum from@rocket.chat/core-typings, aligning with the PR's goal of standardizing team typing across the codebase.
33-33: LGTM!The enum usage
TeamType.PUBLICcorrectly replaces the previousTEAM_TYPE.PUBLICconstant, maintaining the same comparison logic for determining public team access.apps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsx (1)
1-8: LGTM!The import reordering correctly groups external package imports (
@rocket.chat/*) before local relative imports, improving consistency with standard import conventions.apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts (1)
42-53: LGTM!The type signature update from
Cloud.AnnouncementtoCloud.IAnnouncementcorrectly aligns with the new type structure introduced inWorkspaceSyncPayload.ts. The deserialization logic properly handles all date fields and the return type accurately reflects theIAnnouncementinterface.apps/meteor/app/api/server/v1/teams.ts (2)
1-3: LGTM!The import update from
TEAM_TYPEtoTeamTypealigns with the PR objective of standardizing team typing across the codebase.
71-81: LGTM!The route validation correctly uses
TeamType.PRIVATEandTeamType.PUBLICenum values withMatch.OneOf. This is a consistent refactoring with no behavioral change.apps/meteor/tests/end-to-end/api/channels.ts (3)
1-5: LGTM!The import correctly includes
TeamTypefrom@rocket.chat/core-typings, aligning with the codebase-wide standardization of team typing.
1040-1042: LGTM!The
createTeamcalls correctly useTeamType.PUBLICandTeamType.PRIVATEenum values, matching the updated helper function signature.
1890-1894: Consistent usage across visibility tests.All
createTeamcalls throughout the test file correctly useTeamType.PUBLICandTeamType.PRIVATEvalues, maintaining test consistency with the refactored typing.apps/meteor/client/lib/chats/ChatAPI.ts (1)
1-12: LGTM — local type alias is clean and appropriate.Defining
Subscribable<T>locally as a non-exported type alias is a reasonable approach for this file. TypeScript's structural typing ensures compatibility with any external implementations. The change aligns with the PR's goal of consolidating types.apps/meteor/client/meteor/minimongo/Cursor.ts (2)
1-1: LGTM!The import of the shared
Optionalutility type is correct and aligns with the PR objective of consolidating utility types.
577-579: LGTM!The
Optional<T, '_id'>utility type is semantically equivalent to the previous inlineOmit<T, '_id'> & Partial<Pick<T, '_id'>>pattern—both result in all properties except_idbeing required, with_idoptional. This consolidation improves consistency across the codebase.apps/meteor/ee/server/lib/engagementDashboard/users.ts (1)
26-29: LGTM — typing simplification looks correct.The removal of explicit type casting aligns with the PR objective of improving type consistency and letting TypeScript infer the type from the model definition.
Proposed changes (including videos or screenshots)
This is a housekeeping activity over our core TypeScript types. It:
It was motivated by an explorative effort in using Zod as the schema validator/parser instead of Ajv. Reducing the duplicated types means more concise schemas.
This pull request focuses on improving type usage and consistency across the codebase, particularly with respect to team types, utility types, and type imports. The main themes are standardizing the usage of the
TeamTypeenum, replacing custom type patterns with shared utility types, and cleaning up or correcting type imports. There are also minor refactors to improve code clarity and maintainability.Type and Enum Standardization:
TEAM_TYPEconstant with theTeamTypeenum throughout server and client files, ensuring consistent team type checks and assignments. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Utility Type Improvements:
Omit<T, '_id'> & Partial<Pick<T, '_id'>>with the sharedOptional<T, '_id'>utility type in minimongo and related files, improving code readability and maintainability. [1] [2] [3] [4] [5] [6]DiscussionMessageto useOptional<IMessage, 'drid'>instead of a custom type.Type Import Cleanup and Corrections:
Translation Service Refactoring:
IDeepLTranslation,IGoogleTranslation) instead of importing them, and updated the structure ofsupportedLanguagesfor clarity. [1] [2] [3]Minor Refactors and Bugfixes:
RequiredFieldutility usage in room settings savers for better type safety. [1] [2] [3]Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit
Chores
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.