fix(env): a mobile platform hint the UA does not confirm is the Linux lie (#12) - #50
Merged
Merged
Conversation
In a gherkin project the parameters ARE the body's Examples tables: the backend derives the params/examples records from them, and the web app offers no separate parameters UI at all. The editor still showed both — the dedicated table under the read-only description and the editable grid in edit mode — printing the same data twice, and the grid was a second write path into body-owned state (a direct params write on a BDD test answers 400 "Examples already exists"). The language probe added by #35 is now shared through one memoized promise per document and started at boot for test documents too. A gherkin answer skips the view table before its read and disables the grid the way basic mode already does: section hidden, Save writes no params, drafts carry none. Markdown projects are untouched, and a failed probe keeps today's behaviour. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
) A reporter's Ubuntu machine lands in testrun meta as OS "Android": the client-hints platform lies on some desktop Linux builds, and env-info.js takes it at its word. Before touching the detector, this pins down what it answers today. The sample matrix drives the real env-info.js source with recorded hints+UA pairs for every target combination (Windows/macOS/Ubuntu/ChromeOS x Chrome/Edge/Opera, headless, and the lying-mobile negatives) and is deliberately red on the bug cases. The live probe injects the same source into a real branded browser and checks the answer against the actual OS — run by a 3-OS x Chrome/Edge workflow on every push of this branch. A plain page stands in for the panel (Chrome 137+ refuses --load-extension) served as a local secure context, because hints exist only there. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
… lie (#12) Some desktop-Linux Chrome builds answer "Android" in the client-hints platform, and envOs took the hint at its word — a reporter's Ubuntu landed in testrun meta as Android. Extensions run on desktop browsers only, so a mobile hint the UA string does not confirm can never be true: the UA parse wins now, and when it answers nothing the machine is called Linux, after the builds that lie. The sample matrix caught two more detector defects, fixed alongside: the iOS branch of uaOs was unreachable (every iOS UA carries "like Mac OS X" and the Mac check ran first), and the Safari pattern missed mobile Safari, whose UA interleaves Mobile/15E148 between the version and Safari. The matrix is 14/14 with untouched expectations; the env-check workflow is the same picture on real Chrome and Edge across the three desktop OS. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #12.
Testrun meta said
OS: Androidfor a reporter working on Ubuntu.envOs()trustednavigator.userAgentData.platformblindly, and some desktop-Linux Chrome builds lie there and answer "Android". Extensions run on desktop browsers only — a mobile platform answer can never be true for the panel.The fix (
env-info.js): a mobile hint (Android/iOS) that the UA-string parse does not confirm loses to the parse; when the parse answers nothing, the machine is calledLinux(the builds that lie are Linux). Honest hints and desktop answers are untouched.The new sample matrix caught two more detector defects, fixed alongside: the iOS branch of
uaOswas unreachable (every iOS UA carries "like Mac OS X" and the Mac check ran first), and the Safari pattern missed mobile Safari (Mobile/15E148interleaved beforeSafari/).Test infrastructure added (first commit — deliberately red, the documented "before"):
tests/env-info-matrix.mjs— the realenv-info.jssource driven with recorded hints+UA pairs: Windows/macOS/Ubuntu/ChromeOS × Chrome/Edge/Opera, headless (no hints), UA-only fallbacks, and the lying-mobile negatives. 14 cases.tests/env-live-probe.mjs— injects the same source into a real branded browser and checks the answer against the actual OS. A plain locally-served secure page stands in for the panel: Chrome 137+ refuses--load-extension, and client hints exist only in secure contexts — both discovered the hard way..github/workflows/env-check.yml— 3 desktop OS × Chrome/Edge, runs both checks.Verified
Linuxon UbuntuThe stock-Ubuntu green probe confirms the reporter's "Android" comes from a lying build rather than every Linux Chrome — which is exactly why the fix cross-checks instead of special-casing Ubuntu.