Skip to content

Conversation

@sahillllllllll-bit
Copy link

@sahillllllllll-bit sahillllllllll-bit commented Jan 3, 2026

Proposed changes (including videos or screenshots)

This PR fixes an issue where the Admin → Workspace page (/admin/info) fails completely when the
GET /api/v1/instances.get request returns an error.

Previously, if the instances endpoint failed (for example, in local, development, or self-hosted setups),
the entire Workspace page showed a generic “Error loading pages” message, even though other required
admin APIs were responding successfully.

With this change, failures from instances.get are handled in isolation so the rest of the Workspace
page continues to render normally. When instance data cannot be loaded, the UI degrades gracefully
instead of failing the entire page.

This is a frontend-only change and does not modify backend behavior or API contracts.

Screenshots

Workspace page loading successfully when instances.get fails (after fix):

Screenshot 2026-01-03 113239

Network tab showing failed instances.get request while other admin APIs succeed:

Screenshot 2026-01-03 113328

Issue(s)

Closes #38045


Steps to test or reproduce

  1. Run Rocket.Chat in a local or development environment
  2. Log in using an Admin account
  3. Navigate to Administration → Workspace (/admin/info)
  4. Open browser DevTools → Network tab
  5. Block or force failure of the request:
  6. Reload the page

Expected result

  • The Workspace page loads normally
  • Other admin sections render as expected
  • No global “Error loading pages” message is shown

Further comments

This change improves error isolation and robustness of the Admin Workspace page by ensuring that a
single non-critical endpoint failure does not cause a full page failure. The approach keeps the fix
minimal and scoped to frontend error handling only.

Summary by CodeRabbit

  • Style

    • Messages authored by the current user now show a subtle left border and tinted background for clearer visual distinction.
  • Bug Fixes

    • Workspace info fetching is now more resilient: failures no longer surface as errors and return empty results instead, reducing disruptions.

✏️ Tip: You can customize this high-level summary in your review settings.

@sahillllllllll-bit sahillllllllll-bit requested a review from a team as a code owner January 3, 2026 06:16
@changeset-bot
Copy link

changeset-bot bot commented Jan 3, 2026

⚠️ No Changeset found

Latest commit: 7da76f7

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 3, 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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

Warning

Rate limit exceeded

@sahillllllllll-bit has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 18 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1240cfa and 7da76f7.

📒 Files selected for processing (1)
  • apps/meteor/client/components/message/variants/RoomMessage.tsx

Walkthrough

Added conditional inline styling to RoomMessage to highlight messages authored by the current user, and adjusted useWorkspaceInfo's instances query to disable retries and prevent thrown errors (by setting retry: false and throwOnError: false) while preserving the existing select mapping.

Changes

Cohort / File(s) Summary
RoomMessage styling
apps/meteor/client/components/message/variants/RoomMessage.tsx
Added an inline style spread on the <Message> component that conditionally sets borderInlineStart and backgroundColor (using color-mix(...)) when message.u._id === currentUserId. No rendering or event changes.
Workspace instances query options
apps/meteor/client/hooks/useWorkspaceInfo.ts
Added query options retry: false and throwOnError: false to the instances query; kept the existing select transform that maps instances and converts _createdAt to Date. Error handling now avoids retrying and prevents thrown errors from bubbling.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nudge a border, tint a tiny part,
My messages wear a subtle art.
I hush the query's noisy cry,
No retries now — errors pass by.
A gentle patch, a rabbit's cart.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Both file modifications are directly scoped to the issue: RoomMessage styling is unrelated and appears to be out-of-scope from the instances.get error handling objective. Remove the RoomMessage.tsx styling changes or clarify their relationship to the instances.get error handling fix in the issue description.
✅ Passed checks (4 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 concisely describes the main fix: preventing admin workspace page failure when instances.get errors.
Linked Issues check ✅ Passed The code changes directly address all objectives from issue #38045 by adding error handling (retry: false, throwOnError: false) to isolate instances.get failures and prevent page-wide failure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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 2 files

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

Caution

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

⚠️ Outside diff range comments (1)
apps/meteor/client/components/message/variants/RoomMessage.tsx (1)

69-98: Unrelated changes: Remove message styling from this PR.

The RoomMessage component changes add conditional styling for messages authored by the current user, but this is completely unrelated to the PR's stated objective of "preventing admin workspace page from failing when instances.get errors."

The PR objectives, title, and linked issue (#38045) all focus exclusively on the Admin → Workspace page (/admin/info) and the instances.get API failure. These message styling changes:

  • Affect the chat message UI, not the admin workspace page
  • Are not mentioned anywhere in the PR description or objectives
  • Introduce unnecessary risk by bundling unrelated features

Please move these styling changes to a separate PR focused on chat message UX improvements.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d3511ea and 8717289.

📒 Files selected for processing (2)
  • apps/meteor/client/components/message/variants/RoomMessage.tsx
  • apps/meteor/client/hooks/useWorkspaceInfo.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/hooks/useWorkspaceInfo.ts
  • apps/meteor/client/components/message/variants/RoomMessage.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

@sahillllllllll-bit sahillllllllll-bit force-pushed the fix-admin-workspace-instances-error branch from e20aafc to a4dacb1 Compare January 3, 2026 06:53
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

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e20aafc and a4dacb1.

📒 Files selected for processing (2)
  • apps/meteor/client/components/message/variants/RoomMessage.tsx
  • apps/meteor/client/hooks/useWorkspaceInfo.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/hooks/useWorkspaceInfo.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/components/message/variants/RoomMessage.tsx

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.

Admin Workspace page fails entirely when instances.get API returns an error

1 participant