Skip to content

[PR] When a blog post filename contains Chinese characters or dots, clicking it lands on the overview page; the detail page i | 博客文章文件名带中文或点号时点开落到总览页,详情页不可达 - #4969

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-27_blog-route-nonascii
Oct 27, 2026

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

(ai: zhipuai-lb/glm-5.3)

Fixes #4957

问题

博客文章的文件名只要含非 ASCII 字符(中文、全角、间隔号)或点号,在面板文章列表里点卡片就会落到总览页(overview),文章详情页永远打不开。

根因

修法(一行)

捕获组放宽为 (.+),与紧邻其上的 sessions 路由(^#/sessions(?:/(.+))?$)对齐。安全性由既有机制兜底:loadBlog 本来就做精确 id 匹配,查不到时渲染带返回链接的 not-found 卡片,不会崩。

测试

tests/web-blog-route.test.ts(沿用 #4587 的真 client vm 沙箱 harness)新增两个用例,双向钉死(#3617 纪律):

  • 正向:slug 含 ·/点号/纯中文的文章,以其列表 href 实际产物(encodeURIComponent 后的 hash)访问 → 博客详情页渲染(post-body),总览页保持隐藏;不落 overview。
  • 负向:不存在的非 ASCII slug → not-found 返回链接卡片、无崩溃、无未处理 rejection;非博客 hash(#/overview、#/logs)路由行为不变(既有用例继续覆盖)。

证据

  • 回归复现:临时还原旧正则,两个新用例均失败(✖ 2);恢复修复后全绿 —— 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:干净通过。
  • 提交:ca90e448(1 commit,fix: 前缀,2 文件 +38/-3,无空白噪音;未动 package.json 版本、kernel/、pi-subagents/、配置面)。

…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.
@ranxianglei ranxianglei changed the title 博客文章文件名带中文或点号时点开落到总览页,详情页不可达 [PR] When a blog post filename contains Chinese characters or dots, clicking it lands on the overview page; the detail page i | 博客文章文件名带中文或点号时点开落到总览页,详情页不可达 Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-27_blog-route-nonascii (ca90e44)

Latest build — install this exact version

npm install -g billion-context@0.0.6480-pr.4969.8a4d7bf

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
ca90e44 billion-context@0.0.6480-pr.4969.8a4d7bf build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr4969.tgz
npm install -g package

Install 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.
@ranxianglei ranxianglei added the duplicate This issue or pull request already exists label Oct 27, 2026
@ranxianglei

Copy link
Copy Markdown
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 src/web/client.ts and tests/web-blog-route.test.ts. Left open for the owner to close — agents don't close PRs.

@ranxianglei
ranxianglei merged commit 7f2e119 into master Oct 27, 2026
82 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.885-master.7f2e119 (rolling master tag).

npm install -g billion-context@0.0.885-master.7f2e119  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

1 participant