feat(diag): 画板反复加载 breadcrumb 带 via/sync-loop 带 reason
This commit is contained in:
1 parent
47773c5096
commit
c51b0efaa9
6 files changed
+16
-9
No files matched your search
@@ -20,6 +20,12 @@
|
||||
|
||||
- 历史条目补录:该 tag 当时未在 CHANGELOG 记录(release-records 守卫要求 tag 与条目双向一致),内容按当时提交补一句占位说明。
|
||||
|
||||
## v3.26.253(2026-12-05)诊断增强:画板反复加载可定位
|
||||
|
||||
- wLoadBoard 的 breadcrumb 始终带 via=<reason>(hydrate-ws / board-into / 其它),不再出现无来源的 board-load
|
||||
- sync-loop 护栏记录里带上触发 reason,便于判断是轮询同步(applyLatest)、切画布还是恢复路径导致
|
||||
- 纯诊断日志,不改任何行为
|
||||
|
||||
## v3.26.252(2026-12-05)登记表保护 + 缩略图批量读(Rust 批次 A2)
|
||||
|
||||
- data.json 保护:每次启动把上一轮留成 `data.json.bak`;若读到的 `assets` 比 bak 少 30% 以上,判定为登记表异常 —— 保留 bak 不覆盖、写 `_boot.log`(assets-regress-load),并在 `stats().assetsGuard` 暴露;运行期骤减只记录(assets-regress-write)
|
||||
|
||||
@@ -3057,16 +3057,17 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
// 是"内存尖峰 + 卡顿"的来源之一。超阈值时记 sync-loop 并**暂停自动同步**(用户主动操作仍可继续)。
|
||||
try {
|
||||
const now = Date.now()
|
||||
const st = wLoadGuard.get(w.id) || { at: now, n: 0 }
|
||||
const st = wLoadGuard.get(w.id) || { at: now, n: 0, reason: '' }
|
||||
if (now - st.at > 60000) { st.at = now; st.n = 0 }
|
||||
st.n++
|
||||
if (reason) st.reason = String(reason)
|
||||
wLoadGuard.set(w.id, st)
|
||||
if (st.n === 7 && !wSyncPaused) {
|
||||
wSyncPaused = true
|
||||
if (CrashLog && typeof CrashLog.record === 'function') CrashLog.record('sync-loop', { scope: 'board-load', message: '同一画板 60 秒内被加载 ' + st.n + ' 次,已暂停自动同步', version: APP_VERSION, boardId: String(w.id), extra: { loads: st.n } })
|
||||
if (CrashLog && typeof CrashLog.record === 'function') CrashLog.record('sync-loop', { scope: 'board-load', message: '同一画板 60 秒内被加载 ' + st.n + ' 次,已暂停自动同步', version: APP_VERSION, boardId: String(w.id), extra: { loads: st.n, reason: String(st.reason || '') } })
|
||||
}
|
||||
} catch (e) { /* 护栏失败不影响加载 */ }
|
||||
try { if (CrashLog && CrashLog.breadcrumb) CrashLog.breadcrumb('board-load', String(w.id) + ' nodes=' + ((w.nodes || []).length) + ' loaded=' + wLoadedBoards.length + (reason ? ' via=' + reason : '')) } catch (e) { /* ignore */ }
|
||||
try { if (CrashLog && CrashLog.breadcrumb) CrashLog.breadcrumb('board-load', String(w.id) + ' nodes=' + ((w.nodes || []).length) + ' loaded=' + wLoadedBoards.length + ' via=' + String(reason || 'unknown')) } catch (e) { /* ignore */ }
|
||||
try { if (typeof window !== 'undefined' && window.IWBPerf) window.IWBPerf.tag('board') } catch (e) { /* ignore */ }
|
||||
try { const MG = (typeof window !== 'undefined') ? window.IWBImageCacheMigrate : null; if (MG && typeof MG.once === 'function') MG.once(w, { read: iwbCacheRead, write: wImgRefWrite, bump: wImgUrlBump }).then(function (r) { try { if (r && r.total) { const S = (typeof window !== 'undefined') ? window.IWBStorageFile : null; if (S && S.logLine) S.logLine('cache-migrate ' + String(w.id) + ' ok=' + r.ok + ' fail=' + r.fail + ' total=' + r.total) } } catch (e) { /* ignore */ } }).catch(function () { /* ignore */ }) } catch (e) { /* 迁移失败不影响装载 */ }
|
||||
return w
|
||||
@@ -3103,7 +3104,7 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
let act = ''
|
||||
act = lsRawGet('iwb_ws_active', '') || ''
|
||||
const target = list.find((w) => w.id === act) || list.find((w) => w.id === (ws && ws.activeId)) || list[0]
|
||||
if (target) await wLoadBoard(target, list)
|
||||
if (target) await wLoadBoard(target, list, 'hydrate-ws')
|
||||
return ws
|
||||
}
|
||||
// ---- 内部节点剪贴板单一契约(v3.87 剪贴板审计)----
|
||||
@@ -7330,7 +7331,7 @@ const tbCenterSeed = (type, refs) => {
|
||||
const target = list.find((w) => w.id === id)
|
||||
if (!target) return Promise.resolve(null)
|
||||
if (!wBoardNeedsHydrate(target)) { wTouchLoadedBoard(id, target); return Promise.resolve(target) }
|
||||
return wLoadBoard(target, list).catch(() => target)
|
||||
return wLoadBoard(target, list, 'board-into').catch(() => target)
|
||||
}
|
||||
// v3.87.17:离开画布视图(回「我的画布」/首页)时降回引用释放图片内存。
|
||||
// S14(多标签):只释放"不在打开标签里"的画布——打开标签的 hydrate/objectURL 保留(切回即用、不闪黑图);
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.26.252",
|
||||
"version": "3.26.253",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
|
||||
Generated
+1
-1
@@ -2014,7 +2014,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.26.252"
|
||||
version = "3.26.253"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.26.252"
|
||||
version = "3.26.253"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.26.252",
|
||||
"version": "3.26.253",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
Reference in new issue
Block a user