@mzzsfy/dsh-maintain 0.5.2 → 0.5.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mzzsfy/dsh-maintain",
3
3
  "description": "DSH 自身的版本管理:追踪 npm dist-tag 新版本、一键升级、安全重启",
4
- "version": "0.5.2",
4
+ "version": "0.5.3",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "exports": {
package/src/client.js CHANGED
@@ -550,6 +550,7 @@ function MaintainApp() {
550
550
  now: Date.now(),
551
551
  deadlineAt,
552
552
  prev,
553
+ readyStreak: prev.readyStreak,
553
554
  statusFetch: () => api(STATUS_URL, { signal: probeSignal() }),
554
555
  pageFetch: () => fetch(INDEX_URL, { cache: 'no-store', signal: probeSignal() }),
555
556
  })
@@ -196,3 +196,12 @@ test('apiError: 携带 status 与 payload.error,解析失败回退 HTTP 码', ()
196
196
  assert.equal(withoutBody.status, 500)
197
197
  assert.equal(withoutBody.message, 'HTTP 500')
198
198
  })
199
+
200
+ test('restartTick 调用点实参完整性:轮询 effect 必须传 readyStreak=prev.readyStreak', () => {
201
+ // 回归:f58f47b 给 restartTick 加 readyStreak 参数时调用点漏传,ready=true 分支
202
+ // undefined+1=NaN,NaN>=门槛恒 false,宿主恢复后页面永不自动刷新。
203
+ // 单测显式传参掩盖了该缺陷,此处对拍 effect 内真实调用点的实参表。
204
+ const callSite = clientSource().match(/await restartTick\(\{([\s\S]*?)\}\)/)
205
+ assert.ok(callSite, 'client.js 找不到 effect 内 restartTick 调用点')
206
+ assert.match(callSite[1], /readyStreak:\s*prev\.readyStreak/, 'restartTick 调用点缺少 readyStreak: prev.readyStreak 实参')
207
+ })