electron.update_policy¶
Internal Electron launcher policy helpers for payload selection.
Overview¶
electron/update_policy.ts resolves the newest payload compatible with the
current launcher release and decides whether the app can keep using the active
payload, switch to an installed compatible version, or download one.
It provides small pure helpers for:
manifestUrlForLauncherVersion(version, overrideUrl?)— returns the default GitHub manifest URL forlauncher-v<version>, unlessTASKCLF_MANIFEST_URLsupplies an explicit override.compareVersions(...)— comparesX.Y.Zpayload versions numerically.isPayloadVersionCompatible(...)— checks a payload version against the launcher manifest's compatibility range.selectLatestCompatiblePayloadVersion(...)— picks the newest payload from the payload index that satisfies the launcher's compatibility range.resolvePayloadSyncPlan(...)— classifies launcher/payload state as:none,switch, ordownload.
The module exists so the updater can make the release-channel decision in one place and so the policy can be unit-tested without pulling in Electron runtime state.
Behavior¶
- If the active payload already matches the desired payload version and its
backend executable exists, the policy returns
none. - If the desired payload is already cached locally but
active.jsonpoints at another version, the policy returnsswitch. - If the desired payload is not installed, the policy returns
download.
Integration¶
- Used by
electron_shellviaelectron/updater.ts - Compatible version lists for the tray menu and optional install/update
chooser reuse the same policy via
electron_payload_choice(electron/payload_choice.ts). - Covered by
electron/update_policy.test.js