diff options
| author | Agando <roduccomm@gmail.com> | 2026-10-18 17:19:14 +0200 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-10-18 17:19:14 +0200 |
| commit | 7e904aec06c09f7fdef0938155d2b9a19d36e314 (patch) | |
| tree | f859e146ad9e34c75d86ebcabefdb70a07ec4db9 /modules/core/module-system.js | |
| parent | 267b50588c736fdfec9a53488a2a39c608ebd7d4 (diff) | |
newOS4 v4.6.40: review fixes (bug diagnostics, trash tree, dir paste, stale capture, preview)
Diffstat (limited to 'modules/core/module-system.js')
| -rw-r--r-- | modules/core/module-system.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/core/module-system.js b/modules/core/module-system.js index 1a9ad05..bedceef 100644 --- a/modules/core/module-system.js +++ b/modules/core/module-system.js @@ -318,8 +318,18 @@ errors: [], }; try { - const raw = JSON.parse(localStorage.getItem('webx11_debug_db') || '[]'); - const list = Array.isArray(raw) ? raw : (raw.errors || []); + // Prefer the LIVE error DB: localStorage writes are debounced, so a report + // filed right after an error would otherwise carry an empty list. + let list = []; + try { + const ds = Object.values(this.terminal.moduleManager.modules) + .find(m => m && m._errorDB && m._errorDB.errors); + if (ds) list = Object.values(ds._errorDB.errors); + } catch (_e) {} + if (!list.length) { + const raw = JSON.parse(localStorage.getItem('webx11_debug_db') || '[]'); + list = Array.isArray(raw) ? raw : Object.values((raw && raw.errors) || {}); + } diag.errors = list.slice(-20).map(e => ({ message: String(e.message || e.msg || '').slice(0, 300), source: String(e.source || e.url || '').slice(0, 200), |