Repository navigation
[PR] When a blog post filename contains Chinese characters or dots, clicking it lands on the overview page; the detail page i | 博客文章文件名带中文或点号时点开落到总览页,详情页不可达 - #4969
Merged
Conversation
…view (#4957) The #/blog/<slug> route regex only admitted [A-Za-z0-9_-], but slugs keep whatever the filename carried after the date prefix (CJK, dots, spaces) and the list href is percent-encoded (%XX), so clicking any such article fell through to the overview page. Relax the capture to (.+), mirroring the sessions route above; loadBlog already does exact id matching with a not-found back-link card.
Contributor
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6480-pr.4969.8a4d7bfThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4969.tgz
npm install -g packageInstall instructions are refreshed on each push. |
ranxianglei
pushed a commit
that referenced
this pull request
Oct 27, 2026
Parallel PR #4969 (same one-line fix, opened later) pinned two extra shapes this suite did not: a dot + middot + CJK mixed id, and the not-found degradation for an unknown ENCODED non-ASCII id. Absorb both so the surviving PR carries the union of coverage; #4969 is marked duplicate of this branch's PR.
Owner
Author
|
(ai: vllm-qwen/qwen3.8-27b) duplicate of #4961 — same symptom, same mechanism, same one-line fix.
Merging both would conflict on the same lines of |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.885-master.7f2e119 # this exact build
npm install -g billion-context@master # always the newest merged build
|
ranxianglei
pushed a commit
that referenced
this pull request
Oct 27, 2026
Follow-up merge after master advanced past c499b14 mid-resolution (#4969/#4970/#4972/#4971 blog+billing, #4544 event-loop-yield, #4678 mysql-v8-dedup, #4782 dsh-goal-subfork). Conflicts: - src/server/prepare-responses.ts: import hunk unioned again - kept this branch's fold-reconcile import line (superset of master's: adds noteBiliToolSurface/outboundBiliSurface); master's yieldToEventLoop lines from #4528 landed in all four prepare files untouched. - tests/golden/storage-render/{anthropic,chat,google,responses}.json: regenerated from the merged tree via scripts/update-storage-render-goldens.ts; output byte-identical to the previous round's regeneration (master's new commits did not change these golden conversations' outbound wire or persisted state) and differing from master only by this branch's image-rescale armed-state latch digests. Verification: no conflict markers remain; targeted suites green (golden-storage-render + fold-reconcile + issue3400-image-rescale = 109/109); typecheck clean. Full-suite verdict deferred to CI on the pushed head.
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.
(ai: zhipuai-lb/glm-5.3)
Fixes #4957
问题
博客文章的文件名只要含非 ASCII 字符(中文、全角、间隔号)或点号,在面板文章列表里点卡片就会落到总览页(overview),文章详情页永远打不开。
根因
src/web/client.ts的路由正则^#/blog/([A-Za-z0-9_-]+)$只放行 ASCII 字母数字加_-。src/web/blogfeed.ts只剥YYYY-MM-DD_),中文、.、空格全保留;列表行的 href 又是encodeURIComponent(id),编码产物含%—— 两类 id 都必不匹配正则,route()落回name = "overview"。修法(一行)
捕获组放宽为
(.+),与紧邻其上的 sessions 路由(^#/sessions(?:/(.+))?$)对齐。安全性由既有机制兜底:loadBlog本来就做精确 id 匹配,查不到时渲染带返回链接的 not-found 卡片,不会崩。测试
tests/web-blog-route.test.ts(沿用 #4587 的真 client vm 沙箱 harness)新增两个用例,双向钉死(#3617 纪律):·/点号/纯中文的文章,以其列表 href 实际产物(encodeURIComponent后的 hash)访问 → 博客详情页渲染(post-body),总览页保持隐藏;不落 overview。#/overview、#/logs)路由行为不变(既有用例继续覆盖)。证据
node --import tsx --test tests/web-blog-route.test.ts:6 pass / 0 fail。tests/web-blogfeed.test.ts tests/web-blog-refresh.test.ts tests/web-routing.test.ts tests/web-i18n.test.ts:43 pass / 0 fail。npm run typecheck:干净通过。fix:前缀,2 文件 +38/-3,无空白噪音;未动 package.json 版本、kernel/、pi-subagents/、配置面)。