Repository navigation
Conversation
CodFrm
force-pushed
the
fix/1793-settings-update-url
branch
from
October 20, 2026 04:01
9b56b77 to
64179d6
Compare
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.
Checklist / 检查清单
背景
#1793 反馈导入备份 / WebDAV 恢复后更新链接从
xxx.user.js变成xxx.meta.js。排查后根因不在导入:导入与网页安装产出的数据一致(downloadUrl=xxx.user.js、checkUpdateUrl=xxx.meta.js),问题出在新 UI 编辑器「设置」页的「更新 URL」输入框。checkUpdateUrl ?? downloadUrl,因此回显meta.js;旧 UI(v1.4.0ScriptSetting)回显的是downloadUrl,这是 ♻️ 新 UI 重写:shadcn/ui + Tailwind v4 + React 19 全面重构表现层 #1514 重写时引入的回归。setCheckUpdateUrl,SW 端会把它同时写入downloadUrl与checkUpdateUrl,下载地址由此被改写为meta.js;之后的备份 / 同步会把坏值带走。影响范围是所有「从 URL 安装且未同时声明
@updateURL+@downloadURL」的脚本,不限于导入。本次改动
downloadUrl。script.meta.js改为script.user.js:该字段会被写成下载地址,原占位符引导用户填入 meta.js,属同一缺陷。a.meta.js(固化了错误行为),改为a.user.js;新增「未修改直接失焦」「切换检查更新开关」两条回归用例,断言提交的是下载地址。已知限制
meta.js的脚本不做数据修复(维护者决定),需用户手动改回。setCheckUpdateUrl仍把同一地址写入两个字段,保存过一次后检查更新改为拉取完整user.js,功能正常,仅流量略多。关联
close #1793
验证
base
58309d5e/ head64179d61,git diff --name-only仅含SettingsPane.tsx与SettingsPane.test.tsx。a.meta.js);修复后pnpm vitest run src/pages/options/routes/ScriptEditor/tabs/SettingsPane.test.tsx→ 37 passed。prettier --check、eslint(两个改动文件)、pnpm run typecheck通过。ScriptEditor目录整体运行时index.test.tsx/ResourcePreviewDialog.test.tsx有间歇失败:在未改动的 main 上同样复现(同两文件 3 次运行中 1 次 2 failed),index.test.tsx整体 mock 掉了SettingsPane,与本改动无关,未在此 PR 处理。