Skip to content

feat(apps): apps-engine split, flip the switch#40186

Closed
d-gubert wants to merge 25 commits intofeat/apps-engine-split--pr2b-dynamic-import-mapfrom
feat/apps-engine-split--pr2c-flip-the-switch
Closed

feat(apps): apps-engine split, flip the switch#40186
d-gubert wants to merge 25 commits intofeat/apps-engine-split--pr2b-dynamic-import-mapfrom
feat/apps-engine-split--pr2c-flip-the-switch

Conversation

@d-gubert
Copy link
Copy Markdown
Member

@d-gubert d-gubert commented Apr 16, 2026

Proposed changes (including videos or screenshots)

  • refactor(apps): point AppsEngine facade and IAppServerOrchestrator to local server/ paths
  • refactor(meteor): migrate apps-engine/server/ imports to @rocket.chat/apps/server/
  • refactor(meteor): migrate apps-engine/client/ imports to @rocket.chat/apps/client/
  • refactor(core-services): migrate apps-engine/server/ imports to @rocket.chat/apps
  • refactor(apps-engine): promote cross-boundary types to definition layer
  • refactor(apps-engine): remove server, client, deno-runtime and scripts
  • refactor(apps): source room options and OAuth2Client from apps-engine definition

Issue(s)

Steps to test or reproduce

Further comments

Related to the "Apps-Engine split" stack:

Deprecated

Summary by CodeRabbit

  • New Features

    • Added OAuth2 authentication client for app integrations with token management and authorization flows.
    • Enhanced external component system with new room and user information types.
    • Added filtering and sorting options for message and room queries.
  • Refactoring

    • Migrated internal app infrastructure to a new package structure for improved modularity.
    • Updated Docker builds to align with structural changes.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 16, 2026

⚠️ No Changeset found

Latest commit: a7dcbfc

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

This PR includes no changesets

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

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

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Walkthrough

This PR migrates the Rocket.Chat apps framework from the @rocket.chat/apps-engine package to a new @rocket.chat/apps package with distribution-based imports. Import paths are updated across bridges, services, and tests; new type definitions for external components and OAuth2 are introduced; and orchestrator dependencies are injected into bridge implementations.

Changes

Package Migration to @rocket.chat/apps

Layer / File(s) Summary
Type Definitions
packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts, IExternalComponentUserInfo.ts, IExternalComponentState.ts, index.ts, packages/apps-engine/src/definition/rooms/IGetMessagesOptions.ts, index.ts, packages/apps-engine/src/definition/oauth2/OAuth2Client.ts, OAuth2.ts
New interfaces IExternalComponentRoomInfo, IExternalComponentUserInfo and types GetMessagesOptions, GetRoomsFilters, GetRoomsOptions, GetMessagesSortableFields are added to apps-engine definitions. OAuth2Client class and GrantType enum are introduced with full OAuth2 implementation (setup, auth flow, token management, revocation, callback handling).
Package Configuration & Re-exports
packages/apps/package.json, packages/apps/src/AppsEngine.ts, packages/apps/src/IAppServerOrchestrator.ts, packages/apps/src/converters/IAppMessagesConverter.ts, packages/apps/src/server/bridges/RoomBridge.ts, packages/apps/src/server/oauth2/OAuth2Client.ts, packages/core-services/package.json, packages/core-services/src/types/IAppsEngineService.ts
packages/apps package.json updated with dist-based paths, types field, and new scripts. AppsEngine, IAppServerOrchestrator, and OAuth2Client modules updated to re-export from local server paths or apps-engine definitions. RoomBridge refactored to import and re-export room options types. IAppMessagesConverter signature extended with optional cacheKey parameter.
Bridge Import Updates & Orchestrator Injection
apps/meteor/app/apps/server/bridges/activation.ts, api.ts, bridges.js, cloud.ts, commands.ts, contact.ts, details.ts, email.ts, environmental.ts, experimental.ts, http.ts, index.ts, internal.ts, internalFederation.ts, livechat.ts, messages.ts, moderation.ts, oauthApps.ts, outboundCommunication.ts, persistence.ts, roles.ts, rooms.ts, scheduler.ts, settings.ts, thread.ts, uiInteraction.ts, uploads.ts, users.ts, videoConferences.ts
All bridge imports switched from @rocket.chat/apps-engine/server/bridges/... to @rocket.chat/apps/dist/server/bridges/.... Email bridge constructor updated to accept and store IAppServerOrchestrator for logging and default-from handling. Livechat bridge updated to use IAppsLivechatMessage, handle IExtraRoomParams, and conditionally expand room source with app-specific fields (sidebarIcon, defaultIcon, label, destination). Index bridge exports expanded via export * from './bridges'.
Service & Statistics Updates
apps/meteor/app/statistics/server/lib/getAppsStatistics.ts, apps/meteor/server/services/apps-engine/service.ts, apps/meteor/server/services/video-conference/service.ts, packages/apps-engine/src/definition/accessors/IRoomRead.ts
Import paths updated from apps-engine to apps/dist for AppInstallationSource, IGetAppsFilter, IAppStorageItem, and AppVideoConfProviderManager. IRoomRead imports refactored to source room options from dedicated module instead of RoomBridge.
Client & Context Updates
apps/meteor/client/apps/RealAppsEngineUIHost.ts, apps/meteor/client/apps/orchestrator.ts, apps/meteor/client/contexts/AppsContext.tsx, apps/meteor/tests/mocks/client/marketplace.tsx, apps/meteor/tests/mocks/data.ts
Client-side imports updated from apps-engine to apps/dist for AppsEngineUIHost, AppClientManager, IExternalComponentRoomInfo, and IExternalComponentUserInfo.
Storage & License Updates
apps/meteor/ee/app/license/server/canEnableApp.ts, apps/meteor/ee/lib/misc/formatAppInstanceForRest.ts, apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts, apps/meteor/ee/server/apps/communication/rest.ts, apps/meteor/ee/server/apps/cron.ts, apps/meteor/ee/server/apps/orchestrator.js, apps/meteor/ee/server/apps/storage/AppFileSystemSourceStorage.ts, AppGridFSSourceStorage.ts, AppRealLogStorage.ts, AppRealStorage.ts, ConfigurableAppSourceStorage.ts, apps/meteor/ee/tests/unit/server/apps/AppRealStorage.spec.ts
Storage-related imports (AppSourceStorage, IAppStorageItem, AppLogStorage, AppMetadataStorage, IMarketplaceInfo) and manager imports (AppManager, AppVideoConfProviderManager) updated to apps/dist paths. Type-only imports adjusted where applicable.
Migration Scripts & Library Utilities
apps/meteor/server/startup/migrations/v294.ts, v307.ts, apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts
Import paths updated for IAppStorageItem. v294 migration removes Apps.initialize() call and uses Apps.getManager().getSignatureManager() directly; changes from for await to standard for loop. v307 migration simplifies signature manager retrieval without type assertions and storage access without casts.
Test & E2E Updates
apps/meteor/tests/end-to-end/apps/app-logs-export.ts, app-logs-general.ts, app-logs-nested-requests.ts, app-logs.ts, apps/meteor/tests/unit/app/license/server/canEnableApp.spec.ts
Import paths for ILoggerStorageEntry and IAppStorageItem switched from apps-engine to apps/dist. ESLint disable comments removed from test headers.
Docker Build Configuration
.github/actions/build-docker/action.yml, ee/apps/account-service/Dockerfile, ee/apps/authorization-service/Dockerfile, ee/apps/ddp-streamer/Dockerfile, ee/apps/omnichannel-transcript/Dockerfile, ee/apps/presence-service/Dockerfile, ee/apps/queue-worker/Dockerfile
Removed COPY directives for apps-engine client from builder stages across multiple services. Queue-worker Dockerfile modified to copy apps-engine/package.json and add ee/apps/${SERVICE}/dist to builder stage.
Documentation
docs/apps-engine-migration.md
Added migration step entry (40186) documenting the flip of references from @rocket.chat/apps-engine to @rocket.chat/apps.

Sequence Diagram

