Skip to content

fix: intermittent "Channel Not Joined" screen in embedded mode#40100

Open
ricardogarim wants to merge 3 commits intodevelopfrom
fix/embedded-mode-subscription-race-condition
Open

fix: intermittent "Channel Not Joined" screen in embedded mode#40100
ricardogarim wants to merge 3 commits intodevelopfrom
fix/embedded-mode-subscription-race-condition

Conversation

@ricardogarim
Copy link
Copy Markdown
Member

@ricardogarim ricardogarim commented Apr 9, 2026

Proposed changes

In embedded mode, EmbeddedPreload was calling SubscriptionsCachedStore.setReady(true) before init() finished loading subscription data. If useOpenRoom checked Subscriptions.state before init() populated it, sub was undefined - causing NotSubscribedToRoomError and a "Channel Not Joined" screen on public channels for users without preview-c-room permission.

This PR moves subscription fetching into EmbeddedPreload, ensuring data is cached before marking the store as ready. RoomOpenerEmbedded is simplified to only listen for real-time updates via notify-user.

Issue(s)

Steps to test or reproduce

  1. Use a non-admin user (without preview-c-room permission) who is a member of a public channel.
  2. Open the channel directly in embedded mode: /channel/general?layout=embedded
  3. Before: "Channel Not Joined" screen (more reliable in CI). After: Room loads correctly.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed intermittent "Channel Not Joined" screen issue when opening public channels in embedded mode for non-admin users.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 9, 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 targeting the wrong base branch. It should target 8.5.0, but it targets 8.4.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Walkthrough

Two key files in embedded mode are refactored: EmbeddedPreload now proactively fetches room and subscription data before marking the store ready, while RoomOpenerEmbedded shifts from fetching subscriptions independently to consuming pre-loaded data from the notify-user stream. This eliminates the race condition causing intermittent "Channel Not Joined" screens.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/eight-clouds-count.md
Records patch release and fix for intermittent "Channel Not Joined" screen in embedded mode.
Embedded Room Loading
apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx, apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
Refactored subscription loading flow: EmbeddedPreload now proactively fetches room and subscription data before marking store ready; RoomOpenerEmbedded consumes pre-loaded data from notify stream instead of fetching independently. Eliminates race condition in subscription availability.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title directly and specifically describes the main change: fixing an intermittent 'Channel Not Joined' screen in embedded mode, which is the primary objective.
Linked Issues check ✅ Passed Code changes address the race condition by moving subscription fetching into EmbeddedPreload and updating RoomOpenerEmbedded to rely on real-time updates, directly resolving CORE-1555 requirements.
Out of Scope Changes check ✅ Passed All code changes (EmbeddedPreload, RoomOpenerEmbedded, changeset) are directly scoped to fixing the embedded-mode race condition identified in CORE-1555.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: 0c13cb1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch

Not sure what this means? Click here to learn what changesets are.

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 72.72727% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.20%. Comparing base (f21ed3a) to head (0c13cb1).
⚠️ Report is 44 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40100      +/-   ##
===========================================
- Coverage    70.59%   70.20%   -0.40%     
===========================================
  Files         3273     3278       +5     
  Lines       116880   116622     -258     
  Branches     21110    20766     -344     
===========================================
- Hits         82512    81871     -641     
+ Misses       32309    31467     -842     
- Partials      2059     3284    +1225     
Flag Coverage Δ
e2e 59.75% <72.72%> (-0.99%) ⬇️
e2e-api 46.61% <ø> (-2.51%) ⬇️
unit 71.00% <ø> (+0.04%) ⬆️

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

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

@ricardogarim ricardogarim force-pushed the fix/embedded-mode-subscription-race-condition branch from fc80b28 to 7329433 Compare April 9, 2026 18:49
@ricardogarim ricardogarim force-pushed the fix/embedded-mode-subscription-race-condition branch from 7329433 to 098eaa8 Compare April 9, 2026 18:49
@ggazzo ggazzo self-assigned this Apr 10, 2026
Comment thread apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
Comment thread apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx Outdated
@ricardogarim ricardogarim changed the title fix: verify subscription via REST when local store is empty fix: intermittent "Channel Not Joined" screen in embedded mode Apr 13, 2026
@ricardogarim ricardogarim added this to the 8.4.0 milestone Apr 13, 2026
@ricardogarim ricardogarim marked this pull request as ready for review April 13, 2026 11:15
@ricardogarim ricardogarim requested a review from a team as a code owner April 13, 2026 11:15
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: 1

🧹 Nitpick comments (1)
apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx (1)

42-72: Add a direct embedded-navigation regression test.

This fix lives in preload timing, so tests that reach the room through normal-mode navigation still won't exercise the failing path. A Playwright case that lands directly on an embedded room URL would keep this race from slipping back in.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx` around lines 42
- 72, Add a Playwright regression test that directly navigates to an embedded
room URL to exercise the preload timing path used in EmbeddedPreload.tsx: write
a test that opens the app with a URL matching the embedded-room route (bypassing
normal-mode navigation), waits for the preload logic to run (the useQuery flow
that calls getRoomByTypeAndName and getSubscription), and asserts that
SubscriptionsCachedStore and RoomsCachedStore are marked ready and the embedded
room UI is rendered without a race; target the embedded entrypoint that triggers
EmbeddedPreload useQuery and verify the subscription is present (or the expected
room content is visible) to prevent regression of the timing issue.
🤖 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/views/root/MainLayout/EmbeddedPreload.tsx`:
- Around line 18-35: The memo for roomParams currently only depends on the
router object (singleton) so it never recomputes on navigation; update the logic
so useMemo depends on the dynamic route values instead: capture
router.getRouteName() and router.getRouteParameters() (or their derived values)
and include those in the dependency array used by useMemo; keep the same
internal calls to roomCoordinator.getRouteNameIdentifier,
roomCoordinator.getRoomDirectives, and directives.extractOpenRoomParams but
ensure the memo re-runs when routeName or routeParameters change so roomParams
is recalculated on navigation.

---

Nitpick comments:
In `@apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx`:
- Around line 42-72: Add a Playwright regression test that directly navigates to
an embedded room URL to exercise the preload timing path used in
EmbeddedPreload.tsx: write a test that opens the app with a URL matching the
embedded-room route (bypassing normal-mode navigation), waits for the preload
logic to run (the useQuery flow that calls getRoomByTypeAndName and
getSubscription), and asserts that SubscriptionsCachedStore and RoomsCachedStore
are marked ready and the embedded room UI is rendered without a race; target the
embedded entrypoint that triggers EmbeddedPreload useQuery and verify the
subscription is present (or the expected room content is visible) to prevent
regression of the timing issue.
🪄 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: 761a75f6-24b3-4ea0-bde2-3165461f6551

📥 Commits

Reviewing files that changed from the base of the PR and between a6c863a and 0c13cb1.

📒 Files selected for processing (3)
  • .changeset/eight-clouds-count.md
  • apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
  • apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

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

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
  • apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx
🧠 Learnings (15)
📓 Common learnings
Learnt from: smirk-dev
Repo: RocketChat/Rocket.Chat PR: 39625
File: apps/meteor/app/api/server/v1/push.ts:85-97
Timestamp: 2026-03-14T14:58:58.834Z
Learning: In RocketChat/Rocket.Chat, the `push.token` POST/DELETE endpoints in `apps/meteor/app/api/server/v1/push.ts` were already migrated to the chained router API pattern on `develop` prior to PR `#39625`. `cleanTokenResult` (which strips `authToken` and returns `PushTokenResult`) and `isPushTokenPOSTProps`/`isPushTokenDELETEProps` validators already exist on `develop`. PR `#39625` only migrates `push.get` and `push.info` to the chained pattern. Do not flag `cleanTokenResult` or `PushTokenResult` as newly introduced behavior-breaking changes when reviewing this PR.
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:18.785Z
Learning: In Rocket.Chat PR reviews, maintain strict scope boundaries—when a PR is focused on a specific endpoint (e.g., rooms.favorite), avoid reviewing or suggesting changes to other endpoints that were incidentally refactored (e.g., rooms.invite) unless explicitly requested by maintainers.
📚 Learning: 2026-02-24T19:05:56.710Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: Rocket.Chat repo context: When a workspace manifest on develop already pins a dependency version (e.g., packages/web-ui-registration → "rocket.chat/ui-contexts": "27.0.1"), a lockfile change in a feature PR that upgrades only that dependency’s resolution is considered a manifest-driven sync and can be kept, preferably as a small "chore: sync yarn.lock with manifests" commit.

Applied to files:

  • .changeset/eight-clouds-count.md
📚 Learning: 2026-02-24T19:09:09.561Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.

Applied to files:

  • .changeset/eight-clouds-count.md
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.

Applied to files:

  • .changeset/eight-clouds-count.md
  • apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
📚 Learning: 2026-03-14T14:58:58.834Z
Learnt from: smirk-dev
Repo: RocketChat/Rocket.Chat PR: 39625
File: apps/meteor/app/api/server/v1/push.ts:85-97
Timestamp: 2026-03-14T14:58:58.834Z
Learning: In RocketChat/Rocket.Chat, the `push.token` POST/DELETE endpoints in `apps/meteor/app/api/server/v1/push.ts` were already migrated to the chained router API pattern on `develop` prior to PR `#39625`. `cleanTokenResult` (which strips `authToken` and returns `PushTokenResult`) and `isPushTokenPOSTProps`/`isPushTokenDELETEProps` validators already exist on `develop`. PR `#39625` only migrates `push.get` and `push.info` to the chained pattern. Do not flag `cleanTokenResult` or `PushTokenResult` as newly introduced behavior-breaking changes when reviewing this PR.

Applied to files:

  • .changeset/eight-clouds-count.md
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.

Applied to files:

  • .changeset/eight-clouds-count.md
📚 Learning: 2026-03-11T22:04:20.529Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 39545
File: apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts:59-61
Timestamp: 2026-03-11T22:04:20.529Z
Learning: In `apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts`, the `msg.u._id === uid` early-return in the `streamNewMessage` handler is intentional: the "New messages" indicator is designed to notify about messages from other users only. Self-sent messages — including those sent from a different session/device — are always skipped, by design. Do not flag this as a multi-session regression.

Applied to files:

  • .changeset/eight-clouds-count.md
  • apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.

Applied to files:

  • .changeset/eight-clouds-count.md
📚 Learning: 2026-03-09T18:39:21.178Z
Learnt from: Harxhit
Repo: RocketChat/Rocket.Chat PR: 39476
File: apps/meteor/server/methods/addAllUserToRoom.ts:0-0
Timestamp: 2026-03-09T18:39:21.178Z
Learning: In apps/meteor/server/methods/addAllUserToRoom.ts, the implementation uses a single cursor pass (Users.find(userFilter).batchSize(100)) that collects both the full user objects (collectedUsers: IUser[]) and their usernames (usernames: string[]) in one iteration. `beforeAddUserToRoom` is then called once with the full usernames batch (preserving batch-validation semantics), and the subsequent subscription/message processing loop iterates over the same stable `collectedUsers` array — no second DB query is made. This avoids any race condition between validation and processing while preserving the original batch-validation behavior.

Applied to files:

  • apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
📚 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/views/room/RoomOpenerEmbedded.tsx
📚 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/views/room/RoomOpenerEmbedded.tsx
📚 Learning: 2026-02-10T16:32:49.806Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:49.806Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON which automatically deserializes Date objects. Stream handlers (e.g., sdk.stream()) receive Date fields as Date objects directly and do not require manual conversion using `new Date()`. Only REST API responses require manual date conversion because they return plain JSON where dates are serialized as strings.

Applied to files:

  • apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
📚 Learning: 2026-02-25T20:10:16.987Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.

Applied to files:

  • apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
📚 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/views/room/RoomOpenerEmbedded.tsx
📚 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/views/room/RoomOpenerEmbedded.tsx
  • apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx
🔇 Additional comments (2)
.changeset/eight-clouds-count.md (1)

1-5: Changeset matches the fix scope.

Patch bump and summary are aligned with this embedded-mode regression fix.

apps/meteor/client/views/room/RoomOpenerEmbedded.tsx (1)

42-48: The filter condition on line 43 (if (sub.rid !== rid || event === 'removed')) prevents 'removed' events—which carry partial payloads—from reaching upsertSubscription(). Only 'inserted' and 'updated' events proceed, and these contain all the fields that mapRecord() requires (name, fname, prid, ts, lr). The code is functionally safe. While the as ISubscription cast could be typed more precisely, it does not create the delta-corruption risk described in the original comment.

			> Likely an incorrect or invalid review comment.

Comment thread apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx
Copy link
Copy Markdown
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 3 files

Comment thread apps/meteor/client/views/root/MainLayout/EmbeddedPreload.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants