maxpool 1.8.7 → 1.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/account-manager.js +6 -0
- package/src/index.js +3 -1
- package/src/updater.js +11 -0
package/package.json
CHANGED
package/src/account-manager.js
CHANGED
|
@@ -3689,6 +3689,12 @@ export class AccountManager {
|
|
|
3689
3689
|
// Running version + npm update state (set at startup by maybeCheckForUpdate).
|
|
3690
3690
|
// null until the check resolves; `current` is known even offline.
|
|
3691
3691
|
version: this.versionInfo || null,
|
|
3692
|
+
// The version whose CODE is EXECUTING. `version.current` is a package.json DISK
|
|
3693
|
+
// read, so after a self-install (or on an npm-link'd checkout) it reports the
|
|
3694
|
+
// newest INSTALLED build, not the running one — a post-deploy check keyed on it
|
|
3695
|
+
// verifies the wrong thing (measured 2026-08-23: reported 1.8.7 while executing
|
|
3696
|
+
// 1.8.6). This field is the one to assert on.
|
|
3697
|
+
runningVersion: this.runningVersion || null,
|
|
3692
3698
|
currentAccount: this.accounts[this.currentIndex]?.name,
|
|
3693
3699
|
switchThreshold: this.switchThreshold,
|
|
3694
3700
|
routing: {
|
package/src/index.js
CHANGED
|
@@ -33,7 +33,7 @@ import { loginOAuth, fetchProfile, refreshAccessToken, isTokenExpiringSoon, toke
|
|
|
33
33
|
import { TUI } from './tui.js';
|
|
34
34
|
import { RestartController } from './restart-controller.js';
|
|
35
35
|
import { resolveAccounts } from './account-config.js';
|
|
36
|
-
import { maybeCheckForUpdate, getCurrentVersion, markApplied, clearQuarantine } from './updater.js';
|
|
36
|
+
import { maybeCheckForUpdate, getCurrentVersion, markApplied, clearQuarantine, getBootVersion } from './updater.js';
|
|
37
37
|
import {
|
|
38
38
|
runReloadBaton,
|
|
39
39
|
RELOAD_SWAPPED, RELOAD_ROLLED_BACK,
|
|
@@ -1259,6 +1259,8 @@ async function serverWorkerCommand() {
|
|
|
1259
1259
|
// pass the real config so they still respect the user's autoUpdate choice.
|
|
1260
1260
|
const cfg = forceInstall ? { ...config, autoUpdate: true } : config;
|
|
1261
1261
|
const r = await maybeCheckForUpdate(cfg, notifyUpdate, info => { accountManager.versionInfo = info; }, { announce });
|
|
1262
|
+
// Capture the EXECUTING version for /maxpool/status (see AccountManager.getStatus).
|
|
1263
|
+
accountManager.runningVersion = getBootVersion();
|
|
1262
1264
|
apply(r);
|
|
1263
1265
|
return r;
|
|
1264
1266
|
} catch { return undefined; /* update path is best-effort; never break the proxy */ }
|
package/src/updater.js
CHANGED
|
@@ -85,6 +85,17 @@ let _lastAttemptedTarget = null;
|
|
|
85
85
|
/** Test-only: reset the module's version-tracking state between cases. */
|
|
86
86
|
export function __resetUpdaterState() { _bootVersion = undefined; _lastAttemptedTarget = null; }
|
|
87
87
|
|
|
88
|
+
/** The version whose CODE this process is EXECUTING (captured at boot, before any
|
|
89
|
+
* self-install can rewrite the disk). Everything user-facing that says "current"
|
|
90
|
+
* should use THIS — a disk read reports the newest INSTALLED version, which after a
|
|
91
|
+
* background self-install (or on an npm-link'd dev checkout whose package.json moves
|
|
92
|
+
* with every commit) is not what is running. Measured 2026-08-23: the status endpoint
|
|
93
|
+
* answered 1.8.7 for a process executing 1.8.6, and a post-deploy check keyed on that
|
|
94
|
+
* number verified the wrong build. */
|
|
95
|
+
export function getBootVersion() {
|
|
96
|
+
return _bootVersion ?? null; // null only before the first maybeCheckForUpdate
|
|
97
|
+
}
|
|
98
|
+
|
|
88
99
|
/** Mark a version as ATTEMPTED-to-apply. The caller calls this at the moment it triggers
|
|
89
100
|
* the reload — BEFORE the reload — so a rolled-back target is quarantined (advance-only).
|
|
90
101
|
* Kept as the caller's action (not a side effect of maybeCheckForUpdate) so a caller that
|