Skip to content

chore: Replace non-null assertions with proper error handling in RealAppsEngineUIHost#38755

Open
NAME-ASHWANIYADAV wants to merge 4 commits intoRocketChat:developfrom
NAME-ASHWANIYADAV:fix/replace-non-null-assertions-RealAppsEngineUIHost
Open

chore: Replace non-null assertions with proper error handling in RealAppsEngineUIHost#38755
NAME-ASHWANIYADAV wants to merge 4 commits intoRocketChat:developfrom
NAME-ASHWANIYADAV:fix/replace-non-null-assertions-RealAppsEngineUIHost

Conversation

@NAME-ASHWANIYADAV
Copy link
Contributor

@NAME-ASHWANIYADAV NAME-ASHWANIYADAV commented Feb 17, 2026

Description

This PR addresses the FIXME comment in client/apps/RealAppsEngineUIHost.ts by replacing unsafe non-null assertions (!) with proper null checks and error handling.

Related Issue

Closes #38754

Changes Made

  • getUserAvatarUrl:
    • Replaced ! with a check for undefined.
    • Returns an empty string if the avatar URL is missing, preventing potential crashes.
  • getClientRoomInfo:
    • Filtered cachedMembers to ensure only members with a valid username are processed.
    • Added a fallback for slugifiedName (uses id if name is missing).
  • getClientUserInfo:
    • Added explicit checks for getUser() and username.
    • Throws descriptive errors (User is not logged in, Username is not available) instead of allowing property access on potential undefined values.
  • Cleanup: Removed the // FIXME comment.

Verification

  • Automated Tests:
    • npx tsc --noEmit checks passed (verified type safety).
    • eslint checks passed (verified code style).
  • Manual Verification: Verified that the logic correctly handles optional types and matches the existing interface contracts.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

Summary by CodeRabbit

  • Refactor
    • Improved null-safety and data validation in the apps UI layer.
    • Avatar URL handling is more tolerant: missing URLs return empty and relative URLs keep base-prefix logic.
    • Room display names now fall back to IDs when missing.
    • User retrieval uses explicit guards and clearer errors instead of unsafe assertions, reducing runtime crashes.

@NAME-ASHWANIYADAV NAME-ASHWANIYADAV requested a review from a team as a code owner February 17, 2026 18:23
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 17, 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

@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2026

⚠️ No Changeset found

Latest commit: 33e7109

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
Contributor

coderabbitai bot commented Feb 17, 2026

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c959a7 and 33e7109.

📒 Files selected for processing (1)
  • apps/meteor/client/apps/RealAppsEngineUIHost.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/apps/RealAppsEngineUIHost.ts
🧠 Learnings (7)
📚 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: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).

Applied to files:

  • apps/meteor/client/apps/RealAppsEngineUIHost.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/client/apps/RealAppsEngineUIHost.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/client/apps/RealAppsEngineUIHost.ts
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/client/apps/RealAppsEngineUIHost.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/client/apps/RealAppsEngineUIHost.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/client/apps/RealAppsEngineUIHost.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/RealAppsEngineUIHost.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: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
🔇 Additional comments (4)
apps/meteor/client/apps/RealAppsEngineUIHost.ts (4)

20-32: Clean null-safety for avatar URL resolution.

The guard correctly handles falsy avatarUrl (undefined, null, empty string) and the existing prefix logic is preserved.


45-53: Well-structured filter+map pipeline with proper type narrowing.

Using (typeof members)[number] & { username: string } as the type predicate is a good approach — it derives the member type directly from the REST response shape, avoiding a separate IUser import while still correctly narrowing username to string for the downstream .map().


58-62: Reasonable fallback for slugifiedName.

Falling back to id when the room name is missing satisfies the IExternalComponentRoomInfo contract and avoids a runtime error.


65-79: Proper guard clauses with descriptive errors.

The sequential checks for user and username produce clear, actionable error messages and eliminate the non-null assertions cleanly. The narrowed username: string flows correctly into getUserAvatarUrl and the return object.


Walkthrough

Removed non-null assertions in RealAppsEngineUIHost, replaced them with explicit runtime checks and guarded user retrieval; members without usernames are filtered, avatar URL logic returns empty string when missing, and slugifiedName falls back to room id when name is absent.

Changes

Cohort / File(s) Summary
Null-safety improvements in RealAppsEngineUIHost
apps/meteor/client/apps/RealAppsEngineUIHost.ts
Removed // FIXME and eliminated non-null assertions. Added guarded getUser() access that throws if no user, validate username presence, derive avatar URL via getUserAvatarUrl(username) returning '' when missing, filter members lacking usernames, and fallback to id when slugifiedName/room.name is missing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped where bangs once dared to leap,
Replaced each jump with checks to keep.
Avatars quiet, names that once could lack,
Now fall back safe upon the track.
A careful hop, a tidy night—code snug and light.

🚥 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 PR title clearly and specifically describes the main change: replacing non-null assertions with proper error handling in the identified file.
Linked Issues check ✅ Passed All linked issue #38754 coding requirements are met: non-null assertions removed, explicit null checks added with error handling, FIXME comment removed, and unsafe property access patterns replaced.
Out of Scope Changes check ✅ Passed All changes are directly scoped to RealAppsEngineUIHost.ts null-safety improvements as specified in linked issue #38754; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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

❤️ Share

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

Copy link
Contributor

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

