[GH-ISSUE #4372] [Issue]: Updated capability client keeps the previous custom-element UI until page refresh #2373

Closed
opened 2026-10-21 05:47:43 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @thetopham on GitHub (Jul 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4372

Originally assigned to: @thetopham on GitHub.

Summary

Updating an installed capability package that contributes client UI can leave an already-open Marinara browser tab running the previous custom-element implementation. The server and installed manifest report the new package version, but newly added UI remains unavailable until the user performs a full page refresh.

This was observed with World Maps 1.2.3 after the shared-world Game Setup integration landed in Pasta-Devs/Marinara-Engine#4329 and Pasta-Devs/Marinara-Agents#149: Game Setup listed both shared worlds and templates, but shared-world cards still exposed the older non-setup actions while templates could be selected.

Environment

  • Engine release: v2.3.5
  • Live Engine commit: e1322b0ff1a0
  • World Maps: 1.2.3, active and ready
  • Installed/served World Maps client SHA-256: e7376ff6da77adb475bf6bdf42db9238108e0e69c4b37be4a6c97552e6bab713

Evidence

  • The installed manifest and live /api/capability-packages/hierarchical-maps/client?v=1.2.3 response have the same SHA-256.
  • The served module contains supportedSelectionKinds, Use shared world, and the setup-apply view.
  • useCapabilityClientModules() keys dynamic imports by package version, but the package module registers its custom element only when customElements.get(tag) is absent.
  • After an update, the old element constructor remains registered for the lifetime of the page. Importing the new module cannot replace it, while the loader currently treats the existing tag as proof that the new module is ready.

Reproduction

  1. Open Marinara with an older version of a capability package that contributes client UI.
  2. Update the package without closing/reloading the browser tab.
  3. Complete any required Engine restart.
  4. Open a surface that uses UI added by the new package version.
  5. Observe that the old custom-element implementation remains active until a full page refresh.

Expected behavior

When a ready client-capability version changes while an older constructor is already registered, Marinara should complete the update by refreshing the web shell (or clearly require and enforce a refresh) instead of silently reporting the new module as ready while rendering the old UI.

Scope

This is an Engine capability-client lifecycle bug, not a World Maps source/artifact omission. A hard page refresh is the immediate workaround.

Originally created by @thetopham on GitHub (Jul 31, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4372 Originally assigned to: @thetopham on GitHub. ## Summary Updating an installed capability package that contributes client UI can leave an already-open Marinara browser tab running the previous custom-element implementation. The server and installed manifest report the new package version, but newly added UI remains unavailable until the user performs a full page refresh. This was observed with World Maps 1.2.3 after the shared-world Game Setup integration landed in Pasta-Devs/Marinara-Engine#4329 and Pasta-Devs/Marinara-Agents#149: Game Setup listed both shared worlds and templates, but shared-world cards still exposed the older non-setup actions while templates could be selected. ## Environment - Engine release: v2.3.5 - Live Engine commit: `e1322b0ff1a0` - World Maps: 1.2.3, active and ready - Installed/served World Maps client SHA-256: `e7376ff6da77adb475bf6bdf42db9238108e0e69c4b37be4a6c97552e6bab713` ## Evidence - The installed manifest and live `/api/capability-packages/hierarchical-maps/client?v=1.2.3` response have the same SHA-256. - The served module contains `supportedSelectionKinds`, `Use shared world`, and the `setup-apply` view. - `useCapabilityClientModules()` keys dynamic imports by package version, but the package module registers its custom element only when `customElements.get(tag)` is absent. - After an update, the old element constructor remains registered for the lifetime of the page. Importing the new module cannot replace it, while the loader currently treats the existing tag as proof that the new module is ready. ## Reproduction 1. Open Marinara with an older version of a capability package that contributes client UI. 2. Update the package without closing/reloading the browser tab. 3. Complete any required Engine restart. 4. Open a surface that uses UI added by the new package version. 5. Observe that the old custom-element implementation remains active until a full page refresh. ## Expected behavior When a ready client-capability version changes while an older constructor is already registered, Marinara should complete the update by refreshing the web shell (or clearly require and enforce a refresh) instead of silently reporting the new module as ready while rendering the old UI. ## Scope This is an Engine capability-client lifecycle bug, not a World Maps source/artifact omission. A hard page refresh is the immediate workaround.
bsakaguchi 2026-10-21 05:47:43 +07:00
Author
Owner

@thetopham commented on GitHub (Jul 31, 2026):

I’m taking this on in fix/capability-client-refresh-4372 from current origin/staging. The fix preserves the version of the client code that is actually registered for the page lifetime, blocks stale custom-element UI when a newer ready package is detected, and presents an explicit localized Refresh now state instead of claiming the new module is ready. I’ll open the draft PR as soon as the first focused commit is pushed.

<!-- gh-comment-id:5147552152 --> @thetopham commented on GitHub (Jul 31, 2026): I’m taking this on in `fix/capability-client-refresh-4372` from current `origin/staging`. The fix preserves the version of the client code that is actually registered for the page lifetime, blocks stale custom-element UI when a newer ready package is detected, and presents an explicit localized **Refresh now** state instead of claiming the new module is ready. I’ll open the draft PR as soon as the first focused commit is pushed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2373
No description provided.