Release v0.6.0 #37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
XHR capture, console.error capture, Error formatting fixes. See PR #36.
Two of the three capture channels were blind to any app built on axios. NetworkInterceptor patched `globalThis.fetch` only. axios uses XMLHttpRequest, so every backend call in an axios app was invisible and `failedRequests` came back empty. ConsoleBuffer patched log/warn/info but not error — React Query and most hand-written error handlers report through `console.error`, so the console channel was empty too. Together these are why BUG-515 in superclean-sys2 arrived with `errors: [], console: [], failedRequests: []` — the reporter could not see anything. NetworkInterceptor: - Patch XMLHttpRequest.prototype.open/send alongside fetch. Both transports feed the same failure buffer and request log. - Records method, url, status, duration; captures response bodies subject to the existing 1KB byte-truncation. - Finalizes on `loadend` — the single terminal event for load, error, abort and timeout alike. - Transport failures land as status 0 with a `[xhr network error]` / `[xhr timeout]` marker body, so a status-0 entry is not silently indistinguishable from an empty response. - Aborts are logged but not counted as failures. React Query and axios cancel in-flight requests routinely; counting those would bury the real failures. - `responseText` is only read when responseType permits it (it throws a DOMException otherwise); responseType 'json' reads `response` instead. - Instrumentation is wrapped so a capture failure can never break open()/send(). - destroy() restores both prototype methods on the constructor it patched. ConsoleBuffer: - Patched levels are now driven by one PATCHED_LEVELS list with 'error' added, replacing four near-identical copy-pasted blocks. A missing level was the bug; a single list is what stops it recurring. - Error arguments now format as message + stack. JSON.stringify(new Error('x')) is '{}' — an Error has no enumerable own properties, so the previous formatting dropped the only useful part of `console.error('failed:', err)`. Test infrastructure — the suite was entirely non-functional: - vitest had no jsdom environment, so all 31 existing tests died on `ReferenceError: window is not defined`, and CI never ran `pnpm test` at all. Added jsdom + `test.environment` and a Test step after Build in ci.yml. - 26 new tests for the two fixes. Verified red-green: 22 of them fail against the previous implementation. Suite is now 63 passing, up from 0. Bundle is 12.85 kB gzipped, within the 15 kB constraint. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6VkoRihmoCUvXXYy8odKW