Repository navigation
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…cache on asset patches get_ui_asset_bundle cached by entry-URL hash only and returned the cached bundle without recomputing _bundle_signature, so patched plugin/core webui assets (e.g. _model_config/webui/*) never invalidated the in-memory bundle until run_ui restart. /ui/asset-bundle served a stale version, splash.html kept the old SW registration, and stale model-config-store.js dropped the vision slot on preset save. Now the signature is computed on every call and the cached bundle is used only when cached['signature'] matches; on mismatch the bundle is rebuilt and re-cached. Server-side fix self-heals clients (new version -> splash re-registers SW -> cleanupCaches purges old caches). Refs: dev-ticket-2026-08-24-webui-preset-save-sw-bug.md
Author
|
Refreshed this against latest main. The bundle cache still serves stale patched assets after a webui change without the signature revalidation, so the fix still applies. |
wgnrai
force-pushed
the
fix/ui-bundler-cache-invalidation
branch
from
September 23, 2026 04:40
2e7deb3 to
5ba6b5d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
get_ui_asset_bundle()cached the UI asset bundle in an in-memory cache keyed by entry-URL hash only, and returned the cached bundle WITHOUT recomputing_bundle_signature()(which already covers plugin webui file mtimes). Any change to core or plugin webui assets after process start (e.g. a plugin patching_model_config/webui/model-config-store.js) left the server serving a stale bundle version via/ui/asset-bundleuntil restart. The stale version kept splash.html's service-worker registration unchanged, so browsers kept executing pre-patch JS — in our case a preset-save loop that silently dropped a model slot on every save. We hit this on a live deployment with a plugin-patched preset UI.Root cause
The cache hit path never revalidated against the signature. The signature function already existed and already covered all asset roots; the bug was purely that it was not checked on cache hits.
Fix
Recompute the signature on every call (stat-pass over bundle roots, ~300 files, once per page load — negligible); reuse the cached bundle only on signature match; rebuild + re-cache on mismatch. Clients self-heal automatically: new bundle version → splash registers the service worker under the new URL → activate handler purges old caches.
Verification
test_bundle_cache_invalidates_when_plugin_asset_changes(touch plugin asset → nextget_ui_asset_bundlereturns new version + new content)