Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug]: Sidebar "update everything" never updates CLI/npm servers (npm check blocked by CORS preflight)

已关闭 适合新手
#18,690 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
desktop, frontend

调研方向

阅读 apps/web/src/state/npmRelease.ts,特别是 npmReleasePublishedAtom 请求及其 Effect 管道;将其与提议的 tracer 传播设置进行比较。从 Web 应用或 Electron renderer 检查 npm 版本查询,并确认它无需 CORS 预检即可成功。目标 npm 版本发布后,“update everything”也包含符合条件的 boot-service CLI 服务器,即视为完成。

由索引模型根据 Issue 内容生成。

描述

accepted bug via-triage
What happens

On desktop nightly 0.0.46-nightly.20261012.3021, the sidebar's "update everything" button (#18053) updates desktop-app servers but never includes a CLI server. The connected server is a launcher-managed t3 __service-launcher systemd service on 0.0.46-nightly.20261012.3010, which advertises serverSelfUpdate: "boot-service". That server's row in Settings → Connections still shows its update icon, and updating from there works.

npm already has the target version (nightly dist-tag = 0.0.46-nightly.20261012.3021), and both versions are on the nightly channel, so the server should be included.

Cause

useUpdateEverything keeps non-desktop-managed servers only after npm confirms the target version:

  • apps/web/src/components/sidebar/useUpdateEverything.ts:56-58 filters with useNpmReleasePublished(targetVersion)
  • apps/web/src/state/npmRelease.ts:14 checks with Effect's HttpClient.get + FetchHttpClient.layer

Effect's HttpClient adds traceparent and b3 headers to every request by default (HttpClient.TracerPropagationEnabled defaults to true). Those headers make the browser send a CORS preflight, and registry.npmjs.org answers OPTIONS with 404 and no Access-Control-Allow-Origin. The fetch is blocked, the atom fails, AsyncResult.getOrElse(result, () => false) (npmRelease.ts:40) reports "not published", and every npm/CLI server is dropped from the run. This affects the desktop renderer and app.t3.codes alike. The Connections "Update all" and per-row update don't check npm, which is why they still work.

Repro / evidence

Preflight is rejected:

$ curl -sI -X OPTIONS -H 'Origin: https://app.t3.codes' -H 'Access-Control-Request-Method: GET' \
    https://registry.npmjs.org/t3/0.0.46-nightly.20261012.3021
HTTP/2 404          # no access-control-allow-origin

What the effect 4.0.1 the web app ships sends for HttpClient.get(...) with FetchHttpClient.layer:

{"b3":"d25f…-a0cb…-1","traceparent":"00-d25f…-a0cb…-01"}

The same fetch inside the repo's Electron 44 (Chromium), run from an https:// page:

plain GET:          ok 200
with trace headers: FAILED Failed to fetch
Expected

"Update everything" includes boot-service CLI servers once npm has the target version.

Suggested fix

Turn off trace propagation for this cross-origin request in npmReleasePublishedAtom (apps/web/src/state/npmRelease.ts):

}).pipe(
  Effect.provideService(HttpClient.TracerPropagationEnabled, false),
  Effect.provide(FetchHttpClient.layer),
)

With that change no extra headers are sent and the request stays a simple CORS GET (checked with the same probe). A test on the fetch-failure path would also help: right now a failed check looks the same as "not published", which hid this.

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
6 小时 53 分钟
30 天内合并 PR
222

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。