sequenceDiagram
    participant AppCode as App Bridge/Service
    participant OldPath as `@rocket.chat/apps-engine`
    participant NewPath as `@rocket.chat/apps/dist`
    participant AppOrch as IAppServerOrchestrator

    AppCode->>OldPath: [Before] Import AppManager, Bridges, Storage
    OldPath-->>AppCode: Legacy types & classes

    AppCode->>NewPath: [After] Import from dist paths
    NewPath-->>AppCode: Types & classes from new package

    AppCode->>AppOrch: [Email Bridge] Inject orchestrator
    AppOrch->>AppCode: Provide logging & settings access
    AppCode->>AppCode: sendEmail with default From_Email
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

type: feature

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(apps): apps-engine split, flip the switch' accurately describes the main objective of the PR - completing the apps-engine split by redirecting imports and promoting type definitions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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

❤️ Share

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

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 16, 2026

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

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2b-dynamic-import-map branch from 969ce6b to af58d57 Compare April 22, 2026 20:09
@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2c-flip-the-switch branch from 1cc12df to c9af208 Compare April 22, 2026 20:22
@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2b-dynamic-import-map branch from af58d57 to 68964e4 Compare April 27, 2026 22:26
@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2c-flip-the-switch branch 2 times, most recently from f45a000 to b39d06f Compare April 27, 2026 23:46
@d-gubert d-gubert closed this Apr 28, 2026
@d-gubert d-gubert reopened this Apr 28, 2026
@d-gubert
Copy link
Copy Markdown
Member Author

@copilot check the errors and fix them https://github.com/RocketChat/Rocket.Chat/actions/runs/25027766915/job/73302665636?pr=40186

Make atomic commits, don't just commit every file at once.

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

@copilot check the errors and fix them https://github.com/RocketChat/Rocket.Chat/actions/runs/25027766915/job/73302665636?pr=40186

Make atomic commits, don't just commit every file at once.

Fixed in commits 1e661b3 and 2eff423.

The build was failing because the cleanup commit (07f4d9f) that stripped @rocket.chat/apps-engine down to the definition layer missed deleting some stale files from src/client/ and src/server/. These files (AppsEngineUIClient, AppsEngineUIHost, AppManager, various accessors/bridges/managers/storage files, etc.) had already been moved to @rocket.chat/apps, but their copies in @rocket.chat/apps-engine were left behind with broken imports (their dependencies had been removed).

The fix is split into two atomic commits:

  1. 1e661b3 – removes stale src/client/ files
  2. 2eff423 – removes stale src/server/ files

The package now only contains src/definition/ and src/lib/ as intended.

@d-gubert
Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

@copilot new errors https://github.com/RocketChat/Rocket.Chat/actions/runs/25028284158/job/73313245886

Fixed in commit b4986b5.

GetMessagesSortableFields is a runtime const array, but the previous refactor accidentally imported and re-exported it via import type / export type, making it unavailable as a value. RoomRead.ts uses it at runtime (Array.includes, Array.join), causing TS1362.

Fixed by importing it as a value in RoomBridge.ts and exporting it normally (export { GetMessagesSortableFields }) while keeping the other purely-type exports as export type.

@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2c-flip-the-switch branch 2 times, most recently from 2b96982 to a41200f Compare April 29, 2026 17:50
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.01%. Comparing base (bc9fbb1) to head (a7dcbfc).

Additional details and impacted files

Impacted file tree graph

@@                                 Coverage Diff                                 @@
##           feat/apps-engine-split--pr2b-dynamic-import-map   #40186      +/-   ##
===================================================================================
+ Coverage                                            69.98%   70.01%   +0.03%     
===================================================================================
  Files                                                 3301     3301              
  Lines                                               120462   120463       +1     
  Branches                                             21583    21603      +20     
===================================================================================
+ Hits                                                 84311    84348      +37     
+ Misses                                               32843    32824      -19     
+ Partials                                              3308     3291      -17     
Flag Coverage Δ
e2e 59.61% <ø> (+0.04%) ⬆️
e2e-api 47.09% <0.00%> (+0.83%) ⬆️
unit 70.86% <100.00%> (-0.01%) ⬇️

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

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

@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2b-dynamic-import-map branch 2 times, most recently from a5aacd5 to 1a62b06 Compare April 30, 2026 14:55
@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2c-flip-the-switch branch 2 times, most recently from e3b0a1c to 158024b Compare April 30, 2026 15:15
Comment thread packages/apps-engine/package.json
@d-gubert d-gubert force-pushed the feat/apps-engine-split--pr2c-flip-the-switch branch from b8cb7a9 to a7dcbfc Compare May 4, 2026 20:09
@d-gubert d-gubert marked this pull request as ready for review May 6, 2026 20:21
@d-gubert d-gubert requested review from a team as code owners May 6, 2026 20:21
@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label May 6, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/app/apps/server/bridges/email.ts (1)

15-18: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Validate From_Email before coercing it into the payload.

If From_Email is unset, String(settings.get('From_Email')) becomes "undefined"/"null", and the bridge will send an invalid from address on the exact path meant to recover from a missing app-provided sender.

Suggested fix
 		if (!from) {
 			this.orch.debugLog(`The app ${appId} didn't provide a from address, using the default one.`);
-			from = String(settings.get('From_Email'));
+			const defaultFrom = settings.get('From_Email');
+			if (typeof defaultFrom !== 'string' || defaultFrom.trim() === '') {
+				throw new Error('From_Email is not configured');
+			}
+			from = defaultFrom;
 		}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/app/apps/server/bridges/email.ts` around lines 15 - 18, The code
coerces settings.get('From_Email') with String(...) which can produce
"undefined"/"null"; update the fallback in the block handling the local variable
from (the same section that calls this.orch.debugLog and uses appId) to first
read and validate the value from settings.get('From_Email') (ensure it's not
undefined/null/empty and is a plausibly formatted email) before assigning to
from; if the setting is invalid, log an explicit error via this.orch.debugLog
(including the appId and the invalid setting) and either keep from undefined so
the caller can handle it or choose a safe hardcoded default, rather than using
String(...) which yields invalid literals.
🧹 Nitpick comments (2)
apps/meteor/app/apps/server/bridges/contact.ts (1)

18-26: ⚡ Quick win

Prefer the exported VerifyContactChannelParams type over the inline duplicate.

ContactBridge is now imported from the same module that exports VerifyContactChannelParams. The inline anonymous type on Line 19–25 is structurally identical to it; any future change to VerifyContactChannelParams (new field, rename) would silently miss this implementation.

♻️ Proposed refactor
-import { ContactBridge } from '@rocket.chat/apps/dist/server/bridges/ContactBridge';
+import { ContactBridge } from '@rocket.chat/apps/dist/server/bridges/ContactBridge';
+import type { VerifyContactChannelParams } from '@rocket.chat/apps/dist/server/bridges/ContactBridge';

 ...

-	async verifyContact(
-		verifyContactChannelParams: {
-			contactId: string;
-			field: string;
-			value: string;
-			visitorId: string;
-			roomId: string;
-		},
-		appId: string,
-	): Promise<void> {
+	async verifyContact(verifyContactChannelParams: VerifyContactChannelParams, appId: string): Promise<void> {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/app/apps/server/bridges/contact.ts` around lines 18 - 26, The
verifyContact method currently declares an inline parameter type that duplicates
the exported VerifyContactChannelParams; replace the inline anonymous type with
the exported type by changing the parameter signature of verifyContact to accept
verifyContactChannelParams: VerifyContactChannelParams (importing
VerifyContactChannelParams from the same module that provides ContactBridge if
not already imported), so the function signature uses the single source-of-truth
type and will automatically reflect future shape changes.
packages/apps-engine/src/definition/oauth2/OAuth2Client.ts (1)

209-217: ⚡ Quick win

Replace deprecated String.prototype.substr with slice.

substr is a legacy method flagged as deprecated in MDN/TC39. While it still works, since this code is being relocated to the new definition home, swapping it now is a near-zero-effort cleanup that keeps the moved surface free of deprecated APIs.

