-
Notifications
You must be signed in to change notification settings - Fork 246
feat: failsafe mode #952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: failsafe mode #952
Conversation
…adjust video settings UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a failsafe mode feature for the JetKVM application to handle critical process failures gracefully, particularly video capture crashes. When a failure is detected, the system enters failsafe mode, displays relevant UI notifications, restricts access to affected features, and provides crash log download functionality.
- Adds server-side crash detection and failsafe mode activation logic
- Implements UI overlays and banners to notify users of failsafe mode
- Blocks video-related RPC methods when in failsafe mode
- Provides crash log retrieval and GitHub issue reporting workflow
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| failsafe.go | New file implementing core failsafe detection logic and crash log handling |
| main.go | Adds failsafe mode check at application startup |
| webrtc.go | Integrates failsafe mode notifications into session lifecycle events |
| video.go | Adds failsafe notification to video state retrieval |
| native.go | Passes failsafe state to native subsystem initialization |
| internal/native/native.go | Adds disable flag to skip native initialization in failsafe mode |
| internal/native/cgo_linux.go | Guards all CGO calls with failsafe disabled checks |
| jsonrpc.go | Registers new RPC handler for retrieving failsafe logs |
| log.go | Adds dedicated logger for failsafe subsystem |
| cmd/main.go | Enhances crash dump creation with symlink management |
| ui/src/hooks/stores.ts | Adds failsafe mode state management store |
| ui/src/hooks/useJsonRpc.ts | Blocks video-related RPC methods in failsafe mode |
| ui/src/routes/devices.$id.tsx | Integrates failsafe mode UI and conditionally renders video |
| ui/src/routes/devices.$id.settings.tsx | Disables video/hardware settings navigation in failsafe mode |
| ui/src/routes/devices.$id.settings.general.reboot.tsx | Adds loading state to reboot dialog |
| ui/src/components/FaileSafeModeOverlay.tsx | New overlay component for failsafe mode with log download |
| ui/src/components/FailSafeModeBanner.tsx | New banner component for settings page failsafe notification |
| ui/src/index.css | Adds diagonal stripes CSS class for failsafe UI |
Comments suppressed due to low confidence (1)
ui/src/components/FaileSafeModeOverlay.tsx:1
- The filename 'FaileSafeModeOverlay.tsx' has an inconsistent spelling - 'Faile' should be 'Fail'. This creates a mismatch with the exported component name 'FailSafeModeOverlay' and the import path.
import { useState } from "react";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // unlink the last crash log file | ||
| failsafeCrashLog = string(content) | ||
| _ = os.Remove(lastCrashPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we delay trashing the crashlog until we've exited the failsafe mode through some action?
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… simplify setFailsafeMode function
…eo rendering logic
…ebRTCVideo rendering logic" This reverts commit 4def3e6.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com> Co-authored-by: Marc Brooks <IDisposable@gmail.com>
The feature will be ported to
devlater once this PR is merged