Skip to content

fix: 支持 Server酱3 AppKey 通知发送 - #18

Open
zzo01 wants to merge 2 commits into
3899:mainfrom
zzo01:agent/serverchan3-appkey
Open

fix: 支持 Server酱3 AppKey 通知发送#18
zzo01 wants to merge 2 commits into
3899:mainfrom
zzo01:agent/serverchan3-appkey

Conversation

@zzo01

@zzo01 zzo01 commented Aug 2, 2026

Copy link
Copy Markdown

变更内容

  • Server酱³ 拼接发送 URL 时保留 AppKey 中的连字符
  • 修复 AppKey 被编码为 %2D 后返回 10003 sendkey not found 的问题
  • 将前端输入框标签调整为 SendKey / AppKey
  • 保持原有 send_key 配置字段不变,兼容已有配置

问题原因

Server酱³ 的 AppKey 格式类似:

sctp<uid>ta-xxxxxx

其中包含连字符 -
SimAdmin 原来使用 NON_ALPHANUMERIC 对整个 Key 进行 URL 路径编码。该编码规则会把所有非字母数字字符编码,因此 AppKey 中的 - 会被转换为 %2D

验证

  • Server酱³ 相关后端测试通过
  • 前端 ESLint、TypeScript 类型检查和生产构建通过
  • 未执行真实通知发送或设备部署

Copilot AI review requested due to automatic review settings August 2, 2026 11:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Server酱³ (ServerChan3) notification URL construction by ensuring AppKey/SendKey hyphens (-) are preserved in the URL path segment, preventing 10003 sendkey not found errors caused by over-encoding. It also updates the frontend label to clarify the expected input without breaking existing send_key configuration compatibility.

Changes:

  • Preserve - when building the Server酱³ send URL (avoid %2D in AppKey).
  • Update Server酱³ frontend field label to SendKey / AppKey.
  • Adjust backend unit test expectation for the updated URL output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
frontend/src/pages/notifications/NotificationChannelsTab.tsx Updates Server酱³ input label to clarify SendKey/AppKey usage.
backend/src/notification.rs Fixes Server酱³ URL path encoding to keep hyphens and updates related test expectation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 2413 to 2416
"https://{}.push.ft07.com/send/{}.send",
uid,
encode_path_segment(send_key)
encode_path_segment(send_key).replace("%2D", "-")
))
Comment on lines 3744 to 3748
};
assert_eq!(
serverchan3_url(&manual_uid).unwrap(),
"https://user-1.push.ft07.com/send/manual%2Dsecret.send"
"https://user-1.push.ft07.com/send/manual-secret.send"
);
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.

2 participants