dsh-notify-me 1.14.6 → 1.14.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to **dsh-notify-me** are documented here.
4
4
 
5
+ ## [1.14.7] — 2026-10-27
6
+
7
+ ### 修复
8
+
9
+ - **「恢复默认设置」写不进去时也会说了**:`resetConfig()` 以前把 `localStorage.removeItem` 的失败吞掉,设置页照样提示「已恢复默认设置」,刷新之后旧配置又回来。现在它和保存走同一条 `configWriteFailed`,`debug().configStored` 为假、页面上写明「设置没能保存」。
10
+
11
+ ### 文档
12
+
13
+ - README 中英:提醒渠道补上 Linux;外部推送写明关掉转发会取消已排队的重试、服务码非成功值记失败、2xx 但不是该服务的 JSON 记「已送出不可确认」;控制台示例补 `hostEnv` 与 `debug()` 的 `raiseChannel` / `raiseLast` / `configStored`。
14
+ - 致谢新增 unnamed42([#21](https://github.com/chromoany/dsh-notify-me/issues/21) / [#22](https://github.com/chromoany/dsh-notify-me/pull/22):Linux 上 `dsh://open` 抬窗失效的报障与补丁)。11 张贡献者头像统一成同一套 48×48 圆形遮罩,`dunxuan`、`Donald-Yip` 之前分别是方形和自带 alpha。
15
+ - `docs/listing.md` 版本口径同步到 1.14.7。
16
+
17
+ ### 测试
18
+
19
+ - `storageFailureFeedback()` 现在也覆盖写失败后的 `resetConfig()`:`configStored` 仍为假,提示行还在。
20
+
5
21
  ## [1.14.6] — 2026-10-27
6
22
 
7
23
  ### 修复
package/README.en.md CHANGED
@@ -80,7 +80,7 @@ Web users can also test the approval buttons, which then appear on the notificat
80
80
  window.__dshNotifyMe.test("done") // "reply finished" sample
81
81
  window.__dshNotifyMe.test("attention") // "needs you" sample
82
82
  window.__dshNotifyMe.test("approval") // Approve / Reject when the bridge is available; a plain notification otherwise (which is what Desktop gets)
83
- window.__dshNotifyMe.debug() // the bridge field reports the state ("active" = buttons work); a refused toast leaves its platform message in lastToastReject
83
+ window.__dshNotifyMe.debug() // bridge ("active" = buttons work), raiseChannel, the last raise attempt in raiseLast, a refused toast's platform message in lastToastReject, and configStored for whether the settings really persisted
84
84
  ```
85
85
 
86
86
  If no test notification appears, check in this order: whether the notification permission was declined (click once on the page and choose **Allow**; or address-bar lock → Site settings → Notifications → Allow → reload), whether DSH was restarted after installing, and whether the browser's notifications are switched off in the OS settings.
@@ -160,7 +160,8 @@ Off by default. Supports Discord Webhook / Bark / Gotify / Feishu group bots / S
160
160
 
161
161
  - **External notifications** (default off): forward each alert to your own push endpoints as well, so it reaches you away from the machine; any number of targets, each of which can be enabled or disabled on its own. "Forward 'needs you'" and "Forward 'reply finished'" switch independently; **Send test notification** sends one test message to every target (not limited by those two switches, and never pretending to be a real alert). Forwarding follows exactly the same trigger rules as local alerts ("stay quiet for the conversation on screen" and friends apply to it too); the alert text is sent as-is to the addresses you fill in, so **only use endpoints you trust**;
162
162
  - **What each target takes**: Discord — the webhook URL; Bark — `https://api.day.app/<device key>`; Gotify — `https://<server>/message?token=<app token>`; Feishu — the group-bot webhook plus an optional verification secret; ServerChan — the full `…/send/<SendKey>.send` URL; WxPusher — the appToken and the receiver UID; a custom endpoint receives one POST of JSON: `{source, event, title, body, text, sessionId, time}`;
163
- - **Reliable delivery**: failures that look transient (network error, 5xx, 429) are retried after 2 s and 6 s; anything else stops at once. A delivery that still fails is recorded in the failure log (10 entries at most — title and body snippet plus host only, never the full endpoint), which the settings page shows and can clear;
163
+ - **Reliable delivery**: failures that look transient (network error, 5xx, 429) are retried after 2 s and 6 s; anything else stops at once. Switching forwarding off or deleting a target cancels a retry that is already on a timer — it is not counted as a failure and never reaches the failure log. A delivery that still fails is recorded in the failure log (10 entries at most — title and body snippet plus host only, never the full endpoint), which the settings page shows and can clear;
164
+ - **Service codes and "unverified"**: a 2xx from Feishu / ServerChan / WxPusher also carries a service code (`0` for Feishu and ServerChan, `1000` for WxPusher); a wrong code is recorded as a failure with the service's own message, and a 2xx whose body is not that service's JSON (empty, or a proxy/WAF HTML page) is "sent but unverified" rather than a success;
164
165
  - **Per-target state**: the right end of each target row shows how its last delivery went (last delivery ok / sent-unverified / failed with the reason) next to a switch of its own, so an endpoint that is temporarily down can be turned off alone instead of muting a whole alert kind;
165
166
  - **Signing**: a custom target with a secret sends `X-DSH-Notify-Signature` (HMAC-SHA256 over the body, `sha256=<hex>`); a Feishu target with a secret carries `timestamp` / `sign` in the body per Feishu's own algorithm;
166
167
  - **Message template** (optional): Feishu / ServerChan / WxPusher / custom targets accept a template with `{{title}}` `{{body}}` `{{event}}` `{{time}}` `{{session}}`; empty means "title, newline, body";
@@ -185,7 +186,7 @@ The last block inside Advanced. The page protocol is detected automatically to t
185
186
 
186
187
  | Channel | What it does |
187
188
  | --- | --- |
188
- | System notification | Through the browser into the Windows action center / macOS Notification Center; clicking it returns to the conversation it came from. Web can carry Approve / Reject |
189
+ | System notification | Through the browser into the Windows / macOS / Linux notification centre; clicking it returns to the conversation it came from. Web can carry Approve / Reject |
189
190
  | Sound | WebAudio cue by default, with different patterns for "needs you" and "done"; swap in a custom audio file, or hand the sound over to the system notification sound |
190
191
  | Tab title | `🔔 Action needed · …` / `✅ Reply finished · …`, following the alert language; gone once you open that session, and both markers can be up at the same time |
191
192
  | External push (optional, default off) | Forwards the same alert to Discord / Bark / Gotify / Feishu / ServerChan / WxPusher / a custom webhook |
@@ -241,6 +242,7 @@ window.__dshNotifyMe.setConfig({
241
242
  volume: 0.5, // volume 0..1
242
243
  autoFocus: true, // a toast click returns to the conversation that raised it
243
244
  quickActions: true, // Approve / Reject buttons on approval toasts
245
+ hostEnv: "auto", // runtime: 'auto' detect | 'desktop' force the app | 'web' force the browser
244
246
  externalEnabled: false, // external forwarding master switch (default off: no endpoint, nothing is sent)
245
247
  externalAttention: true, // forward "needs you" (exactly the same trigger rules as local alerts)
246
248
  externalDone: true, // forward "reply finished"
@@ -381,6 +383,7 @@ powershell -NoProfile -File lib/focus-window.ps1 -ProcessId 0 # the last line
381
383
  | <a href="https://github.com/shrekcg"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/shrekcg.png" width="40" height="40" alt="@shrekcg"></a> | [#16](https://github.com/chromoany/dsh-notify-me/pull/16): away detection (`idleMinutes`), reply-done routing (`donePolicy`), auto-dismiss (`autoDismiss`) |
382
384
  | <a href="https://github.com/Donald-Yip"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/Donald-Yip.png" width="40" height="40" alt="@Donald-Yip"></a> | [#18](https://github.com/chromoany/dsh-notify-me/issues/18): the report that a Windows notification tag over the 64-character cap made the platform silently reject the approval test toast |
383
385
  | <a href="https://github.com/dunxuan"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/dunxuan.png" width="40" height="40" alt="@dunxuan"></a> | [#20](https://github.com/chromoany/dsh-notify-me/issues/20): the report that alerts for the open session showed a placeholder instead of the session title |
386
+ | <a href="https://github.com/unnamed42"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/unnamed42.png" width="40" height="40" alt="@unnamed42"></a> | [#21](https://github.com/chromoany/dsh-notify-me/issues/21) / [#22](https://github.com/chromoany/dsh-notify-me/pull/22): the Linux `dsh://open` raise-path report and patch, which brought the deep link back on macOS / Linux in 1.14.4 |
384
387
 
385
388
  Attribution policy: external PRs are landed as maintainer commits — the original commit is not reused and no Co-authored-by trailer is added, so GitHub's contributors graph lists the maintainer only and contributors are credited above.
386
389
 
package/README.md CHANGED
@@ -80,7 +80,7 @@ Web 用户可再测审批按钮,通知上会带「同意 / 拒绝」。桌面
80
80
  window.__dshNotifyMe.test("done") // 「完成」示例
81
81
  window.__dshNotifyMe.test("attention") // 「需要你」示例
82
82
  window.__dshNotifyMe.test("approval") // 桥可用时带「同意 / 拒绝」按钮;否则只发普通通知(桌面端即如此)
83
- window.__dshNotifyMe.debug() // 桥接状态看 bridge 字段(active = 按钮可用);最近一次被平台拒发的原因在 lastToastReject
83
+ window.__dshNotifyMe.debug() // 桥接看 bridge(active = 按钮可用)、抬窗通道 raiseChannel、最近一次尝试 raiseLast、平台拒发原文 lastToastReject、设置是否真存下来 configStored
84
84
  ```
85
85
 
86
86
  没有测试通知时,先检查:通知权限是否被拒绝(在页面上点一下 → 选「允许」;或地址栏锁 → 站点设置 → 通知 → 允许 → 刷新)、装完没重启 DSH、系统设置里浏览器通知被关。
@@ -160,7 +160,8 @@ dsh-notify-me 把「监督」和「守在屏幕前」解耦:只在真的出现
160
160
 
161
161
  - **外部通知**(默认关):把提醒同时转发到你自己的推送端点,人不在电脑前也能收到;可加多个目标,每个目标可单独启停。「转发「需要你」」「转发「回复完成」」各自独立开关;**发送测试通知**往所有目标发一条测试消息(不受这两类开关限制,也不会冒充真提醒)。转发跟本地提醒走同一套触发规则(「当前对话不弹通知」等开关同样管它);提醒正文会原样发往你填的地址,**只填你自己信任的端点**;
162
162
  - **各目标的填法**:Discord 填 Webhook 地址;Bark 填 `https://api.day.app/<设备密钥>`;Gotify 填 `https://<服务器>/message?token=<应用令牌>`;飞书填群机器人 Webhook,可选填签名校验密钥;Server酱 填 `…/send/<SendKey>.send` 完整地址;WxPusher 填 appToken 与接收者 UID;自定义端点收一条 POST JSON:`{source, event, title, body, text, sessionId, time}`;
163
- - **可靠投递**:明显是临时故障的失败(网络中断、5xx、429)按 2 秒 / 6 秒自动重试两次,其它错误立即停;重试仍失败会把这一条记进「失败记录」(最多 10 条,只留标题与正文摘要和主机名,不留完整端点),设置页能一眼看到并清空;
163
+ - **可靠投递**:明显是临时故障的失败(网络中断、5xx、429)按 2 秒 / 6 秒自动重试两次,其它错误立即停;关掉「外部通知」总开关或删掉某个目标后,已经排在定时器上的重试立刻作废,既不算失败也不进失败记录;重试仍失败会把这一条记进「失败记录」(最多 10 条,只留标题与正文摘要和主机名,不留完整端点),设置页能一眼看到并清空;
164
+ - **服务码与「不可确认」**:飞书 / Server酱 / WxPusher 的 2xx 还会读返回体里的服务码(飞书与 Server酱是 `0`,WxPusher 是 `1000`),码不对按失败记并带服务端文案;2xx 但正文不是该服务的 JSON(空白、代理或 WAF 的网页)记「已送出不可确认」,不冒充成功;
164
165
  - **每个目标的状态**:目标行右侧显示它最近一次投递的结果(上次成功 / 上次已送出但不可确认 / 上次失败 + 原因),并各自带一个启停开关——某个端点临时不可用就单独关掉它,不用关掉整类事件;
165
166
  - **签名**:自定义目标填了签名密钥时,请求带 `X-DSH-Notify-Signature`(对请求体做 HMAC-SHA256,`sha256=<hex>`);飞书填了签名密钥时按官方算法在请求体里带 `timestamp` / `sign`;
166
167
  - **消息模板**(可选):飞书 / Server酱 / WxPusher / 自定义目标可填模板,占位符 `{{title}}` `{{body}}` `{{event}}` `{{time}}` `{{session}}`,留空默认是「标题 + 换行 + 正文」;
@@ -185,7 +186,7 @@ dsh-notify-me 把「监督」和「守在屏幕前」解耦:只在真的出现
185
186
 
186
187
  | 渠道 | 表现 |
187
188
  | --- | --- |
188
- | 系统通知 | 经浏览器进 Windows 通知中心 / macOS 通知中心,点击回到对应对话;Web 端可带「同意 / 拒绝」 |
189
+ | 系统通知 | 经浏览器进 Windows / macOS / Linux 的系统通知中心,点击回到对应对话;Web 端可带「同意 / 拒绝」 |
189
190
  | 提示音 | 默认 WebAudio 合成音,「需要你」与「完成」音型不同;可换自定义音频,或交给系统通知音 |
190
191
  | 标签页标题 | `🔔 需要你 · …` / `✅ 回复完成 · …`(随通知语言切换),打开对应会话即消失;两种标记可同时出现 |
191
192
  | 外部推送(可选,默认关) | 把同一条提醒转发到 Discord / Bark / Gotify / 飞书 / Server酱 / WxPusher / 自定义 Webhook |
@@ -241,6 +242,7 @@ window.__dshNotifyMe.setConfig({
241
242
  volume: 0.5, // 音量 0~1
242
243
  autoFocus: true, // 点通知回到提醒所属的对话
243
244
  quickActions: true, // 审批通知上的「同意 / 拒绝」按钮
245
+ hostEnv: "auto", // 运行环境:'auto' 自动识别 | 'desktop' 强制桌面端 | 'web' 强制 Web
244
246
  externalEnabled: false, // 外部通知转发主开关(默认关:不填端点就什么都不发)
245
247
  externalAttention: true, // 转发「需要你」(触发规则跟本地提醒完全一致)
246
248
  externalDone: true, // 转发「回复完成」
@@ -380,6 +382,7 @@ powershell -NoProfile -File lib/focus-window.ps1 -ProcessId 0 # 末行应是 F
380
382
  | <a href="https://github.com/shrekcg"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/shrekcg.png" width="40" height="40" alt="@shrekcg"></a> | [#16](https://github.com/chromoany/dsh-notify-me/pull/16):离开判定 `idleMinutes`、「回复完成」判定 `donePolicy`、自动消失 `autoDismiss` |
381
383
  | <a href="https://github.com/Donald-Yip"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/Donald-Yip.png" width="40" height="40" alt="@Donald-Yip"></a> | [#18](https://github.com/chromoany/dsh-notify-me/issues/18):Windows 通知 tag 超过 64 字符上限、审批测试通知被平台静默拒收的报告 |
382
384
  | <a href="https://github.com/dunxuan"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/dunxuan.png" width="40" height="40" alt="@dunxuan"></a> | [#20](https://github.com/chromoany/dsh-notify-me/issues/20):当前会话的通知正文用占位符、未取会话标题的报告 |
385
+ | <a href="https://github.com/unnamed42"><img src="https://raw.githubusercontent.com/chromoany/dsh-notify-me/main/docs/contributors/unnamed42.png" width="40" height="40" alt="@unnamed42"></a> | [#21](https://github.com/chromoany/dsh-notify-me/issues/21) / [#22](https://github.com/chromoany/dsh-notify-me/pull/22):Linux 上 `dsh://open` 抬窗失效的报障与补丁,1.14.4 起 macOS / Linux 恢复深链抬窗 |
383
386
 
384
387
  署名口径:本仓库收编外部 PR 时以维护者提交落地——不沿用原 commit、不挂 Co-authored-by,GitHub 的 contributors 图只显示维护者,贡献者以上面的致谢署名。
385
388
 
package/lib/client.js CHANGED
@@ -2423,7 +2423,7 @@
2423
2423
  });
2424
2424
  } catch (e) {}
2425
2425
  // keep in sync with package.json "version" on every release
2426
- api.version = "1.14.6";
2426
+ api.version = "1.14.7";
2427
2427
  api.setConfig = function (patch) { return setConfigLocal(patch); };
2428
2428
  api.resetConfig = function () {
2429
2429
  try {
@@ -2438,7 +2438,12 @@
2438
2438
  localStorage.removeItem(LS_EXTERNAL_DEAD);
2439
2439
  localStorage.removeItem(LS_EXTERNAL_HEALTH);
2440
2440
  externalHealth = {};
2441
- } catch (e) {}
2441
+ configWriteFailed = false;
2442
+ } catch (e) {
2443
+ // Same silent failure as a refused save: the reset only lives in
2444
+ // memory and the next reload brings the old profile back.
2445
+ configWriteFailed = true;
2446
+ }
2442
2447
  config = readConfig();
2443
2448
  return config;
2444
2449
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-notify-me",
3
- "version": "1.14.6",
3
+ "version": "1.14.7",
4
4
  "description": "离开 DSH 页面也能收到提醒:需要你操作 / 后台回复完成时发系统通知、标题标记与提示音,支持审批快捷裁决与外部推送,Web 版与桌面版均可用。",
5
5
  "license": "MIT",
6
6
  "type": "module",