fix: desktop client should trust server's MODEL_VERSION (not bake its own)
Summary
The desktop preload (desktop/src/ui/preload.ts:113) explicitly overrides serverConfig.MODEL_VERSION with the value baked into the desktop binary at build time. This causes the "New version is available" blocking dialog to fire whenever the desktop's bundled MODEL_VERSION differs from the server's reported value — even when the server is fully healthy.
This PR uses the server's authoritative MODEL_VERSION instead, falling back to the bundled value only when the server does not report one.
Tag-convention note: Thanks to @armisav for clarifying that
v*are production desktop/server builds ands*are developer builds — they are not paired. This PR is not about pairing the two; it's about making the productionv*desktop tolerant of any server whoseMODEL_VERSIONdiffers from what the desktop happened to bake at build time. That includes self-hosted users runnings*server images from Docker Hub, but also any future drift between desktop and serverversion.txtwithin the same track.
Symptom (from a real self-hosted user)
- Desktop: production
v0.7.423Mac binary, downloaded from huly.io - Server: self-hosted
hardcoreeng/*:s0.7.423images (thes*Docker tags are what's published for self-hosting) - Server
/config.jsonreportsMODEL_VERSION="0.7.422" - Desktop's bundled
MODEL_VERSION="0.7.423"(fromversion.txtat thev0.7.423commit) - Result: blocking dialog "New version is available / Please update / 0.7.422 => 0.7.423" on every launch; the client refuses to connect.
The only workaround is to manually patch app.asar to overwrite the bundled MODEL_VERSION to match what the server reports. Self-hosted users hit this any time a v* desktop release bakes a different version.txt than the s* server they're running.
Trace
desktop/src/ui/preload.ts:113overrides server-providedMODEL_VERSIONwithmainConfig.MODEL_VERSION(the bundled value from webpackDefinePluginreadingversion.txtat build time).plugins/workbench-resources/src/connect.ts:550then compares the workspace's actual data model version against this bundled "required" value with strict inequality (requiredVersion !== versionStr), failing in either direction — client newer or older than server.- For self-hosted users on
s*servers, the bundled value is regularly newer than the server, and the dialog blocks every launch.
The fix
- MODEL_VERSION: mainConfig.MODEL_VERSION,
+ MODEL_VERSION: serverConfig.MODEL_VERSION ?? mainConfig.MODEL_VERSION,
The server already publishes MODEL_VERSION in /config.json (the front-image / workspace-service authoritative value). Trusting that:
- Eliminates the false-positive dialog when the desktop's bundled
version.txthappens to differ from the server's. - Still works correctly when the workspace data is genuinely behind what the server requires (the workbench check fires legitimately against
serverConfig.MODEL_VERSION). - Falls back to the bundled value if the server does not report
MODEL_VERSION— no regression for legacy server images.
Why not solve at the CI / release-process layer
CI-level guards (e.g., validating version.txt consistency before tagging) are good defense-in-depth, but they can't unbreak users who already have an affected binary installed. This client-side change makes the desktop robust to whatever version.txt was baked at build time, so the next time desktop and server drift, customers don't get stuck.
Testing
Verified the dialog is suppressed by reproducing the underlying effect on an installed v0.7.423 Mac binary: extracted app.asar, replaced MODEL_VERSION:"0.7.423" with "0.7.422" (the server's reported value) in dist/main/electron.js, repacked, re-signed. The Mac client then connects to a self-hosted s0.7.423 server with no dialog and full functionality. This PR achieves the same effect at runtime by reading the value from the server rather than from the bundle.
Related
- #10796 (merged) — re-enabled
check_model_version.jsto catchmodels/-without-version.txtdrift within a single branch.
Connected to Huly®: UBERF-16461