Skip to main content

Module renderer_log

Module renderer_log 

Source
Expand description

Renderer-side error reporter. The web error boundary calls this from componentDidCatch so the crash lands in the same rotating log file as everything else, instead of vanishing into the webview devtools console where no end user ever looks.

Constantsยง

MAX_FIELD_BYTES ๐Ÿ”’
Per-field cap. The renderer can be compromised (supporter custom CSS is a real injection surface), so we treat the message/stack as attacker-controlled and refuse to log more than ~8 KiB per field. Real stack traces are well under this; a 4 GiB stack on a tight loop is a disk-fill DoS.

Functionsยง

redact_and_truncate ๐Ÿ”’
Bound the field at MAX_FIELD_BYTES and strip anything that looks like a Lemon Squeezy licence key or a manual ENT1-โ€ฆ token โ€” the renderer should never have these in scope, but a stack trace that captured local variables (or a user CSS that embedded one) would otherwise leak the secret into the log file.
report_renderer_error