@xh/hoist 73.0.0-SNAPSHOT.1745446457207 → 73.0.0-SNAPSHOT.1745446674015

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/CHANGELOG.md CHANGED
@@ -11,6 +11,17 @@
11
11
  * Corrected `StoreCountLabelProps` interface.
12
12
  * Corrected `GridGroupSortFn` param types.
13
13
 
14
+ ### ⚙️ Technical
15
+
16
+ * Updated the background version checking performed by `EnvironmentService` to use the app version
17
+ and build information baked into the client build when comparing against the latest values from
18
+ the server. Previously the versions loaded from the server on init were used as the baseline.
19
+ * The two versions *should* be the same, but in cases where a browser "restores" a tab and
20
+ re-inits an app without reloading the code itself, the upgrade check would miss the fact that
21
+ the client remained on an older version.
22
+ * Note that a misconfigured build - where the client build version is not set to the same value as
23
+ the server - would result in a false positive for an upgrade. The two should always match.
24
+
14
25
  ## v72.5.1 - 2025-04-15
15
26
 
16
27
  ### 🐞 Bug Fixes
@@ -31,7 +31,9 @@ export declare class EnvironmentService extends HoistService {
31
31
  isMinHoistCoreVersion(version: string): boolean;
32
32
  isMaxHoistCoreVersion(version: string): boolean;
33
33
  /**
34
- * Update critical environment information from server.
34
+ * Update critical environment information from server, including current app version + build,
35
+ * upgrade prompt mode, and alert banner.
36
+ *
35
37
  * @internal - not for app use. Called by `pollTimer` and as needed by Hoist code.
36
38
  */
37
39
  pollServerAsync(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "73.0.0-SNAPSHOT.1745446457207",
3
+ "version": "73.0.0-SNAPSHOT.1745446674015",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -113,7 +113,9 @@ export class EnvironmentService extends HoistService {
113
113
  }
114
114
 
115
115
  /**
116
- * Update critical environment information from server.
116
+ * Update critical environment information from server, including current app version + build,
117
+ * upgrade prompt mode, and alert banner.
118
+ *
117
119
  * @internal - not for app use. Called by `pollTimer` and as needed by Hoist code.
118
120
  */
119
121
  async pollServerAsync() {
@@ -125,15 +127,15 @@ export class EnvironmentService extends HoistService {
125
127
  return;
126
128
  }
127
129
 
128
- // Update config/interval, and server info
130
+ // Update config/interval, server info, and alert banner.
129
131
  const {pollConfig, instanceName, alertBanner, appVersion, appBuild} = data;
130
132
  this.pollConfig = pollConfig;
131
133
  this.pollTimer.setInterval(this.pollIntervalMs);
132
134
  this.setServerInfo(instanceName, appVersion, appBuild);
133
135
  XH.alertBannerService.updateBanner(alertBanner);
134
136
 
135
- // Handle version change
136
- if (appVersion != XH.getEnv('appVersion') || appBuild != XH.getEnv('appBuild')) {
137
+ // Handle version change - compare to constants baked into client build.
138
+ if (appVersion != XH.appVersion || appBuild != XH.appBuild) {
137
139
  // force the user to refresh or prompt the user to refresh via the banner according to config
138
140
  // build checked to trigger refresh across SNAPSHOT updates in lower environments
139
141
  const {onVersionChange} = pollConfig;