♻️ Proposed fix
-		if (url.endsWith('/')) {
-			return url.substr(0, url.length - 1);
-		}
-		return url;
+		return url.endsWith('/') ? url.slice(0, -1) : url;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/apps-engine/src/definition/oauth2/OAuth2Client.ts` around lines 209
- 217, In getBaseURLWithoutTrailingSlash, replace the deprecated
String.prototype.substr usage with String.prototype.slice: when trimming the
trailing slash from the url (in the method getBaseURLWithoutTrailingSlash and
variable url), call slice(0, -1) instead of substr(0, url.length - 1) so the
code avoids the deprecated API while preserving behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/app/apps/server/bridges/uiInteraction.ts`:
- Line 2: The code is using deep-imports like
'@rocket.chat/apps/dist/server/bridges/UiInteractionBridge' (see
UiInteractionBridge import in apps/server/bridges/uiInteraction.ts) which bypass
the package's exports map; update packages/apps/package.json to add explicit
"exports" subpath entries that expose the compiled dist paths used across the
repo (at minimum map "./dist/server/bridges/UiInteractionBridge" and the broader
"./dist/server/bridges/*" plus analogous entries for "./dist/server/storage/*",
"./dist/server/managers/*" and "./dist/client/*"), ensuring the exported targets
include both the JS entry and typings where applicable so existing imports
continue to resolve without relying on implicit build output layout.

In
`@packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts`:
- Line 15: The interface IExternalComponentRoomInfo currently requires members:
Array<IExternalComponentUserInfo>, forcing callers to eagerly populate full
IExternalComponentUserInfo (including avatarUrl) for every member; change
members to an optional property (members?: Array<IExternalComponentUserInfo>) or
document a clear size/usage constraint to avoid heavy eager loading for large
rooms, and update any related codepaths that construct or consume
IExternalComponentRoomInfo (and any factories that populate avatarUrl) to handle
the optional members case gracefully.

In `@packages/apps-engine/src/definition/rooms/index.ts`:
- Line 29: The rooms barrel currently only re-exports types from
IGetMessagesOptions, so the runtime constant GetMessagesSortableFields isn't
exported and consumers must deep-import it; update the barrel to also export the
value (e.g., add an export for GetMessagesSortableFields or change the export to
include value exports) so GetMessagesSortableFields is available from the rooms
index alongside the existing IGetMessagesOptions types.

---

Outside diff comments:
In `@apps/meteor/app/apps/server/bridges/email.ts`:
- Around line 15-18: The code coerces settings.get('From_Email') with
String(...) which can produce "undefined"/"null"; update the fallback in the
block handling the local variable from (the same section that calls
this.orch.debugLog and uses appId) to first read and validate the value from
settings.get('From_Email') (ensure it's not undefined/null/empty and is a
plausibly formatted email) before assigning to from; if the setting is invalid,
log an explicit error via this.orch.debugLog (including the appId and the
invalid setting) and either keep from undefined so the caller can handle it or
choose a safe hardcoded default, rather than using String(...) which yields
invalid literals.

---

Nitpick comments:
In `@apps/meteor/app/apps/server/bridges/contact.ts`:
- Around line 18-26: The verifyContact method currently declares an inline
parameter type that duplicates the exported VerifyContactChannelParams; replace
the inline anonymous type with the exported type by changing the parameter
signature of verifyContact to accept verifyContactChannelParams:
VerifyContactChannelParams (importing VerifyContactChannelParams from the same
module that provides ContactBridge if not already imported), so the function
signature uses the single source-of-truth type and will automatically reflect
future shape changes.

In `@packages/apps-engine/src/definition/oauth2/OAuth2Client.ts`:
- Around line 209-217: In getBaseURLWithoutTrailingSlash, replace the deprecated
String.prototype.substr usage with String.prototype.slice: when trimming the
trailing slash from the url (in the method getBaseURLWithoutTrailingSlash and
variable url), call slice(0, -1) instead of substr(0, url.length - 1) so the
code avoids the deprecated API while preserving behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 89260495-7c7f-4638-b4b8-8addefad3e9b

📥 Commits

Reviewing files that changed from the base of the PR and between bc9fbb1 and a7dcbfc.

⛔ Files ignored due to path filters (2)
  • packages/apps/deno-runtime/deno.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (82)
  • .github/actions/build-docker/action.yml
  • apps/meteor/app/apps/server/bridges/activation.ts
  • apps/meteor/app/apps/server/bridges/api.ts
  • apps/meteor/app/apps/server/bridges/bridges.js
  • apps/meteor/app/apps/server/bridges/cloud.ts
  • apps/meteor/app/apps/server/bridges/commands.ts
  • apps/meteor/app/apps/server/bridges/contact.ts
  • apps/meteor/app/apps/server/bridges/details.ts
  • apps/meteor/app/apps/server/bridges/email.ts
  • apps/meteor/app/apps/server/bridges/environmental.ts
  • apps/meteor/app/apps/server/bridges/experimental.ts
  • apps/meteor/app/apps/server/bridges/http.ts
  • apps/meteor/app/apps/server/bridges/index.ts
  • apps/meteor/app/apps/server/bridges/internal.ts
  • apps/meteor/app/apps/server/bridges/internalFederation.ts
  • apps/meteor/app/apps/server/bridges/livechat.ts
  • apps/meteor/app/apps/server/bridges/messages.ts
  • apps/meteor/app/apps/server/bridges/moderation.ts
  • apps/meteor/app/apps/server/bridges/oauthApps.ts
  • apps/meteor/app/apps/server/bridges/outboundCommunication.ts
  • apps/meteor/app/apps/server/bridges/persistence.ts
  • apps/meteor/app/apps/server/bridges/roles.ts
  • apps/meteor/app/apps/server/bridges/rooms.ts
  • apps/meteor/app/apps/server/bridges/scheduler.ts
  • apps/meteor/app/apps/server/bridges/settings.ts
  • apps/meteor/app/apps/server/bridges/thread.ts
  • apps/meteor/app/apps/server/bridges/uiInteraction.ts
  • apps/meteor/app/apps/server/bridges/uploads.ts
  • apps/meteor/app/apps/server/bridges/users.ts
  • apps/meteor/app/apps/server/bridges/videoConferences.ts
  • apps/meteor/app/statistics/server/lib/getAppsStatistics.ts
  • apps/meteor/client/apps/RealAppsEngineUIHost.ts
  • apps/meteor/client/apps/orchestrator.ts
  • apps/meteor/client/contexts/AppsContext.tsx
  • apps/meteor/ee/app/license/server/canEnableApp.ts
  • apps/meteor/ee/lib/misc/formatAppInstanceForRest.ts
  • apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts
  • apps/meteor/ee/server/apps/communication/rest.ts
  • apps/meteor/ee/server/apps/cron.ts
  • apps/meteor/ee/server/apps/orchestrator.js
  • apps/meteor/ee/server/apps/storage/AppFileSystemSourceStorage.ts
  • apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts
  • apps/meteor/ee/server/apps/storage/AppRealLogStorage.ts
  • apps/meteor/ee/server/apps/storage/AppRealStorage.ts
  • apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts
  • apps/meteor/ee/tests/unit/server/apps/AppRealStorage.spec.ts
  • apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts
  • apps/meteor/server/services/apps-engine/service.ts
  • apps/meteor/server/services/video-conference/service.ts
  • apps/meteor/server/startup/migrations/v294.ts
  • apps/meteor/server/startup/migrations/v307.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-export.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-general.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts
  • apps/meteor/tests/end-to-end/apps/app-logs.ts
  • apps/meteor/tests/mocks/client/marketplace.tsx
  • apps/meteor/tests/mocks/data.ts
  • apps/meteor/tests/unit/app/license/server/canEnableApp.spec.ts
  • docs/apps-engine-migration.md
  • ee/apps/account-service/Dockerfile
  • ee/apps/authorization-service/Dockerfile
  • ee/apps/ddp-streamer/Dockerfile
  • ee/apps/omnichannel-transcript/Dockerfile
  • ee/apps/presence-service/Dockerfile
  • ee/apps/queue-worker/Dockerfile
  • packages/apps-engine/src/definition/accessors/IRoomRead.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentState.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentUserInfo.ts
  • packages/apps-engine/src/definition/externalComponent/index.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2Client.ts
  • packages/apps-engine/src/definition/rooms/IGetMessagesOptions.ts
  • packages/apps-engine/src/definition/rooms/index.ts
  • packages/apps/package.json
  • packages/apps/src/AppsEngine.ts
  • packages/apps/src/IAppServerOrchestrator.ts
  • packages/apps/src/converters/IAppMessagesConverter.ts
  • packages/apps/src/server/bridges/RoomBridge.ts
  • packages/apps/src/server/oauth2/OAuth2Client.ts
  • packages/core-services/package.json
  • packages/core-services/src/types/IAppsEngineService.ts