Choose a reason for hiding this comment

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

No issues found across 1 file

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/meteor/client/apps/RealAppsEngineUIHost.ts (1)

65-80: Good error handling — minor nit on redundant fallback.

The explicit guards and descriptive errors are a clear improvement. One small observation: this.getUserAvatarUrl(username) already returns '' when the avatar URL is missing (lines 23-25), so the || '' on line 78 is redundant. Not blocking, but removing it would be slightly cleaner.

Proposed diff
 		return {
 			id: _id,
 			username,
-			avatarUrl: this.getUserAvatarUrl(username) || '',
+			avatarUrl: this.getUserAvatarUrl(username),
 		};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/client/apps/RealAppsEngineUIHost.ts` around lines 65 - 80, In
getClientUserInfo(), remove the redundant fallback "|| ''" when calling
this.getUserAvatarUrl(username) because getUserAvatarUrl already returns an
empty string when no avatar exists; update the return object in
getClientUserInfo() to set avatarUrl to this.getUserAvatarUrl(username) directly
(no additional fallback) so the code is cleaner and avoids unnecessary
duplication.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 508b4a1 and 314db46.

📒 Files selected for processing (1)
  • apps/meteor/client/apps/RealAppsEngineUIHost.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/apps/RealAppsEngineUIHost.ts
🧠 Learnings (5)
📚 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/client/apps/RealAppsEngineUIHost.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/client/apps/RealAppsEngineUIHost.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: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).

Applied to files:

  • apps/meteor/client/apps/RealAppsEngineUIHost.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/client/apps/RealAppsEngineUIHost.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/RealAppsEngineUIHost.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: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
🔇 Additional comments (3)
apps/meteor/client/apps/RealAppsEngineUIHost.ts (3)

20-32: LGTM!

Clean replacement of the non-null assertion with an explicit guard and empty-string fallback. The existing URL-prefix logic is correctly preserved.


58-62: LGTM!

Falling back to id when the room name is missing is a sensible default for DMs or unnamed rooms.


45-53: ⚠️ Potential issue | 🔴 Critical

Add missing import for IUser.

The type predicate on line 46 references IUser, which is not imported in this file. The type predicate syntax member is IUser & { username: string } requires IUser to be in lexical scope. Add:

import type { IUser } from '@rocket.chat/core-typings';

The API endpoint /v1/groups.members is typed to return members: IUser[] in packages/rest-typings/src/v1/groups/groups.ts, and all other client-side files in this codebase follow the pattern of explicitly importing IUser from @rocket.chat/core-typings when using it.

⛔ Skipped due to learnings
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: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).
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.
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.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/meteor/client/apps/RealAppsEngineUIHost.ts`:
- Around line 65-80: In getClientUserInfo(), remove the redundant fallback "||
''" when calling this.getUserAvatarUrl(username) because getUserAvatarUrl
already returns an empty string when no avatar exists; update the return object
in getClientUserInfo() to set avatarUrl to this.getUserAvatarUrl(username)
directly (no additional fallback) so the code is cleaner and avoids unnecessary
duplication.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 314db46 and d0477be.

📒 Files selected for processing (1)
  • apps/meteor/client/apps/RealAppsEngineUIHost.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/apps/RealAppsEngineUIHost.ts
🧠 Learnings (5)
📚 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: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).

Applied to files:

  • apps/meteor/client/apps/RealAppsEngineUIHost.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/client/apps/RealAppsEngineUIHost.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/client/apps/RealAppsEngineUIHost.ts
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/client/apps/RealAppsEngineUIHost.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/RealAppsEngineUIHost.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). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
🔇 Additional comments (3)
apps/meteor/client/apps/RealAppsEngineUIHost.ts (3)

20-32: Clean null-safety improvement for avatar URL resolution.

Returning an empty string for a missing avatar URL is a sensible fallback that aligns with the interface contract.


65-73: Good explicit guards with descriptive error messages.

Throwing meaningful errors ("User is not logged in", "Username is not available") instead of relying on non-null assertions is a clear improvement for debuggability.


58-62: Solid fallback for slugifiedName.

Using slugifiedName ?? id handles the case where a room name is missing gracefully.

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

Inline comments:
In `@apps/meteor/client/apps/RealAppsEngineUIHost.ts`:
- Around line 45-53: The code uses the IUser type in the type predicate inside
RealAppsEngineUIHost (the cachedMembers assignment/filter that uses "member is
IUser & { username: string }") but IUser is not imported; add a type-only import
"import type { IUser } from '@rocket.chat/core-typings';" near the other imports
so the predicate compiles and matches the REST /v1/groups.members IUser shape.

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.48%. Comparing base (aa37226) to head (33e7109).
⚠️ Report is 87 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38755      +/-   ##
===========================================
- Coverage    70.78%   70.48%   -0.30%     
===========================================
  Files         3159     3176      +17     
  Lines       109364   111147    +1783     
  Branches     19671    20038     +367     
===========================================
+ Hits         77415    78346     +931     
- Misses       29920    30757     +837     
- Partials      2029     2044      +15     
Flag Coverage Δ
e2e 60.35% <0.00%> (+0.01%) ⬆️
e2e-api 47.80% <ø> (-0.28%) ⬇️
unit 71.50% <ø> (-0.44%) ⬇️

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: Replace non-null assertions with proper error handling in RealAppsEngineUIHost

1 participant