fix(jd-publish): 校验失败弹窗跨进页只提示一次——已提示任务代落 localStorage

- 前端只靠内存 Set 去重,重进页面即复位 ⇒ 11-21 已修好的任务 35147 每次打开「商品上架」
  都重弹「本店源商品校验失败:…京麦克隆响应未确认本店源商品身份」,用户误以为新任务又失败
  (今日客户端日志 0 次该商品/该文案;今日上架 02:45 已走「productId=0 放行」新口径成功)
- 已提示过的 taskId:resumeAttempt 落 `jd-publish:validation-notices:<uid>`(封顶 200 条):
  同一任务代跨刷新/重进只提示一次,重试后 attempt+1 仍提示;读失败按「没提示过」、写失败
  「放弃跨页面去重」降级,弹窗本身不受影响
- 判据:mount 用例「同一任务代的校验失败跨重进页面只提示一次,新代仍再提示」(反向验证去掉
  落盘调用即红);catch 静默棘轮 blocks 332→334 记名(两支均非静默)
This commit is contained in:
2026-11-23 16:24:58 +08:00
parent d021bc049a
commit 7e9618e425
3 changed files with 58 additions and 2 deletions
@@ -250,6 +250,22 @@ it('轮询只凭任务头识别失败,历史和重复轮询不重弹,新代
expect(api.alert).toHaveBeenCalledTimes(2)
})
it('同一任务代的校验失败跨重进页面只提示一次,新代仍再提示', async () => {
api.history.mockResolvedValue({ items: [row('FAILED', 3, brandError)] })
const first = await mountPage()
await flushPromises()
expect(api.alert).toHaveBeenCalledTimes(1)
first.unmount()
wrapper = undefined
const second = await mountPage()
await flushPromises()
expect(api.alert).toHaveBeenCalledTimes(1)
api.history.mockResolvedValue({ items: [row('FAILED', 4, brandError)] })
await second.get('.panel-refresh').trigger('click')
await flushPromises()
expect(api.alert).toHaveBeenCalledTimes(2)
})
it('修改品牌走专用原位重试,原样投递新载荷并拒绝旧代进度', async () => {
api.history.mockResolvedValue({ items: [row('FAILED', 3, brandError)] })
api.progress.mockResolvedValue(batch(row('FAILED', 3, brandError)))