💤 Files with no reviewable changes (6)
  • ee/apps/presence-service/Dockerfile
  • ee/apps/omnichannel-transcript/Dockerfile
  • ee/apps/authorization-service/Dockerfile
  • ee/apps/account-service/Dockerfile
  • ee/apps/ddp-streamer/Dockerfile
  • ee/apps/queue-worker/Dockerfile
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/contexts/AppsContext.tsx
  • apps/meteor/app/apps/server/bridges/internalFederation.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2.ts
  • apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts
  • apps/meteor/app/apps/server/bridges/experimental.ts
  • apps/meteor/app/apps/server/bridges/bridges.js
  • apps/meteor/app/apps/server/bridges/roles.ts
  • apps/meteor/ee/server/apps/storage/AppFileSystemSourceStorage.ts
  • apps/meteor/client/apps/orchestrator.ts
  • packages/apps-engine/src/definition/externalComponent/index.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-export.ts
  • apps/meteor/tests/mocks/data.ts
  • packages/core-services/src/types/IAppsEngineService.ts
  • packages/apps-engine/src/definition/rooms/index.ts
  • apps/meteor/ee/tests/unit/server/apps/AppRealStorage.spec.ts
  • apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts
  • apps/meteor/tests/mocks/client/marketplace.tsx
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentUserInfo.ts
  • apps/meteor/tests/end-to-end/apps/app-logs.ts
  • packages/apps/src/server/oauth2/OAuth2Client.ts
  • apps/meteor/ee/server/apps/storage/AppRealStorage.ts
  • apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts
  • apps/meteor/app/apps/server/bridges/moderation.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentState.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-general.ts
  • packages/apps/src/IAppServerOrchestrator.ts
  • apps/meteor/tests/unit/app/license/server/canEnableApp.spec.ts
  • apps/meteor/ee/server/apps/communication/rest.ts
  • apps/meteor/app/apps/server/bridges/thread.ts
  • apps/meteor/app/apps/server/bridges/outboundCommunication.ts
  • apps/meteor/app/apps/server/bridges/settings.ts
  • apps/meteor/client/apps/RealAppsEngineUIHost.ts
  • apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts
  • apps/meteor/ee/server/apps/orchestrator.js
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts
  • packages/apps-engine/src/definition/accessors/IRoomRead.ts
  • apps/meteor/app/apps/server/bridges/email.ts
  • apps/meteor/app/apps/server/bridges/persistence.ts
  • apps/meteor/app/apps/server/bridges/internal.ts
  • apps/meteor/ee/server/apps/storage/AppRealLogStorage.ts
  • packages/apps/src/AppsEngine.ts
  • apps/meteor/app/apps/server/bridges/environmental.ts
  • apps/meteor/app/apps/server/bridges/api.ts
  • apps/meteor/app/apps/server/bridges/oauthApps.ts
  • apps/meteor/app/apps/server/bridges/index.ts
  • packages/apps-engine/src/definition/rooms/IGetMessagesOptions.ts
  • apps/meteor/app/apps/server/bridges/activation.ts
  • apps/meteor/server/services/apps-engine/service.ts
  • apps/meteor/app/apps/server/bridges/http.ts
  • apps/meteor/server/services/video-conference/service.ts
  • apps/meteor/app/apps/server/bridges/details.ts
  • apps/meteor/app/statistics/server/lib/getAppsStatistics.ts
  • apps/meteor/app/apps/server/bridges/videoConferences.ts
  • packages/apps/src/converters/IAppMessagesConverter.ts
  • apps/meteor/ee/app/license/server/canEnableApp.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2Client.ts
  • apps/meteor/server/startup/migrations/v307.ts
  • apps/meteor/app/apps/server/bridges/contact.ts
  • apps/meteor/app/apps/server/bridges/scheduler.ts
  • apps/meteor/app/apps/server/bridges/rooms.ts
  • apps/meteor/app/apps/server/bridges/users.ts
  • apps/meteor/app/apps/server/bridges/commands.ts
  • apps/meteor/ee/lib/misc/formatAppInstanceForRest.ts
  • apps/meteor/app/apps/server/bridges/uiInteraction.ts
  • apps/meteor/app/apps/server/bridges/livechat.ts
  • apps/meteor/server/startup/migrations/v294.ts
  • apps/meteor/app/apps/server/bridges/cloud.ts
  • apps/meteor/app/apps/server/bridges/uploads.ts
  • apps/meteor/app/apps/server/bridges/messages.ts
  • packages/apps/src/server/bridges/RoomBridge.ts
  • apps/meteor/ee/server/apps/cron.ts
