fix(rum-legacy): reload the verification page by its own url - #38
Merged
Conversation
The page exit check navigated to a literal `index.html`, which only works while the file keeps that name. It does not survive being copied into an offline package and served from another host, where it is usually renamed to avoid colliding with that site's own index: the button then navigates to a url that does not exist. The failure is quiet. Nothing is logged, the page simply stops loading — on the browsers this page exists to test, where there is often no usable devtools to explain it. Reload the url the page was actually opened at instead. Dropping the query rather than appending keeps a second press idempotent, and a directory-style url stays as it is rather than being rewritten to /index.html, which the bundled verification server serves identically.
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.
The
Check page exitbutton navigated to a literalindex.html:That holds only while the file keeps its name. The page is meant to be run inside the environment being verified, so it gets copied out of this repo and served from another host — where it is usually renamed, precisely to avoid colliding with that site's own index. The button then navigates to a url that does not exist.
The failure mode is the bad part: nothing is logged and no error is shown, the page just stops loading. On the browsers this page exists to test, there is frequently no usable devtools to find out why.
The fix
Reload the url the page was actually opened at:
Dropping the query rather than appending keeps a second press idempotent. It also leaves a directory-style url alone instead of rewriting it to
/index.html—verification-server.jsserves/and/index.htmlfrom the same file, so both forms already work, and the shorter one is what a person actually types.Verification
Served the patched file from a plain static server under two url shapes and pressed the button:
/→ navigates to/?after-exit=1,pathnamestays/, page renders and the exit row appears<that name>?after-exit=1and loads, where before the fix it went to a missingindex.htmland the page went blankprettier --checkpasses on the file.