Skip to content

Conversation

@ym
Copy link
Contributor

@ym ym commented Oct 29, 2025

Also implements #344

This PR will be backported to https://github.com/jetkvm/kvm/tree/release/049 as part of 0.4.10. Since we don’t plan to introduce i18n in the 0.4.x series, the translation files will be removed during the backport.

@ym ym force-pushed the r/ota branch 2 times, most recently from 9fc745e to 02cf605 Compare October 31, 2025 17:17
@ym ym requested a review from Copilot October 31, 2025 17:17
Copy link
Contributor

Copilot AI left a 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 introduces a downgrade/version-specific update capability for JetKVM, allowing users to install specific versions from GitHub releases through a new developer mode feature. The changes refactor the OTA (Over-The-Air) update system into a dedicated internal package with improved state management, and add UI components for version-specific updates with downgrade support.

  • Refactored OTA functionality into internal/ota package with better separation of concerns
  • Added support for targeting specific app and system versions for updates/downgrades
  • Introduced new UI components and flows for version-specific updates in developer settings
  • Enhanced deployment script with connectivity checks and improved error handling

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/ota/*.go New OTA package with state management, update logic, and component-based update handling
ota.go Refactored to use new internal OTA package and added RPC methods for component updates
ui/src/routes/devices.$id.settings.advanced.tsx Added developer UI for specifying target versions and initiating version-specific updates
ui/src/routes/devices.$id.settings.general.update.tsx Added downgrade flow and confirmation dialog
ui/src/components/NestedSettingsGroup.tsx New component for visually grouping nested settings
ui/src/hooks/useVersion.tsx Added detection for dev version and downgrade availability fields
config.go Added configurable update API URL support
scripts/dev_deploy.sh Added connectivity checks and SSH options for better deployment reliability
jsonrpc.go Registered new RPC handlers for component-based updates
Comments suppressed due to low confidence (1)

ui/src/routes/devices.$id.settings.general.update.tsx:18

  • Unused variable setSearchParams.
  const [searchParams, setSearchParams] = useSearchParams();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ym ym force-pushed the r/ota branch 2 times, most recently from 797f705 to ae197c5 Compare October 31, 2025 17:39
@adamshiervani
Copy link
Contributor

@ym can you add proper handling of 404? Right now, if you specify a version that doesn't exist, you get redirected to the general/update with a notification that says [Object Object].

@ym ym requested a review from adamshiervani November 7, 2025 09:01
@ym ym marked this pull request as ready for review November 7, 2025 09:01
@ym ym changed the title WIP: OTA refactor OTA refactor Nov 7, 2025
@adamshiervani
Copy link
Contributor

There is still a bug:

  1. Deploy PR
  2. Check for update
  3. Click "Update now".

The update starts, but I'm taken to the Checking for updates screen with the progress bars.

@ym
Copy link
Contributor Author

ym commented Nov 18, 2025

There is still a bug:

  1. Deploy PR
  2. Check for update
  3. Click "Update now".

The update starts, but I'm taken to the Checking for updates screen with the progress bars.

It took me some time to reproduce this issue. The root cause is that our release API is sometimes too slow and exceeds attemptTimeoutMs. The default timeout is 5s, but in my tests the request took around 6s, which triggers the fallback behavior and sends the UI back to the "Checking for updates" screen.

I think we should move the /releases endpoint to a separate backend so it isn’t affected by load on the main API, which should improve both performance and reliability.

It turns out my PŸUR cable connection went down again, and the failover didn’t re-route DNS or disable IPv6 :(

In any case, please let me know if you’re still able to reproduce the issue.
If not, please run this branch with LOG_TRACE_SCOPES=ota so I can see which part is taking so long to complete.

2025-11-18T03:09:41Z TRC jetkvm ota checkUpdateStatus: getLocalVersion appVersionLocal=0.4.9-dev202511180307 duration=0.0385 requestID=aa45c395-f2e9-4106-8bd9-87870d401420 systemVersionLocal=0.2.7
2025-11-18T03:09:41Z TRC jetkvm ota fetchUpdateMetadata: getUpdateURL duration=0.746958 requestID=aa45c395-f2e9-4106-8bd9-87870d401420
2025-11-18T03:09:47Z TRC jetkvm ota fetchUpdateMetadata: response duration=6023.059605 requestID=aa45c395-f2e9-4106-8bd9-87870d401420 status=200
2025-11-18T03:09:47Z TRC jetkvm ota fetchUpdateMetadata: completed duration=6024.226272 requestID=aa45c395-f2e9-4106-8bd9-87870d401420
2025-11-18T03:09:47Z TRC jetkvm ota checkUpdateStatus: fetchUpdateMetadata duration=6031.541564 remoteMetadata={"appHash":"220db72f14a0661d5d62aaafbe47089c706f2562649ec4e794511906d499d568","appUrl":"https://update.jetkvm.com/app/0.4.9/jetkvm_app","appVersion":"0.4.9","systemHash":"da62bc0246d84e575c719a076a8f403e16e492192e178ecd68bc04ada853f557","systemUrl":"https://update.jetkvm.com/system/0.2.7/system.tar","systemVersion":"0.2.7"} requestID=aa45c395-f2e9-4106-8bd9-87870d401420
2025-11-18T03:09:47Z TRC jetkvm ota checkUpdateStatus: remoteMetadataToComponentStatus [app] available=true availableReason="remote version 0.4.9 is greater than local version 0.4.9-dev202511180307" dependsOn=[] downloadFinishedAt=0001-01-01T00:00:00Z downloadProgress=0 hash=220db72f14a0661d5d62aaafbe47089c706f2562649ec4e794511906d499d568 localVersion=0.4.9-dev202511180307 pending=false requestID=aa45c395-f2e9-4106-8bd9-87870d401420 updateProgress=0 updatedAt=0001-01-01T00:00:00Z url=https://update.jetkvm.com/app/0.4.9/jetkvm_app verificationProgress=0 verifiedAt=0001-01-01T00:00:00Z version=0.4.9
2025-11-18T03:09:47Z TRC jetkvm ota checkUpdateStatus: remoteMetadataToComponentStatus [system] available=false availableReason="remote version 0.2.7 is greater than local version 0.2.7" dependsOn=[] downloadFinishedAt=0001-01-01T00:00:00Z downloadProgress=0 hash=da62bc0246d84e575c719a076a8f403e16e492192e178ecd68bc04ada853f557 localVersion=0.2.7 pending=false requestID=aa45c395-f2e9-4106-8bd9-87870d401420 updateProgress=0 updatedAt=0001-01-01T00:00:00Z url=https://update.jetkvm.com/system/0.2.7/system.tar verificationProgress=0 verifiedAt=0001-01-01T00:00:00Z version=0.2.7
2025-11-18T03:09:47Z TRC jetkvm ota checkUpdateStatus: completed duration=6041.999274 requestID=aa45c395-f2e9-4106-8bd9-87870d401420

adamshiervani and others added 21 commits November 18, 2025 11:27
@ym ym merged commit 752fb55 into dev Nov 19, 2025
4 of 5 checks passed
@ym ym deleted the r/ota branch November 19, 2025 14:21
ym added a commit that referenced this pull request Nov 19, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com>
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.

4 participants