Conversation
detect_ui_lang() (src/ui/http_server.c) picked the UI language with strstr(accept_language, "zh"), so any Chinese tag anywhere in the header served the Chinese UI regardless of position or q-value. A bilingual header whose top preference is English (e.g. en-US;q=0.9,zh;q=0.5) still got Chinese. Per RFC 9110 12.5.4, parse each tag's q-value (default 1.0), treat q=0 as explicitly unacceptable (12.5.1), and return the highest-ranked tag whose base language is zh or en, keeping the first occurrence on a tie. This mirrors the UI bundle's own JT() fallback parser, quoted in the issue, which already implements this correctly as a client-side fallback. Fixes DeusData#1829 Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you for contributing the Accept-Language quality-value handling and HTTP-server tests. This is queued as a UI behavior fix. We need more time to review the parsing and fallback cases before giving a decision. The review queue is currently full, so detailed feedback may take a little time. We are working through it carefully and appreciate the work you have put into supporting the project. Thank you for your patience. |
|
The macOS test-tsan failure is a pre-existing flake in daemon_runtime, unrelated to this diff (which only touches http_server.c); the sibling ubuntu-arm TSAN leg is green. Anything else you'd want changed here? |
|
Thank you for the quality-value implementation and for asking about next steps. Current |
|
You were right, and I want to confirm it rather than leave you waiting on an unexplained red. Your 2026-09-14 diagnosis — that the macOS The signature is now recorded on our side so the next person who hits it does not have to re-derive it: I am also not treating a green rerun as the end of it. A required check that passes on retry is a lottery, not a fixed test, so that flake is logged as a defect of ours to attribute properly — production race versus test-side timing — rather than something to shrug at. That work is on us, not on you, and it will not block this PR. Separately, the review note left on 2026-09-19 about |
|
Appreciate you tracking down the tsan flake signature so nobody has to re-derive it. On detect_ui_lang: this PR's diff already replaces the substring check with the RFC 9110 q-value ranking (12.5.1, q=0 excluded, ties broken deterministically), covered by the two new httpd tests. Nothing else queued on that path, the substring check only survives on main until this merges. |
|
@AmirF194 — you are right: your diff already replaces the substring scan, and my 19 September note read as if it did not. That was my misreading, not an open item on your side. Thank you for answering it patiently. I am nevertheless going to close this, and you deserve the real reason rather than a vague one: we are relaunching the UI soon, and this change would be redundant the moment that lands. The current graph UI and the server code that serves it — What I want you to know about the work itself:
You have several other PRs in this queue that are not on a disappearing surface — #2089, #2181, #2170 and #2085 among them — and those are being reviewed and landed on their merits. #2089 is next on my list tonight. Thank you for the steady stream of careful, well-tested fixes; it is noticed. |
What does this PR do?
detect_ui_lang()(src/ui/http_server.c) picks the/api/ui-configlanguage withstrstr(accept_language, "zh"), so any Chinese tag anywhere in the header serves the Chinese UI, regardless of position or q-value. A bilingual browser list whose top preference is English (en-US;q=0.9,zh;q=0.5) still gets Chinese.Per RFC 9110 12.5.4, the fix parses each tag's q-value (default 1.0), treats
q=0as explicitly unacceptable (12.5.1), and returns the highest-ranked tag whose base language iszhoren, keeping the first occurrence on a tie. This mirrors the UI bundle's ownJT()fallback parser (quoted in the issue), which already does this correctly as a client-side fallback when the endpoint is unreachable.Checklist
git commit -s)scripts/test.sh --suites httpd)Verification
"lang":"en"and get"lang":"zh"on plainmain; both pass on this branch. Ran both ways in a cleanubuntu:24.04container. Fullhttpdsuite: 66 passed, 1 skipped (pre-existing, Windows-only) on both sides.detect_ui_langhas a single call site (handle_ui_config); no other reader needed updating.cppcheckandclang-format --dry-runon the two changed files: same output before and after this change, so nothing new here.Fixes #1829