fix: show error state with retry when video conference block fails to load#38828
fix: show error state with retry when video conference block fails to load#38828KumarHarshit3603 wants to merge 8 commits intoRocketChat:developfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
No actionable comments were generated in the recent review. 🎉 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
WalkthroughA single-file change adds explicit error handling UI to the VideoConferenceBlock component, replacing a TODO with a structured error message and retry button. Control flow now checks pending first, then error, and new fuselage UI components are imported to compose the error state. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx
🧠 Learnings (1)
📚 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:
packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx
⏰ 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 comments (1)
packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx (1)
2-2: LGTM — all new imports are consumed in the error state block.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx`:
- Line 126: The translation key "We_Could_not_retrive_any_data" is misspelled
and must be renamed to "We_Could_not_retrieve_any_data" across locales and code
references; update the key in all language files under
packages/i18n/src/locales/ (replace the misspelled key with the corrected one)
and then update every code reference to the old key (e.g., in
VideoConferenceBlock component StatesSubtitle usage, AccountTokensTable,
DeviceManagementInfoWithData, DeviceManagementTable) to use
"We_Could_not_retrieve_any_data"; after renaming, run the i18n build/extraction
or linting steps and run the app/tests to ensure no missing-key regressions.
- Around line 124-128: The error message access is unsafe because
useVideoConfData returns useQuery without an explicit error type (TError
defaults to unknown); update the hook useVideoConfData to call useQuery with an
Error error type (e.g., useQuery<..., Error>(...)) so result.error is typed as
Error and result.error.message is allowed, or alternatively narrow the error in
the component (VideoConferenceBlock) with a type guard before reading
result.error.message; locate useVideoConfData (the hook that wraps useQuery) and
adjust its generic error type or add a runtime/type-guard in the component
before using StatesSubtitle to render result.error.message.
Proposed changes
When the video conference block failed to load (e.g. network error or API failure), the component only showed a loading skeleton with no way to recover. This PR adds a proper error state with a retry action.
Issue
packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsxresult.isError, the component returned the same<VideoConfMessageSkeleton />as for loading (result.isPending), so users saw an endless skeleton with no explanation or retry.Changes
Separate loading and error handling
result.isPending): Still showsVideoConfMessageSkeleton(unchanged).result.isError): Renders an explicit error state instead of the skeleton.New error state UI
VideoConfMessage/VideoConfMessageRow/VideoConfMessageContent) so the block looks consistent with other video conf states.States:Something_went_wrong).result.refetch()to re-run the request.Dependencies
@rocket.chat/fuselage:Box,States,StatesAction,StatesActions,StatesIcon,StatesSubtitle,StatesTitle.The behavior and layout match the error + retry pattern used elsewhere (e.g.
DeviceManagementTable), adapted to the video conference message block.Issue(s)
// TODO: error handlinginVideoConferenceBlock.tsx(previously around lines 111–114).Steps to test or reproduce
/v1/video-conference.info).Summary by CodeRabbit