fix(utils): strip timestamp query when followed by a hash - #23390
Closed
dfedoryshchev wants to merge 1 commit into
Closed
fix(utils): strip timestamp query when followed by a hash#23390dfedoryshchev wants to merge 1 commit into
dfedoryshchev wants to merge 1 commit into
Conversation
cultosagent
added a commit
to cultosagent/dogma-registry
that referenced
this pull request
Aug 30, 2026
|
Tested this locally across all query and hash permutations ( The lookahead |
Member
|
If this is causing a bug in your app, please open an issue explaining it. What is the usecase for |
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.
removeTimestampQuery()stops stripping the?t=<13-digit>HMR query when the URL also has a hash fragment, so the timestamp leaks into the module graph.utils.ts:341's terminator(?:&|$)accepts&or end-of-string but never#. This is a regression from #23364: the previous/\bt=\d{13}&?\b/matched before a#because of the word boundary.It is the inverse of
injectQuery(), which has a dedicated hash-only branch and emits exactlyfile?t=<ms>#frag, so the round trip no longer round-trips.Against a dev server with
import iconUrl from './icon.svg#shape', the module-graph URL after an asset update is/icon.svg?t=1787868494725#shapeinstead of/icon.svg#shape. A new module-graph node is created on every HMR update of that asset, andtransformRequest.ts:502'simportedMod.url !== moduleUrlcheck never matches. Fragment URLs are a normal shape here - SVG sprites and#iefixfonts - and the playgrounds use them.The fix only changes the terminator;
\d{13}preceded by?or&still defines a timestamp. A differential over old and new across query shapes differs on exactly one class, a 13-digitt=followed by a hash:current-t=,my-t=, 12- and 14-digit values,#t=, duplicate timestamps and?raw&importare all untouched.Worth noting #22343 was closed as expected behaviour for widening
\d{13}to\w+; this does not widen what counts as a timestamp.Test added to the existing
removeTimestampQueryblock. Theutilssuite goes 124 to 125 passing.