**/*.spec.ts

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

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

Files:

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

Applied to files:

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

Applied to files:

  • apps/meteor/client/contexts/AppsContext.tsx
  • apps/meteor/app/apps/server/bridges/internalFederation.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2.ts
  • apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts
  • apps/meteor/app/apps/server/bridges/experimental.ts
  • apps/meteor/app/apps/server/bridges/roles.ts
  • apps/meteor/ee/server/apps/storage/AppFileSystemSourceStorage.ts
  • apps/meteor/client/apps/orchestrator.ts
  • packages/apps-engine/src/definition/externalComponent/index.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-export.ts
  • apps/meteor/tests/mocks/data.ts
  • packages/core-services/src/types/IAppsEngineService.ts
  • packages/apps-engine/src/definition/rooms/index.ts
  • apps/meteor/ee/tests/unit/server/apps/AppRealStorage.spec.ts
  • apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts
  • apps/meteor/tests/mocks/client/marketplace.tsx
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentUserInfo.ts
  • apps/meteor/tests/end-to-end/apps/app-logs.ts
  • packages/apps/src/server/oauth2/OAuth2Client.ts
  • apps/meteor/ee/server/apps/storage/AppRealStorage.ts
  • apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts
  • apps/meteor/app/apps/server/bridges/moderation.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentState.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-general.ts
  • packages/apps/src/IAppServerOrchestrator.ts
  • apps/meteor/tests/unit/app/license/server/canEnableApp.spec.ts
  • apps/meteor/ee/server/apps/communication/rest.ts
  • apps/meteor/app/apps/server/bridges/thread.ts
  • apps/meteor/app/apps/server/bridges/outboundCommunication.ts
  • apps/meteor/app/apps/server/bridges/settings.ts
  • apps/meteor/client/apps/RealAppsEngineUIHost.ts
  • apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts
  • packages/apps-engine/src/definition/accessors/IRoomRead.ts
  • apps/meteor/app/apps/server/bridges/email.ts
  • apps/meteor/app/apps/server/bridges/persistence.ts
  • apps/meteor/app/apps/server/bridges/internal.ts
  • apps/meteor/ee/server/apps/storage/AppRealLogStorage.ts
  • packages/apps/src/AppsEngine.ts
  • apps/meteor/app/apps/server/bridges/environmental.ts
  • apps/meteor/app/apps/server/bridges/api.ts
  • apps/meteor/app/apps/server/bridges/oauthApps.ts
  • apps/meteor/app/apps/server/bridges/index.ts
  • packages/apps-engine/src/definition/rooms/IGetMessagesOptions.ts
  • apps/meteor/app/apps/server/bridges/activation.ts
  • apps/meteor/server/services/apps-engine/service.ts
  • apps/meteor/app/apps/server/bridges/http.ts
  • apps/meteor/server/services/video-conference/service.ts
  • apps/meteor/app/apps/server/bridges/details.ts
  • apps/meteor/app/statistics/server/lib/getAppsStatistics.ts
  • apps/meteor/app/apps/server/bridges/videoConferences.ts
  • packages/apps/src/converters/IAppMessagesConverter.ts
  • apps/meteor/ee/app/license/server/canEnableApp.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2Client.ts
  • apps/meteor/server/startup/migrations/v307.ts
  • apps/meteor/app/apps/server/bridges/contact.ts
  • apps/meteor/app/apps/server/bridges/scheduler.ts
  • apps/meteor/app/apps/server/bridges/rooms.ts
  • apps/meteor/app/apps/server/bridges/users.ts
  • apps/meteor/app/apps/server/bridges/commands.ts
  • apps/meteor/ee/lib/misc/formatAppInstanceForRest.ts
  • apps/meteor/app/apps/server/bridges/uiInteraction.ts
  • apps/meteor/app/apps/server/bridges/livechat.ts
  • apps/meteor/server/startup/migrations/v294.ts
  • apps/meteor/app/apps/server/bridges/cloud.ts
  • apps/meteor/app/apps/server/bridges/uploads.ts
  • apps/meteor/app/apps/server/bridges/messages.ts
  • packages/apps/src/server/bridges/RoomBridge.ts
  • apps/meteor/ee/server/apps/cron.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/apps/server/bridges/internalFederation.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2.ts
  • apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts
  • apps/meteor/app/apps/server/bridges/experimental.ts
  • apps/meteor/app/apps/server/bridges/roles.ts
  • apps/meteor/ee/server/apps/storage/AppFileSystemSourceStorage.ts
  • apps/meteor/client/apps/orchestrator.ts
  • packages/apps-engine/src/definition/externalComponent/index.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-export.ts
  • apps/meteor/tests/mocks/data.ts
  • packages/core-services/src/types/IAppsEngineService.ts
  • packages/apps-engine/src/definition/rooms/index.ts
  • apps/meteor/ee/tests/unit/server/apps/AppRealStorage.spec.ts
  • apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentUserInfo.ts
  • apps/meteor/tests/end-to-end/apps/app-logs.ts
  • packages/apps/src/server/oauth2/OAuth2Client.ts
  • apps/meteor/ee/server/apps/storage/AppRealStorage.ts
  • apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts
  • apps/meteor/app/apps/server/bridges/moderation.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentState.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-general.ts
  • packages/apps/src/IAppServerOrchestrator.ts
  • apps/meteor/tests/unit/app/license/server/canEnableApp.spec.ts
  • apps/meteor/ee/server/apps/communication/rest.ts
  • apps/meteor/app/apps/server/bridges/thread.ts
  • apps/meteor/app/apps/server/bridges/outboundCommunication.ts
  • apps/meteor/app/apps/server/bridges/settings.ts
  • apps/meteor/client/apps/RealAppsEngineUIHost.ts
  • apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts
  • packages/apps-engine/src/definition/accessors/IRoomRead.ts
  • apps/meteor/app/apps/server/bridges/email.ts
  • apps/meteor/app/apps/server/bridges/persistence.ts
  • apps/meteor/app/apps/server/bridges/internal.ts
  • apps/meteor/ee/server/apps/storage/AppRealLogStorage.ts
  • packages/apps/src/AppsEngine.ts
  • apps/meteor/app/apps/server/bridges/environmental.ts
  • apps/meteor/app/apps/server/bridges/api.ts
  • apps/meteor/app/apps/server/bridges/oauthApps.ts
  • apps/meteor/app/apps/server/bridges/index.ts
  • packages/apps-engine/src/definition/rooms/IGetMessagesOptions.ts
  • apps/meteor/app/apps/server/bridges/activation.ts
  • apps/meteor/server/services/apps-engine/service.ts
  • apps/meteor/app/apps/server/bridges/http.ts
  • apps/meteor/server/services/video-conference/service.ts
  • apps/meteor/app/apps/server/bridges/details.ts
  • apps/meteor/app/statistics/server/lib/getAppsStatistics.ts
  • apps/meteor/app/apps/server/bridges/videoConferences.ts
  • packages/apps/src/converters/IAppMessagesConverter.ts
  • apps/meteor/ee/app/license/server/canEnableApp.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2Client.ts
  • apps/meteor/server/startup/migrations/v307.ts
  • apps/meteor/app/apps/server/bridges/contact.ts
  • apps/meteor/app/apps/server/bridges/scheduler.ts
  • apps/meteor/app/apps/server/bridges/rooms.ts
  • apps/meteor/app/apps/server/bridges/users.ts
  • apps/meteor/app/apps/server/bridges/commands.ts
  • apps/meteor/ee/lib/misc/formatAppInstanceForRest.ts
  • apps/meteor/app/apps/server/bridges/uiInteraction.ts
  • apps/meteor/app/apps/server/bridges/livechat.ts
  • apps/meteor/server/startup/migrations/v294.ts
  • apps/meteor/app/apps/server/bridges/cloud.ts
  • apps/meteor/app/apps/server/bridges/uploads.ts
  • apps/meteor/app/apps/server/bridges/messages.ts
  • packages/apps/src/server/bridges/RoomBridge.ts
  • apps/meteor/ee/server/apps/cron.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/apps/server/bridges/internalFederation.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2.ts
  • apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts
  • apps/meteor/app/apps/server/bridges/experimental.ts
  • apps/meteor/app/apps/server/bridges/roles.ts
  • apps/meteor/ee/server/apps/storage/AppFileSystemSourceStorage.ts
  • apps/meteor/client/apps/orchestrator.ts
  • packages/apps-engine/src/definition/externalComponent/index.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-export.ts
  • apps/meteor/tests/mocks/data.ts
  • packages/core-services/src/types/IAppsEngineService.ts
  • packages/apps-engine/src/definition/rooms/index.ts
  • apps/meteor/ee/tests/unit/server/apps/AppRealStorage.spec.ts
  • apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentUserInfo.ts
  • apps/meteor/tests/end-to-end/apps/app-logs.ts
  • packages/apps/src/server/oauth2/OAuth2Client.ts
  • apps/meteor/ee/server/apps/storage/AppRealStorage.ts
  • apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts
  • apps/meteor/app/apps/server/bridges/moderation.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentState.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-general.ts
  • packages/apps/src/IAppServerOrchestrator.ts
  • apps/meteor/tests/unit/app/license/server/canEnableApp.spec.ts
  • apps/meteor/ee/server/apps/communication/rest.ts
  • apps/meteor/app/apps/server/bridges/thread.ts
  • apps/meteor/app/apps/server/bridges/outboundCommunication.ts
  • apps/meteor/app/apps/server/bridges/settings.ts
  • apps/meteor/client/apps/RealAppsEngineUIHost.ts
  • apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts
  • packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts
  • packages/apps-engine/src/definition/accessors/IRoomRead.ts
  • apps/meteor/app/apps/server/bridges/email.ts
  • apps/meteor/app/apps/server/bridges/persistence.ts
  • apps/meteor/app/apps/server/bridges/internal.ts
  • apps/meteor/ee/server/apps/storage/AppRealLogStorage.ts
  • packages/apps/src/AppsEngine.ts
  • apps/meteor/app/apps/server/bridges/environmental.ts
  • apps/meteor/app/apps/server/bridges/api.ts
  • apps/meteor/app/apps/server/bridges/oauthApps.ts
  • apps/meteor/app/apps/server/bridges/index.ts
  • packages/apps-engine/src/definition/rooms/IGetMessagesOptions.ts
  • apps/meteor/app/apps/server/bridges/activation.ts
  • apps/meteor/server/services/apps-engine/service.ts
  • apps/meteor/app/apps/server/bridges/http.ts
  • apps/meteor/server/services/video-conference/service.ts
  • apps/meteor/app/apps/server/bridges/details.ts
  • apps/meteor/app/statistics/server/lib/getAppsStatistics.ts
  • apps/meteor/app/apps/server/bridges/videoConferences.ts
  • packages/apps/src/converters/IAppMessagesConverter.ts
  • apps/meteor/ee/app/license/server/canEnableApp.ts
  • packages/apps-engine/src/definition/oauth2/OAuth2Client.ts
  • apps/meteor/server/startup/migrations/v307.ts
  • apps/meteor/app/apps/server/bridges/contact.ts
  • apps/meteor/app/apps/server/bridges/scheduler.ts
  • apps/meteor/app/apps/server/bridges/rooms.ts
  • apps/meteor/app/apps/server/bridges/users.ts
  • apps/meteor/app/apps/server/bridges/commands.ts
  • apps/meteor/ee/lib/misc/formatAppInstanceForRest.ts
  • apps/meteor/app/apps/server/bridges/uiInteraction.ts
  • apps/meteor/app/apps/server/bridges/livechat.ts
  • apps/meteor/server/startup/migrations/v294.ts
  • apps/meteor/app/apps/server/bridges/cloud.ts
  • apps/meteor/app/apps/server/bridges/uploads.ts
  • apps/meteor/app/apps/server/bridges/messages.ts
  • packages/apps/src/server/bridges/RoomBridge.ts
  • apps/meteor/ee/server/apps/cron.ts
📚 Learning: 2026-02-04T12:08:56.950Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 38374
File: apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts:26-37
Timestamp: 2026-02-04T12:08:56.950Z
Learning: In the E2E tests under apps/meteor/tests/end-to-end/apps, prefer using a fixed sleep (e.g., 1s) instead of implementing polling or retry logic when waiting for asynchronous operations to complete. Tests should fail deterministically if the expected result isn't available after the sleep.

Applied to files:

  • apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-export.ts
  • apps/meteor/tests/end-to-end/apps/app-logs.ts
  • apps/meteor/tests/end-to-end/apps/app-logs-general.ts
📚 Learning: 2026-03-16T11:50:11.087Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 39657
File: apps/meteor/tests/end-to-end/apps/app-resolve-visitor.ts:18-21
Timestamp: 2026-03-16T11:50:11.087Z
Learning: In end-to-end tests under apps/meteor/tests/end-to-end/apps, there is an established pattern: call createAgent() and makeAgentAvailable() immediately after updateSetting('Livechat_enabled', true) with no intermediate delay. Do not flag this sequence as a race condition or require a sleep/delay. This pattern is used across 10+ tests in the codebase.

Applied to files:

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

Applied to files:

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

Applied to files:

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

Applied to files:

  • apps/meteor/ee/tests/unit/server/apps/AppRealStorage.spec.ts
  • apps/meteor/tests/unit/app/license/server/canEnableApp.spec.ts
📚 Learning: 2026-04-14T23:26:16.284Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40159
File: .github/actions/setup-node/action.yml:44-59
Timestamp: 2026-04-14T23:26:16.284Z
Learning: In this repo’s Rocket.Chat CI composite actions (e.g., .github/actions/setup-node/action.yml), treat direct writes of resolved tool versions to $GITHUB_ENV as an accepted/intentional pattern. If the action updates $GITHUB_ENV using something like `echo "VAR=value" >> $GITHUB_ENV` (without multiline heredoc form and without explicit empty-value guards), do not flag it as missing newline/empty validation or as “incorrect” heredoc usage. This is considered acceptable because the resolved versions come from trusted/stable sources (e.g., package.json engines and/or .tool-versions) used by Rocket.Chat CI.

Applied to files:

  • .github/actions/build-docker/action.yml
🪛 Biome (2.4.14)
apps/meteor/app/apps/server/bridges/bridges.js

[error] 1-1: Illegal use of an import declaration outside of a module

(parse)

apps/meteor/ee/server/apps/orchestrator.js

[error] 6-6: Illegal use of an import declaration outside of a module

(parse)

🔇 Additional comments (64)
.github/actions/build-docker/action.yml (1)

103-104: Good migration follow-through on esbuild pruning.

Adding the @rocket.chat/apps esbuild cleanup alongside the existing apps-engine cleanup is consistent with the split and helps keep image size trimmed.

apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts (1)

1-1: Import migration looks correct.

import type from @rocket.chat/apps/dist/server/AppManager is consistent with the split and keeps this usage type-only.

apps/meteor/ee/server/apps/communication/rest.ts (1)

1-2: Type import updates are good.

The new @rocket.chat/apps/dist/... type imports match the migration intent and keep runtime behavior unchanged.

apps/meteor/client/apps/RealAppsEngineUIHost.ts (1)

1-3: Import migration looks correct and consistent.

The updated runtime and type-only imports align with the package split/migration target and keep typings explicit.

packages/apps/package.json (2)

6-6: types path update is correct and consistent with the build output.

This aligns with tsconfig.json generating declarations in dist/.


19-22: Script and workspace install config changes look good for the split migration.

testunit/typecheck additions and hoistingLimits: "workspaces" fit the monorepo transition cleanly.

Also applies to: 58-60

apps/meteor/client/contexts/AppsContext.tsx (1)

1-1: Import migration is consistent and type-safe.

Line 1 correctly switches AppClientManager to @rocket.chat/apps/dist/... as a type-only import, matching its interface-only usage.

apps/meteor/client/apps/orchestrator.ts (1)

1-2: Dist-path imports are correctly wired for runtime and types.

Lines 1-2 use the right split: value import for AppClientManager and type import for AppsEngineUIHost, consistent with how each is used in the class.

apps/meteor/app/apps/server/bridges/environmental.ts (1)

1-2: LGTM — mechanical import-path migration.

Import replaced correctly; class implementation and base-class contract are unchanged.

docs/apps-engine-migration.md (1)

29-29: LGTM — documentation entry is accurate and consistent.

apps/meteor/app/apps/server/bridges/roles.ts (1)

1-3: LGTM — import-path migration only.

apps/meteor/ee/app/license/server/canEnableApp.ts (1)

1-1: LGTM — type import migrated to dist path; interface matches usages.

apps/meteor/app/apps/server/bridges/internal.ts (1)

1-5: LGTM — import-path migration only; known type mismatch pre-dates this PR.

apps/meteor/app/apps/server/bridges/moderation.ts (1)

1-5: LGTM — bridge migrated to dist; definition-layer type imports from apps-engine/definition are intentionally retained per the migration strategy.

apps/meteor/app/apps/server/bridges/experimental.ts (1)

1-3: LGTM — import-path migration only; empty base class confirmed.

apps/meteor/app/apps/server/bridges/uiInteraction.ts (1)

1-4: LGTM — alias pattern cleanly avoids local name collision; definition-layer imports intentionally retained.

apps/meteor/ee/server/apps/cron.ts (1)

1-1: Type-only import migration looks correct.

The ProxiedApp import switch to the @rocket.chat/apps/dist path is consistent with the split/migration and keeps runtime behavior unchanged.

apps/meteor/app/apps/server/bridges/details.ts (1)

2-2: Bridge import update is consistent and safe.

Using AppDetailChangesBridge from the dist path aligns with the migration and preserves the current inheritance/override contract.

apps/meteor/app/apps/server/bridges/oauthApps.ts (1)

4-4: Import migration is good here.

OAuthAppsBridge now coming from @rocket.chat/apps/dist/... matches the broader Apps-Engine split and keeps this bridge wiring intact.

packages/core-services/package.json (1)

32-32: Dependency switch matches the migration plan.

Replacing @rocket.chat/apps-engine with @rocket.chat/apps in devDependencies is aligned with the split rollout.

apps/meteor/ee/lib/misc/formatAppInstanceForRest.ts (1)

1-3: Type import updates are consistent.

The moved type imports (ProxiedApp, AppLicenseValidationResult, IAppStorageItem) to @rocket.chat/apps/dist/server/* fit the PR migration pattern without behavior changes.

apps/meteor/tests/unit/app/license/server/canEnableApp.spec.ts (1)

1-2: Test import migration looks correct.

Switching these types to @rocket.chat/apps/dist/server/* keeps the spec aligned with the new package boundaries.

apps/meteor/app/apps/server/bridges/bridges.js (1)

1-1: AppBridges import migration is in good shape.

The new @rocket.chat/apps/dist/server/bridges/AppBridges source aligns with the bridge-layer split and preserves class extension behavior.

apps/meteor/app/apps/server/bridges/commands.ts (1)

2-2: CommandBridge path update is consistent.

Importing CommandBridge from @rocket.chat/apps/dist/server/bridges/CommandBridge fits the migration and keeps current bridge implementation intact.

apps/meteor/app/apps/server/bridges/http.ts (1)

2-3: LGTM — import path migration is correct.

IHttpBridgeRequestInfo and HttpBridge moved to dist paths; IHttpResponse intentionally stays in apps-engine/definition/accessors as a definition-layer type.

apps/meteor/app/apps/server/bridges/uploads.ts (1)

2-2: LGTM — dist path migration for UploadBridge.

apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts (1)

1-2: LGTM — dist path migration for AppSourceStorage and IAppStorageItem.

apps/meteor/app/apps/server/bridges/thread.ts (1)

2-2: LGTM — dist path migration for ThreadBridge.

apps/meteor/app/apps/server/bridges/settings.ts (1)

2-2: LGTM — dist path migration for ServerSettingBridge.

apps/meteor/app/apps/server/bridges/cloud.ts (1)

2-3: LGTM — CloudWorkspaceBridge migrated to dist; IWorkspaceToken correctly stays in apps-engine definition layer.

apps/meteor/app/apps/server/bridges/users.ts (1)

2-2: LGTM — dist path migration for UserBridge.

apps/meteor/app/statistics/server/lib/getAppsStatistics.ts (1)

2-2: ⚡ Quick win

No action needed. AppInstallationSource is a regular enum (not const enum) that will be properly emitted as a runtime value in the compiled dist output. The import at line 2 and usage at line 46 are both correct.

apps/meteor/server/services/apps-engine/service.ts (1)

2-3: LGTM — import migration correct.

Both type-only imports resolve to the expected interfaces (confirmed by context snippets) and the usages at Lines 162–174 remain consistent.

apps/meteor/server/services/video-conference/service.ts (1)

2-2: LGTM — type-only import migration correct.

apps/meteor/ee/server/apps/storage/AppRealLogStorage.ts (1)

1-3: LGTM — imports correctly migrated.

AppLogStorage is a runtime import (base class) and correctly kept as a value import; ILoggerStorageEntry and IAppLogStorageFindOptions are correctly import type.

apps/meteor/app/apps/server/bridges/api.ts (1)

2-3: LGTM — import migration correct.

ApiBridge properly kept as a value import (runtime base class); AppApi correctly as import type. Definition-layer types (IApiRequest, RequestMethod, etc.) correctly remain on @rocket.chat/apps-engine/definition.

apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts (1)

1-2: LGTM — import migration correct.

apps/meteor/app/apps/server/bridges/messages.ts (1)

2-3: LGTM — import migration correct.

apps/meteor/tests/end-to-end/apps/app-logs-export.ts (1)

1-1: LGTM — import migration correct.

apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts (1)

1-1: Import migration looks correct and consistent with the split.
No functional concerns in this segment.

apps/meteor/tests/end-to-end/apps/app-logs.ts (1)

1-1: Good path update for ILoggerStorageEntry.
This is aligned with the apps-engine → apps/dist migration.

apps/meteor/tests/end-to-end/apps/app-logs-general.ts (1)

1-1: LGTM on this import migration.
No issues found in the changed segment.

apps/meteor/ee/server/apps/orchestrator.js (1)

6-6: AppManager import switch looks correct.
No regression risk identified in this changed line.

apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts (1)

1-1: Type import migration is clean.
Behavioral surface remains unchanged as expected.

apps/meteor/app/apps/server/bridges/internalFederation.ts (1)

1-1: Looks good — federation bridge type import updated correctly.
No further concerns in this segment.

packages/core-services/src/types/IAppsEngineService.ts (1)

1-2: Type import updates are consistent with the migration.
No interface-level issues introduced here.

apps/meteor/app/apps/server/bridges/outboundCommunication.ts (1)

2-2: ⚡ Quick win

No action needed - import path is correct.

The import on line 2 is valid. The source file is named OutboundMessagesBridge.ts (plural) in packages/apps/src/server/bridges/, and the dist output preserves this naming. All internal imports across the codebase consistently use OutboundMessagesBridge (plural), confirming this is the canonical path.

apps/meteor/app/apps/server/bridges/scheduler.ts (2)

4-4: LGTM — dist-path import is consistent with the PR-wide migration pattern.


93-93: LGTM — removing the explicit as Promise<Array<string>> cast is correct; Promise.all over Promise<string>[] infers Promise<string[]>, which is structurally assignable to the declared return type Promise<void | Array<string>>.

apps/meteor/ee/server/apps/storage/AppFileSystemSourceStorage.ts (1)

4-5: LGTM — both dist-path imports correctly match the abstract class and interface definitions confirmed in the context snippets.

packages/apps/src/AppsEngine.ts (1)

23-25: LGTM — re-exports redirected to local ./server paths align with the PR's consolidation strategy while keeping the public API surface unchanged.

packages/apps/src/IAppServerOrchestrator.ts (1)

7-8: LGTM — resolving AppManager and AppSourceStorage from local server paths is consistent with the rest of the PR and keeps the interface surface unchanged.

apps/meteor/app/apps/server/bridges/videoConferences.ts (1)

2-2: LGTM — dist-path import for VideoConferenceBridge is consistent with the PR migration pattern.

apps/meteor/app/apps/server/bridges/persistence.ts (1)

2-2: LGTMPersistenceBridge dist-path import is consistent with the PR-wide migration.

packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts (1)

4-4: ⚡ Quick win

No action required. The slugifiedName field is declared as required (string, not string | undefined) on IRoom, so Pick<IRoom, 'id' | 'slugifiedName'> correctly preserves it as a required field. The concern about silent optionality does not apply.

			> Likely an incorrect or invalid review comment.
packages/apps-engine/src/definition/externalComponent/IExternalComponentUserInfo.ts (1)

9-14: ⚡ Quick win

Remove the suggestion to make avatarUrl optional.

All implementations of IExternalComponentUserInfo already guarantee that avatarUrl is a string: getClientUserInfo() uses an explicit || '' fallback, the test factory and mock implementations always provide a value, and the room members mapping receives URLs from getAvatarURL() which returns a string for valid usernames. The required avatarUrl: string interface is correct and doesn't need to be optional.

apps/meteor/server/startup/migrations/v294.ts (1)

15-15: ⚡ Quick win

The optional chaining removal is correct. Apps.getManager() has a non-nullable return type (AppManager) in the IAppServerOrchestrator interface, and the orchestrator proxy will throw an error if the orchestrator is not initialized rather than returning null/undefined. The code properly guards against uninitialized orchestrator with the if (!Apps.self) check at line 9, making the subsequent call to Apps.getManager() at line 15 safe. This pattern is consistently used in the codebase (see v307.ts for an identical example).

packages/apps/src/converters/IAppMessagesConverter.ts (1)

7-9: LGTM — overload ordering and narrowing look correct.

The three overloads (undefined-only → IMessage → union) are ordered most-specific first so TS resolves the right return type, and the optional cacheKey?: object is appropriately typed for identity-based caching.

apps/meteor/app/apps/server/bridges/livechat.ts (3)

1-2: LGTM — dist-path import split.

Sourcing the type (IAppServerOrchestrator, IAppsLivechatMessage) from @rocket.chat/apps while pulling the runtime LivechatBridge class from the dist subpath is consistent with the rest of the bridges in this PR.


396-406: LGTM — cacheKey reuse across the batch.

Passing the livechatMessages cursor as the second argument leverages the new cacheKey?: object overload so every conversion in this batch shares the same cache entry by identity. Cursor identity is stable across .map().toArray(), so this is sound.


126-131: ⚡ Quick win

Type narrowing is correct—no action needed.

The source?.type === 'app' check properly discriminates to IOmnichannelSourceApp, which declares all four properties (sidebarIcon, defaultIcon, label, destination). TypeScript will correctly narrow the type and not widen to any/unknown. The properties are optional on the discriminated variant, so spreading them with their values (including undefined if unset) is the intended behavior.

packages/apps-engine/src/definition/oauth2/OAuth2Client.ts (1)

1-11: LGTM on the relocation.

Imports are correctly re-pointed to relative paths within the definition layer, and IOAuth2Client/IOAuth2ClientOptions/IAuthData continue to be sourced from the sibling IOAuth2 module. The class still implements IOAuth2Client per the contract in packages/apps-engine/src/definition/oauth2/IOAuth2.ts:84-136.

packages/apps-engine/src/definition/oauth2/OAuth2.ts (1)

1-1: LGTM.

Local import correctly resolves to the relocated OAuth2Client in the same directory; factory contract is unchanged.

packages/apps/src/server/oauth2/OAuth2Client.ts (1)

1-1: ⚡ Quick win

No changes needed—the deep-import subpath resolves correctly.

The re-export imports from @rocket.chat/apps-engine/definition/oauth2/OAuth2Client, which resolves through legacy Node module resolution: @rocket.chat/apps-engine has no exports field, so it falls back to the filesystem; the files array includes definition/**, which covers the compiled subpath; and the source file properly exports both OAuth2Client and GrantType. The build compiles src/definition/* to definition/* at the package root, making the import valid.

@@ -1,7 +1,7 @@
import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import { UiInteractionBridge as AppsEngineUiInteractionBridge } from '@rocket.chat/apps/dist/server/bridges/UiInteractionBridge';
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 6, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that the dist paths imported by bridge files exist under packages/apps

fd -e ts -e js . packages/apps/dist/server/bridges/ 2>/dev/null | head -30

# Also confirm the package.json exports/typesVersions cover these paths
cat packages/apps/package.json | grep -A 30 '"exports"'
cat packages/apps/package.json | grep -A 30 '"typesVersions"'

Repository: RocketChat/Rocket.Chat

Length of output: 48


🏁 Script executed:

#!/bin/bash
# First, find where the packages/apps directory is
find . -maxdepth 3 -type d -name "apps" | grep -E "(packages|node_modules)" | head -20

Repository: RocketChat/Rocket.Chat

Length of output: 82


🏁 Script executed:

#!/bin/bash
# Check if packages/apps exists and what's in it
ls -la packages/ 2>/dev/null | head -20

Repository: RocketChat/Rocket.Chat

Length of output: 1213


🏁 Script executed:

#!/bin/bash
# Find the actual uiInteraction.ts file to see what it imports
find . -name "uiInteraction.ts" -type f | grep -v node_modules | head -5

Repository: RocketChat/Rocket.Chat

Length of output: 121


🏁 Script executed:

#!/bin/bash
# Look for any dist/server/bridges directories in the repository
find . -path "*/dist/server/bridges" -type d 2>/dev/null

