Skip to content

fix: add service-level GitHub route fallbacks - #482

Merged
fkysly merged 3 commits into
dsh-market:mainfrom
Ultroncn:fix/460-github-route-fallback
Sep 3, 2026
Merged

fkysly merged 3 commits into
dsh-market:mainfrom
Ultroncn:fix/460-github-route-fallback

Conversation

@Ultroncn

@Ultroncn Ultroncn commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • give Git refs, raw README content, and avatars independent ordered routes in the China region
  • remember the last validated route per service, fall through transport/timeout/HTTP/payload failures, and reject HTTP 200 HTML proxy error pages
  • add one persistent custom HTTPS acceleration prefix in the settings card, with DSHM_GITHUB_PROXY remaining authoritative
  • keep authenticated Gist traffic direct and leave canonical codeload plus pnpm integrity handling unchanged
  • rebuild the client bundle and document the behavior in both READMEs

Validation

  • npm test — 55 files, 1193 tests passed
  • npm run check — typecheck, server/client build, restart smoke passed
  • npm run test:compat — real pnpm 9/10/11 matrix, 11 tests passed
  • npm pack --dry-run --json — passed, 145 files
  • git diff --check — passed
  • npm run test:web — authenticated capture guard passed, but the local dsh 0.1.1-rc.2 test host invoked pnpm 9 without workspace-root -w; all 29 browser cases skipped during scaffold installation before this bundle was loaded

Closes #460

Ultronen and others added 2 commits September 2, 2026 17:31
Only the generated bundle conflicted; sources merged cleanly. Rebuilt from
the merged sources.

@fkysly fkysly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

收(CI 绿即合,合并冲突我已解——只有产物,源码干净,已用合并后源码重建)。

这个 PR 把 REIN 路线图里那条高优先级(#460)的每个要点都落对了,几处关键判断我逐一核过:

1. 按服务分路由,顺序用了 #460 的实测数据。 raw 走 proxy 优先(大陆对 raw 稳定超时),git/avatar 走直连优先(git 协议和 avatars 实测可用)。这比"一个开关全走代理"准确得多——干扰本来就是分服务的。

2. HTML 错误页判定是双保险。 git 广播要求 # service=git-upload-pack 前导 + 至少一条 ref 形状;README 检 content-type 和 doctype。公共反代最常见的失败形态(200 + 品牌错误页)两条路都接不住假数据。「Validate before remembering the route」这句注释点在要害上——污染路由记忆比单次失败糟得多。

3. 新的 githubProxy 持久化字段完整避开了 #454/#457 的两个坑:hasOwnProperty 区分「显式清除」和「未提及」,refreshMarketState 同步,双向都有测试。上周的教训被完整吸收了。

4. 边界保持正确:自定义前缀强制 https 且禁带凭据;DSHM_GITHUB_PROXY 仍然最高优先;Gist(带认证)不走代理;codeload/pnpm integrity 一概不碰。

5. 设置项是一个逃生舱而不是三个开关,与「下载区域」的原则一致。

1196 passed(合并后)。web-e2e 你本地跳过的原因(rc.2 宿主 + pnpm 9 缺 -w)是环境问题,CI 的真机通道会补上这个验证。

@fkysly
fkysly merged commit ab6dc1a into dsh-market:main Sep 3, 2026
7 checks passed
fkysly added a commit that referenced this pull request Sep 3, 2026
My mistake, twice over. The pipeline I used to roll PRs onto latest main
ran `git merge || true; git add -A; git commit` — which, when #478's
favorites genuinely conflicted with #482's githubProxy state in five files,
committed the unresolved <<<<<<< markers instead of stopping. I then merged
the PR while its branch CI was already red with TS1185 on every job, which
is the exact partial-signal mistake this log has recorded twice before
(#393, #416), this time against a solid red rather than a pending.

Every conflict was additive — favorites and githubProxy both belong in the
state shape, the writer, the refresh sync, the fake, and the client fetch
stub — so the resolution is the union of both sides, plus the client
import list and the pagination-reset dependency array carrying both
features' keys.

56 files, 1229 tests pass with both features live. The bundle is rebuilt
from the resolved sources, which the artifact guard verifies on both
platforms.
@Ultroncn
Ultroncn deleted the fix/460-github-route-fallback branch October 28, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

【建议】china 区域 GitHub 加速单点依赖 gh-proxy.com:建议内置多镜像 fallback + UI 逃生舱

2 participants