From 67ce443915dca1651eb3602d3ac6cc9a2f2f1426 Mon Sep 17 00:00:00 2001 From: laoyang Date: Wed, 21 Oct 2026 20:13:28 +0800 Subject: [PATCH] =?UTF-8?q?v73b=EF=BC=9A=E7=BB=99=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=8A=A0=E4=B8=80=E6=9D=A1=E5=8F=AF=E8=A7=82?= =?UTF-8?q?=E6=B5=8B=E7=9A=84=E6=97=A5=E5=BF=97=EF=BC=88=E6=8E=92=E9=9A=9C?= =?UTF-8?q?=E7=94=A8=EF=BC=8C=E4=B8=8D=E6=94=B9=E5=8F=98=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 真机排障时发现:修复前 pushAll 在注册表为空时是**静默 return**, hilog 里一个字符都抓不到 ⇒ 出现"卡片不刷新"时只能一路读代码反推 (v73 的跨进程 preferences 根因就死在那行 return 上)。 现在留两条: · 为空 → warn,明确说"注册表为空(没卡片 或 跨进程没读到)" · 推完 → info,报"已推 N 张卡(M 种偏移)" 真机实测:勾一次任务后日志出现 pushAll:已推 4 张卡(1 种偏移) ⇒ 应用进程确实读到了卡片进程写下的 4 个 formId。 --- entry/src/main/ets/data/FbCardForms.ets | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/entry/src/main/ets/data/FbCardForms.ets b/entry/src/main/ets/data/FbCardForms.ets index 99dd977..b84ff92 100644 --- a/entry/src/main/ets/data/FbCardForms.ets +++ b/entry/src/main/ets/data/FbCardForms.ets @@ -223,6 +223,14 @@ class FbCardFormsImpl { async pushAll(ctx: common.Context): Promise { const list: string[] = await this.ids(ctx); if (list.length === 0) { + /* ⚠️ 这一条**必须留**(2026-10-21 真机排障时加的): + 修复前这里静默 return,听起来无害,实际是"整条链路断掉也毫无痕迹"—— + 我用 hilog 查 `pushAll` 时一个字符都抓不到,只能一路读代码猜。 + v73 的根因(跨进程 preferences 读到空表)就死在这一行上, + 而现场唯一能看到的只是"卡片不刷新"。 + ⇒ 留一条 warn:下次再出现"卡片不动",看日志立刻能分清是 + "没注册表"还是"注册了但更新失败",不用再从代码反推。 */ + hilog.warn(DOMAIN, TAG, 'pushAll:注册表为空(桌面没有卡片,或跨进程没读到)'); return; } const cache: Map = @@ -244,6 +252,8 @@ class FbCardFormsImpl { stale.push(formId); } } + hilog.info(DOMAIN, TAG, 'pushAll:已推 %{public}d 张卡(%{public}d 种偏移)', + list.length, cache.size); if (stale.length > 0) { const keep: string[] = list.filter((id: string): boolean => stale.indexOf(id) < 0); await this.saveIds(ctx, keep);