Repository: RocketChat/Rocket.Chat

Length of output: 48


🏁 Script executed:

#!/bin/bash
# Read the actual import statement in the file
cat -n ./apps/meteor/app/apps/server/bridges/uiInteraction.ts | head -20

Repository: RocketChat/Rocket.Chat

Length of output: 1112


🏁 Script executed:

#!/bin/bash
# Explore packages/apps structure
ls -la packages/apps/

Repository: RocketChat/Rocket.Chat

Length of output: 734


🏁 Script executed:

#!/bin/bash
# Check packages/apps/package.json for exports
cat packages/apps/package.json

Repository: RocketChat/Rocket.Chat

Length of output: 1806


🏁 Script executed:

#!/bin/bash
# Explore packages/apps/src structure to see if server/bridges exists
find packages/apps/src -type f -name "*.ts" | grep -i bridge | head -20

Repository: RocketChat/Rocket.Chat

Length of output: 1140


🏁 Script executed:

#!/bin/bash
# Get full directory structure of packages/apps/src
tree -L 3 packages/apps/src 2>/dev/null || find packages/apps/src -type d | head -30

Repository: RocketChat/Rocket.Chat

Length of output: 6932


🏁 Script executed:

#!/bin/bash
# Find all imports from `@rocket.chat/apps/dist` in the codebase
rg "@rocket.chat/apps/dist" --type ts --type tsx -n | head -40

