Skip to content

移除 ServerChan 与 PushPlus 两个渠道 - #131

Merged
todosdev[bot] merged 2 commits into
mainfrom
tds/conv-01a1586c-b8ce-705d-84a5-41c2680a30fe
Oct 20, 2026
Merged

todosdev[bot] merged 2 commits into
mainfrom
tds/conv-01a1586c-b8ce-705d-84a5-41c2680a30fe

Conversation

@todosdev

@todosdev todosdev Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 下线 ServerChan 与 PushPlus 两个渠道(10 → 8),删除发送实现、注册、白名单、前端入口与文案。
  • 新增一次性清理迁移:从所有用户的 notification_configs.enabled_channels 中剔除这两个 ID,避免摘掉 sender 后每次推送都写 "Unknown channel" 失败记录。
  • 数据库两列不 DROP(存量库留作休眠列);items.channels、notification_history、me.ts 脱敏名单按规格保持不动。

Changes

worker

  • 删除 services/notify/serverchan.ts、services/notify/pushplus.ts,并从 notify/index.ts 的 CHANNEL_SENDERS 摘除注册。
  • types.ts:VALID_CHANNELS 与 NotificationConfig 移除两个渠道;routes/me.ts、routes/items.ts 按白名单迭代,无需改动。
  • lib/setup.ts 的 runMigrations():新增逐行清理迁移(坏 JSON 行跳过、仅在有变化时 UPDATE、天然幂等),只改 enabled_channels,不动 updated_at。
  • db/schema.sql 与 getSchema() 同步删两列(仅影响全新安装);db/queries/notifications.ts 的 upsert 列名单删两项。

web

  • lib/channels.ts、pages/channels/ChannelPage.tsx 删除两个渠道定义(渠道页与 item 选择器均只剩 8 个)。
  • locales/zh.json、en.json 删除 channels.serverchan/pushplus 及已无引用的 sendKey/topic/channelName;通用 token 保留。

docs / tests

  • CLAUDE.md、README.md、README.en.md 更新为 8 个渠道。
  • worker/test/migrations.test.ts 保留老库 fixture 的两列,新增清理迁移、幂等、坏行容错(坏行之后的 u4 仍被清理)、迁移后发送无 Unknown channel、全新安装无两列等用例。

Testing

  • pnpm typecheck、pnpm build、pnpm test(33 项)全绿;biome lint / biome format 通过(仅剩两处与本次无关的既有告警)。
  • 反向验证:临时移除逐行 try/catch 后,清理迁移用例如预期失败(u4 未被处理),恢复后全绿。
  • 全仓 grep serverchan|pushplus 仅命中迁移代码与测试 fixture/用例。
  • 上线注意:合并后部署由 main 上的 CI 成功后自动触发;部署完成后必须立即在管理后台「数据库维护 → 检查并升级数据库」或调用 POST /api/admin/setup 执行迁移,否则残留 ID 会继续产生失败记录、渠道开关表现为“点了没反应”。真实渠道冒烟(Telegram、企业微信)需部署后由管理员用真实凭据完成。

@todosdev
todosdev Bot merged commit 45609cb into main Oct 20, 2026
1 check passed
@mapxn
mapxn deleted the tds/conv-01a1586c-b8ce-705d-84a5-41c2680a30fe branch November 8, 2026 11:29
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.

0 participants