docs(git): 记下 push 走 SSH + 拉对端串口列表要对方批准

两个同范围的坑, 顺手记掉:

1. **push 走 SSH.** 远端 HTTPS 没配 credential helper, 非交互式 push 会卡在
   "could not read Username"。已经把 origin 的 push URL 指到 SSH (fetch 仍走 HTTPS),
   直接 `git push` 就能用; 也记了显式 URL 的退回写法, 以及 fetch 要用 SSH 才能刷新
   `origin/main` (否则 git status 里的"领先 N"是假的)。

2. **拉对端的串口列表需要对方用户批准** (新旧版本都是), 对方没批准就是 15 秒超时 ->
   列表空。这看着像 bug 其实不是, 别去加"自动跳过审批"。
This commit is contained in:
2026-10-21 18:16:47 +08:00
parent 2a641b1eff
commit 82e330c7d0
+16
View File
@@ -161,6 +161,8 @@ UDP discovery on **47800**, chat WS on **47900**, file HTTP on **47901**. All th
(老版本本来就支持 `kind:'serial'`), 只有 USB 字节桥在混版本时用不了 —— 而那功能已下线。
代价: 协议里那个 `'usb'` 帧名和实际内容对不上, 改的时候别手贱"顺手改对" —— 会把
所有还在跑旧版本的对端一起踢下线。
另注: **拉对端的串口列表要对方用户批准** (新旧版本都这样), 对方没点批准就是 15 秒超时 ->
列表空 + 报"超时"。这是审批机制不是 bug, 别去加"自动跳过审批"的逻辑。
11. **未读/角标: 正在看的会话必须立刻清未读, 且不能被 `savedPath` 拦下来.**
踩过的坑: `App.vue` 的 `message:received` 里先判断 `if (!savedPath) return` (等文件落地再算未读),
@@ -178,6 +180,20 @@ UDP discovery on **47800**, chat WS on **47900**, file HTTP on **47901**. All th
- `deviceName`, `downloadDir`, `notifications`, `autoStart` live in `~/AppData/Roaming/local-net-msg/config.json` via `electron-store`. Edit the file directly while dev is stopped.
- `data/app.db` — SQLite DB. DELETE to reset all devices/messages. Auto-migrates on next launch.
## 提交与推送
远端是自建 Gitea (`https://git.xsinfo.vip/xiaoshuai/LocalNetMsg.git`)。**HTTPS 没有配 credential helper**,非交互式 `git push` 会卡在 `could not read Username` 上 —— 所以 push URL 已经指到 SSH:
```
origin https://git.xsinfo.vip/xiaoshuai/LocalNetMsg.git (fetch)
origin git@git.xsinfo.vip:xiaoshuai/LocalNetMsg.git (push)
```
fetch 走 HTTPS、push 走 SSH,直接 `git push` 就能用。SSH key 失效时退回:
`git push git@git.xsinfo.vip:xiaoshuai/LocalNetMsg.git main:main`(显式指定 URL 不改 remote 配置)。
拉远端最新提交用 `git fetch git@git.xsinfo.vip:xiaoshuai/LocalNetMsg.git main:refs/remotes/origin/main` —— 否则 `origin/main` 是陈的,`git status` 里的 "领先 N" 是假的。
## Packaging gotcha
`release/` contains an `app.asar` Windows cannot delete while the previous app instance holds a file handle. Build now writes to `dist-Electron\` to dodge this. If you ever switch back, kill the running app first or you'll get EPERM.