Repository navigation
fix: docs visitors retain outdated diagrams after updates - #296
Merged
Merged
Conversation
Content-address the immutable Pele bundle and share its name between the generated shell, asset writer, and smoke check. Keep the installed dependency unchanged. Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
roboclaw-bot
marked this pull request as ready for review
November 1, 2026 02:53
| function resetMermaidBlock(block,source){block.dataset.mermaidReady="";block.classList.remove("is-rendered","is-error");block.innerHTML="<pre><code>"+escapeHtml(source)+"</code></pre>"} | ||
| async function renderMermaidSvg(source,renderId){ | ||
| const pele=await (mermaidReady??=import(withBase("/assets/pele-1.6.0.js"))); | ||
| const pele=await (mermaidReady??=import(withBase(${JSON.stringify("/assets/" + peleAssetName)}))); |
Contributor
Author
There was a problem hiding this comment.
Reviewed on exact head 85d7661: this is a false positive, not an untrusted-code construction path. pele-runtime.mjs derives the interpolated filename solely as pele- + SHA-256 bytes encoded with digest("hex").slice(0, 12) + .js; package/source text never enters the JavaScript string. site-js.mjs then JSON-encodes the fixed /assets/ prefix and that digest-only filename. Independently checked the producer output against ^pele-[0-9a-f]{12}\.js$ and the real generated import: /assets/pele-bb01f8b243c8.js. There is no attacker-controlled delimiter or executable source to sanitize here. No suppression or security-setting change is needed.
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.
What Problem This Solves
Fixes returning docs visitors continuing to run Pele 1.6 after the installed renderer was updated to 1.10, because both builds reused a one-year immutable asset URL.
User Impact
Returning visitors receive the renderer shipped with the current docs build. No dependency, cache-policy, security-setting, or content changes.
Why This Change Was Made
Give the compiler bundle a content-hashed name, owned by one build-time module and consumed by asset writing, browser import, and smoke validation. This follows the existing Glimm/web-vitals pattern and removes the stale fixed filename and silent missing-package copy path. The small production addition is required to share that identity; browser regressions independently protect legacy-cache avoidance in Chromium and WebKit.
Evidence
/__elementsreceived HTTP 400 from the secret-egress proxy. Separate WebKit production-page and focused browser proof passed; no safeguard was bypassed.Inspected before/after
Returning visitor with cached 1.6 runtime → current installed 1.10 runtime. No dependency upgrade.
Mobile before:

Mobile after:

Desktop before:

Desktop after:

Credit
Requested by @vincentkoc; Vincent Koc is credited in the commit.
Work sessions