fix(rum-legacy): tell the verification page's reader what went wrong - #39
Merged
Merged
Conversation
Two failures on this page do not name their own cause, and both read as a broken SDK to whoever is looking. Opening the page straight from the repository fails the first check with "window.FC_RUM is undefined" and stops. The bundle is not in the verification directory and the repository does not carry it; the page is meant to be served through scripts/verification-server.js, which puts the built file next to it. The message now says that. Serving it over file:// fails the session cookie check, because the browser refuses to write a cookie for that protocol, and leaves the same-origin intake with no origin to answer. The environment table now reports location.protocol, and calls out file: where it appears, so the reason is visible above the failing rows rather than inferred. Both matter most on the browsers this page exists to test, where there is frequently no console to investigate with.
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.
Two ways this page fails do not name their own cause, and both look like a broken SDK to whoever is running it.
Opening it straight from the repository
The first check fails with
window.FC_RUM is undefinedand everything stops. The reason is thatverification/holds onlyindex.html— the built bundle lives inpackages/rum-legacy/bundle/and the repository does not carry it. The page is meant to be reached throughscripts/verification-server.js, which serves the two together.Nothing on the page said so. The message now does:
That also covers a copy served from someone else's host, where the same symptom means the file was not copied next to the page.
Serving it over file://
The session cookie check fails, because browsers refuse to write cookies for that protocol, and the same-origin intake has no origin to answer. Two red rows, no indication that the url was the problem.
The environment table now reports
location.protocol, and spells out the consequence when it isfile:, so the cause sits above the failing rows instead of having to be inferred.Both matter most on the browsers this page exists to test, which frequently have no usable console to investigate with.
Verification
Served the patched page from a directory holding no bundle and pressed Run checks: the new message renders in full, and the environment table's first row reads
location.protocol http:. Thefile:branch is the other arm of that same expression.prettier --checkpasses.