@kehto/shell 0.24.1 → 0.24.2

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/README.md CHANGED
@@ -214,6 +214,16 @@ payload.
214
214
  - `originRegistry` — origin-to-windowId map used by proxies and bridge broadcasts
215
215
  - `PendingUpdate` — type for pending aggregate-hash change prompts
216
216
 
217
+ Environment snapshots belong to one source registration. To retire a window,
218
+ call `bridge.runtime.destroyWindow(windowId)`,
219
+ `bridge.runtime.sessionRegistry.unregister(windowId)`, and
220
+ `originRegistry.unregister(windowId)`. When registering a replacement under the
221
+ same window ID, provide its snapshot with `originRegistry.setEnvironment()` or
222
+ let the bridge call `resolveShellEnvironment()` for current host defaults. A
223
+ retired registration's cached domains and service names are discarded even when
224
+ the runtime session was already removed. This applies before any domain dispatch,
225
+ including requests sent before the optional `shell.ready` exchange.
226
+
217
227
  ### Manifest cache
218
228
  - `manifestCache` — browser-specific manifest cache singleton
219
229
  - `ManifestCacheEntry` — manifest cache entry type
package/dist/index.js CHANGED
@@ -1126,10 +1126,10 @@ function registerNip5dSessionIfNeeded({
1126
1126
  if (existing && previousRegistration === sourceRegistrationId) {
1127
1127
  return;
1128
1128
  }
1129
+ state.environments.delete(windowId);
1129
1130
  if (existing && previousRegistration !== void 0) {
1130
1131
  runtime.destroyWindow(windowId);
1131
1132
  runtime.sessionRegistry.unregister(windowId);
1132
- state.environments.delete(windowId);
1133
1133
  }
1134
1134
  if (existing && previousRegistration === void 0) {
1135
1135
  state.sessionRegistration.set(windowId, sourceRegistrationId);