Repository: RocketChat/Rocket.Chat

Length of output: 94


🏁 Script executed:

#!/bin/bash
# Check if there's a tsconfig that defines the compilation output path
cat packages/apps/tsconfig.json

Repository: RocketChat/Rocket.Chat

Length of output: 349


🏁 Script executed:

#!/bin/bash
# Find all imports from `@rocket.chat/apps/dist` pattern
rg "@rocket.chat/apps/dist" --type ts -n | head -50

Repository: RocketChat/Rocket.Chat

Length of output: 7572


🏁 Script executed:

#!/bin/bash
# Count how many files in the bridges directory follow this import pattern
grep -r "@rocket.chat/apps/dist/server/bridges" apps/meteor/app/apps/server/bridges/ | wc -l

Repository: RocketChat/Rocket.Chat

Length of output: 69


Add formal exports map to packages/apps/package.json to document and stabilize deep-import paths.

The deep imports from @rocket.chat/apps/dist/server/bridges/ and similar paths are valid—the source files exist at packages/apps/src/server/bridges/ and TypeScript will compile them to the expected dist structure. However, this pattern is used extensively across 40+ files (bridges, storage, managers, client) and currently bypasses the package's exports configuration. While the paths will work with the current build setup, adding explicit exports entries would formalize these APIs and protect against accidental breaking changes to the build output structure.

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

