Skip to content

Check GitHub Releases for updates on Linux instead of the missing static manifest (#1216) - #1222

Open
alandebortolo wants to merge 1 commit into
Snapmaker:mainfrom
DesignMaster-Solutions:fix/linux-update-check
Open

alandebortolo wants to merge 1 commit into
Snapmaker:mainfrom
DesignMaster-Solutions:fix/linux-update-check

Conversation

@alandebortolo

Copy link
Copy Markdown

Fixes #1216.

What happens

On Linux, Help > Check for Update always ends in the dialog request to server update soft fail with body:,error:,status:404, and the same request fails quietly at every start.

  1. request_version_from_config() posts appName: snapmaker-orca on Linux. The config service has no such app (code 604000 in the issue), so the app falls back to check_new_version_sf().
  2. check_new_version_sf() asks for /upgrade/orca/linux/<lang>/version.json. Checked today:
URL HTTP
https://meta-cfg.snapmaker.com/upgrade/orca/win/en/version.json 200
https://meta-cfg.snapmaker.com/upgrade/orca/mac/en/version.json 200
https://meta-cfg.snapmaker.com/upgrade/orca/linux/en/version.json 404
https://meta-cfg.snapmaker.com/upgrade/orca/linux/zh_CN/version.json 404
  1. Publishing a Linux manifest would not be enough on its own. Both parsers only accept platform_type win or mac. For anything else check_new_version_sf() logs don't support linux upgrade and returns without showing a dialog, and request_version_from_config() rejects the payload (platform_type mismatch for this build, or unsupported platform_type). So with a manifest in place the menu item would do nothing at all on Linux.

Change

On Linux, check_new_version_sf() reads https://api.github.com/repos/Snapmaker/OrcaSlicer/releases/latest instead of the static manifest. The Linux builds (AppImage and both flatpaks) are already published there with every release, and that endpoint never returns a draft or a pre-release, which matches the stable-only rule of the manifest path.

  • Newer release found: the existing update dialog opens with the version, and Download opens the release page in the browser (that button already calls wxLaunchDefaultBrowser).
  • Not newer, and the user asked: the existing "This is the newest version." dialog.
  • Not newer at startup: nothing, as on Windows and macOS.
  • Tag or URL missing or unparsable: logged, no dialog.
  • orca_upgrade_url set in the config: the override is still used, and a manifest-shaped answer still goes to the existing parser.

The dialog shows the release title instead of the release notes. The notes on GitHub are Markdown with image links and the dialog renders plain text; the full notes are one click away on the release page.

Everything is inside #if defined(__linux__). Windows and macOS compile exactly the same code as before. One file, 45 lines added, none changed.

Tested

I did not build the app. I extracted the new block from the patched GUI_App.cpp as is and compiled it against the repo's own nlohmann/json.hpp, Semver.hpp and semver.c, with get_version() copied from the same file and only the wx pieces stubbed. Inputs: the real answer of the GitHub endpoint saved today (latest is v2.4.1) and the real Windows manifest.

Build version Asked by Result
2.4.0 user update dialog, version 2.4.1, URL https://github.com/Snapmaker/OrcaSlicer/releases/tag/v2.4.1, flagged as user-initiated
2.4.0 startup update dialog, not flagged as user-initiated (so Skip this Version applies)
2.4.1 user "This is the newest version."
2.4.1 startup nothing
2.4.2, 2.4.2-alpha, 3.0.0 user "This is the newest version." (no offer to go back)
2.4.1-beta user update dialog
tag_name null, tag_name "nightly", no html_url, html_url null user logged, no dialog
name and body null user update dialog with empty text, no exception
Windows manifest as the answer user reaches the existing manifest parser

To see the checks fail, I broke the block four ways (keep the leading v, >= to >, drop the URL check, drop the version check). Each one failed an assertion; the unmodified block passes all 14 cases.

The endpoint answers 200 to the user agent the app sends (Snapmaker_Orca/<version>), without a token.

Not tested

  • The built app on Linux, so I have not seen the dialog itself. The dialog code is the one Windows and macOS already use.
  • The request through the app's Http class (TLS, proxy). Only curl with the same user agent.
  • GitHub's unauthenticated limit is 60 requests per hour per IP. One request per start should stay far below it, but behind a shared address a check could get 403 and the user would see the existing error dialog with that status.

If you would rather keep Linux on your own servers, the alternative is a Linux manifest plus a linux branch in both parsers. I can change the PR to that if you tell me what the manifest would contain for Linux (there is one file per platform today, and Linux has three).

Help > Check for Update always failed on Linux with HTTP 404: no static
manifest is published under /upgrade/orca/linux/, and both version parsers
accept only win/mac payloads, so a manifest alone would not help (Snapmaker#1216).

On Linux the static fallback now reads the latest stable GitHub release and
feeds the existing update dialog; Download opens the release page. An
explicit orca_upgrade_url override is still honoured. Windows and macOS
compile the same code as before.
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.

[Linux] Help > Check for Updates always fails: linux/version.json returns 404

2 participants