Skip to content

fix: display failure image when server is offline or crashed - #3462

Closed
devanshkansagra wants to merge 3 commits into
RocketChat:devfrom
devanshkansagra:fix/offline-state
Closed

fix: display failure image when server is offline or crashed#3462
devanshkansagra wants to merge 3 commits into
RocketChat:devfrom
devanshkansagra:fix/offline-state

Conversation

@devanshkansagra

@devanshkansagra devanshkansagra commented Aug 18, 2026

Copy link
Copy Markdown

What Changed

Fixed a rendering issue in ErrorView where the failure state showed a blank screen instead of the offline/error message.

The condition was returning true when isFailed was true, so React rendered nothing. Updated the condition so the error UI is shown when the server fails or is being reloaded.

Demo

Screen.Recording.2026-08-18.at.10.17.57.PM.mov

Summary by CodeRabbit

  • Bug Fixes
    • Improved error-state display while content is reloading.
    • Ensured loading indicators, reload controls, countdowns, and failure imagery continue to appear correctly.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b72ac78-54cc-43a9-b5fa-6d1f30e0935c

📥 Commits

Reviewing files that changed from the base of the PR and between 78b57a0 and 51411f8.

📒 Files selected for processing (1)
  • src/ui/components/ServersView/ErrorView.tsx

Included review availability: Your plan includes up to 4 reviews per rolling hour; 3 remain after this review.

📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Prefer optional chaining and fallbacks for platform-specific APIs:
Redux actions follow FSA (Flux Standard Action) shape.

Files:

  • src/ui/components/ServersView/ErrorView.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{tsx,jsx}: Check Theme.d.ts for valid color tokens before using Fuselage colors.
React functional components with hooks.

Files:

  • src/ui/components/ServersView/ErrorView.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: File naming: camelCase for files, PascalCase for components.
No unnecessary comments — self-documenting code through clear naming.

Files:

  • src/ui/components/ServersView/ErrorView.tsx
**/*

📄 CodeRabbit inference engine (AGENTS.md)

Avoid subjective descriptors ("smart", "excellent", "dumb").

Files:

  • src/ui/components/ServersView/ErrorView.tsx
🧠 Learnings (1)
📚 Learning: 2026-08-12T14:11:40.244Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat.Electron PR: 3444
File: src/settingsWindow/sections/GeneralSection.tsx:16-16
Timestamp: 2026-08-12T14:11:40.244Z
Learning: In Rocket.Chat.Electron renderer TypeScript/TSX files running with nodeIntegration enabled, direct access to process.platform and process.mas is intentional; do not require optional-chaining fallbacks for these properties. Optional-chaining safeguards should apply to Linux-only APIs such as process.getuid(), process.getgid(), process.geteuid(), and process.getegid(). Adding fallbacks for process.platform or process.mas can silently select an incorrect UI layout and conceal a renderer configuration error.

Applied to files:

  • src/ui/components/ServersView/ErrorView.tsx
🔇 Additional comments (1)
src/ui/components/ServersView/ErrorView.tsx (1)

59-106: LGTM!


Walkthrough

ErrorView now renders the error state when either isFailed or isReloading is true. Existing loading, reload, countdown, and failure image behavior remains unchanged.

Changes

Offline error view

Layer / File(s) Summary
Error view conditions
src/ui/components/ServersView/ErrorView.tsx
The conditional rendering displays the complete error view for failed and reloading states. Spinner and reload-button branches remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 51411

This localized change restores the offline/error message instead of rendering a blank screen; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested labels: type: bug

🚥 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 title clearly describes the primary fix: displaying the failure image when the server is offline or crashed.
Linked Issues check ✅ Passed The conditional rendering fix addresses issue #3461 by preventing a blank screen during offline, failed, or reloading states.
Out of Scope Changes check ✅ Passed The changes are limited to ErrorView rendering behavior and directly support the linked issue objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/ui/components/ServersView/ErrorView.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


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.

@jeanfbrito

Copy link
Copy Markdown
Member

Closing as already landed.

The ErrorView operator-precedence fix (isFailed || (isReloading && …)(isFailed || isReloading) && …) is already on dev via #3429 (150b36c, merged 2026-08-18). After merging dev into this branch the PR is empty (0 files). Thanks @devanshkansagra — the same change you opened here is what shipped.

Closing #3461 against that landing.

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.

UI shows blank screen when the server is offline

2 participants