In `@apps/meteor/app/apps/server/bridges/uiInteraction.ts` at line 2, The code is
using deep-imports like
'@rocket.chat/apps/dist/server/bridges/UiInteractionBridge' (see
UiInteractionBridge import in apps/server/bridges/uiInteraction.ts) which bypass
the package's exports map; update packages/apps/package.json to add explicit
"exports" subpath entries that expose the compiled dist paths used across the
repo (at minimum map "./dist/server/bridges/UiInteractionBridge" and the broader
"./dist/server/bridges/*" plus analogous entries for "./dist/server/storage/*",
"./dist/server/managers/*" and "./dist/client/*"), ensuring the exported targets
include both the JS entry and typings where applicable so existing imports
continue to resolve without relying on implicit build output layout.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Meteor's bundler does not respect the exports keyword on package.json files. For now we'll need to keep the deep imports

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@d-gubert, thanks for the clarification! That makes total sense — since Meteor's bundler ignores the exports field in package.json, the deep dist/ imports are the correct approach here and no changes are needed.


✏️ Learnings added
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40186
File: apps/meteor/app/apps/server/bridges/uiInteraction.ts:2-2
Timestamp: 2026-05-06T20:47:53.078Z
Learning: In the RocketChat/Rocket.Chat repository, Meteor's bundler does not respect the `exports` keyword in `package.json` files. Deep imports (e.g., `rocket.chat/apps/dist/server/bridges/UiInteractionBridge`) must be used instead of relying on `exports` subpath mappings. Do not suggest adding `exports` map entries to packages consumed by Meteor (e.g., `packages/apps/package.json`) as a fix for deep imports.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

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

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

* the list that contains all the users belonging
* to this room.
*/
members: Array<IExternalComponentUserInfo>;
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 6, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

members is required and non-optional — potential performance concern for large rooms.

Requiring members: Array<IExternalComponentUserInfo> (which itself requires avatarUrl per IExternalComponentUserInfo) means callers must eagerly load and resolve full user info for every member. For rooms with many members this is expensive on every external component invocation.

Consider members?: Array<IExternalComponentUserInfo> or documenting an explicit size constraint, so the API contract is clear about the cost.

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

In
`@packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts`
at line 15, The interface IExternalComponentRoomInfo currently requires members:
Array<IExternalComponentUserInfo>, forcing callers to eagerly populate full
IExternalComponentUserInfo (including avatarUrl) for every member; change
members to an optional property (members?: Array<IExternalComponentUserInfo>) or
document a clear size/usage constraint to avoid heavy eager loading for large
rooms, and update any related codepaths that construct or consume
IExternalComponentRoomInfo (and any factories that populate avatarUrl) to handle
the optional members case gracefully.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ExternalComponents as a feature is deprecated and unreachable. No worries here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@d-gubert, thanks for the context! Since ExternalComponents is deprecated and unreachable, the performance concern is moot. I'll note this for future reviews.


✏️ Learnings added
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40186
File: packages/apps-engine/src/definition/externalComponent/IExternalComponentRoomInfo.ts:15-15
Timestamp: 2026-05-06T20:49:12.929Z
Learning: In the RocketChat/Rocket.Chat repository, the ExternalComponents feature (related to IExternalComponentRoomInfo, IExternalComponentUserInfo, and IExternalComponentState in packages/apps-engine/src/definition/externalComponent/) is deprecated and unreachable. Do not flag performance or API design concerns for code in this feature area.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

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

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

export type * from './IPreRoomUserLeave';
export type * from './IPostRoomUserLeave';
export type * from './IRoomUserLeaveContext';
export type * from './IGetMessagesOptions';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Re-export the new runtime sort-field constant from the rooms barrel.

Line 29 only re-exports the types from IGetMessagesOptions. GetMessagesSortableFields is a value export, so it is still missing from @rocket.chat/apps-engine/definition/rooms, which is why packages/apps/src/server/bridges/RoomBridge.ts now has to deep-import the file directly. That leaves the promoted room-query API incomplete at the barrel boundary.

Suggested fix
-export type * from './IGetMessagesOptions';
+export * from './IGetMessagesOptions';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/apps-engine/src/definition/rooms/index.ts` at line 29, The rooms
barrel currently only re-exports types from IGetMessagesOptions, so the runtime
constant GetMessagesSortableFields isn't exported and consumers must deep-import
it; update the barrel to also export the value (e.g., add an export for
GetMessagesSortableFields or change the export to include value exports) so
GetMessagesSortableFields is available from the rooms index alongside the
existing IGetMessagesOptions types.

@d-gubert
Copy link
Copy Markdown
Member Author

d-gubert commented May 7, 2026

Top of the stack was merged, including all the changes. Closing this one.

@d-gubert d-gubert closed this May 7, 2026
@d-gubert d-gubert deleted the feat/apps-engine-split--pr2c-flip-the-switch branch May 8, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Pull requests that introduces new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants