fix: voice call fails if user navigates during initial connection - #41044
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: fac1ccd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
WalkthroughAdds a new ChangesDevice ID comparison fix for voice calls
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/media-signaling/src/lib/utils/isSameDeviceId.ts (1)
55-71: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd targeted tests for
isSameDeviceIdequivalence rules.This function defines subtle equality semantics (
stringvs{ exact }, order-insensitive arrays, duplicate collapsing, null/empty-object normalization). Please add focused unit tests to lock this contract and prevent regressions insetDeviceIdgating.🤖 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/media-signaling/src/lib/utils/isSameDeviceId.ts` around lines 55 - 71, Add targeted unit tests for the isSameDeviceId function to verify its subtle equality semantics. The tests should cover: comparing string device IDs versus normalized exact objects, verifying array order-insensitivity for both exact and ideal properties, confirming duplicate value collapsing, and validating null and empty-object normalization behavior. These tests should comprehensively lock the contract to prevent regressions in setDeviceId gating logic that depends on this function.
🤖 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.
Nitpick comments:
In `@packages/media-signaling/src/lib/utils/isSameDeviceId.ts`:
- Around line 55-71: Add targeted unit tests for the isSameDeviceId function to
verify its subtle equality semantics. The tests should cover: comparing string
device IDs versus normalized exact objects, verifying array order-insensitivity
for both exact and ideal properties, confirming duplicate value collapsing, and
validating null and empty-object normalization behavior. These tests should
comprehensively lock the contract to prevent regressions in setDeviceId gating
logic that depends on this function.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 752536ec-6ca9-4aa5-80f4-deb73f8ba587
📒 Files selected for processing (3)
.changeset/tricky-comics-wink.mdpackages/media-signaling/src/lib/Session.tspackages/media-signaling/src/lib/utils/isSameDeviceId.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
- GitHub Check: 📦 Build Packages
- GitHub Check: cubic · AI code reviewer
- GitHub Check: Hacktron Security Check
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
packages/media-signaling/src/lib/Session.tspackages/media-signaling/src/lib/utils/isSameDeviceId.ts
🧠 Learnings (4)
📚 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/tricky-comics-wink.md
📚 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:
packages/media-signaling/src/lib/Session.tspackages/media-signaling/src/lib/utils/isSameDeviceId.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:
packages/media-signaling/src/lib/Session.tspackages/media-signaling/src/lib/utils/isSameDeviceId.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.
Applied to files:
packages/media-signaling/src/lib/Session.tspackages/media-signaling/src/lib/utils/isSameDeviceId.ts
🔇 Additional comments (2)
packages/media-signaling/src/lib/Session.ts (1)
19-19: LGTM!Also applies to: 253-253
.changeset/tricky-comics-wink.md (1)
1-5: LGTM!
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/media-signaling/src/lib/utils/isSameDeviceId.ts">
<violation number="1" location="packages/media-signaling/src/lib/utils/isSameDeviceId.ts:33">
P1: Plain deviceId string/array is normalized as exact instead of ideal, changing ConstrainDOMString semantics. Device constraint-strength changes (ideal vs exact) can be misdetected as unchanged.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-8.6.0 #41044 +/- ##
=================================================
- Coverage 70.19% 70.16% -0.03%
=================================================
Files 3360 3361 +1
Lines 129668 129690 +22
Branches 22485 22467 -18
=================================================
- Hits 91017 91000 -17
- Misses 35339 35378 +39
Partials 3312 3312
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
Issue(s)
CORE-2306
Steps to test or reproduce
Further comments
Summary by CodeRabbit