feat(devtools): provider-level console log capture with session preserve (0275) - #397
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…eserve The Logs tab's console tap lived in a panel-scoped React effect, so navigating away restored console.* and dropped the buffer. Capture now lives on the provider (ConsoleLogStore ring + instrumentConsole) and the panel is a pure view. Opt-in Preserve log snapshots the ring to sessionStorage (scrubbed, byte-capped) so logs survive reloads and die with the tab. Crash reports gain scrubbed recentLogs breadcrumbs at consent tiers that share crashes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…local wipe The 5s dirty-flush could re-create xnet:devtools:logs:v1 between clearLogSnapshot() and the async OPFS wipe finishing. Wipe paths now call setPreserve(false), which removes the flag and key and makes any later snapshotNow a no-op. Caught by live browser validation. Also adds a node23 launch.json entry (shell default node16 can't run pnpm/vite). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Preview removed for PR #397. |
| const fresh = consoleLogs | ||
| .getEntries() | ||
| .filter( | ||
| (e) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements exploration 0275 — DevTools Log Persistence.
What
The Logs tab's console tap lived in a panel-scoped React effect, so navigating away restored
console.*and dropped the buffer — logs only existed while you were looking at them.ConsoleLogStorering (1000 entries) +instrumentConsoletap live onXNetDevToolsProviderfor the page lifetime; the Logs panel is now a pure view. The SQLite panel reads from the shared store instead of patchingconsole.*a second time.sessionStorage(scrubbed of tokens/emails/UUIDs/DIDs, byte-capped) onvisibilitychange→hidden/pagehide+ a lazy 5s dirty-flush; hydrated entries render dimmed behind a session divider. Off by default; sessionStorage is per-tab and dies on tab close.recentLogsbreadcrumbs (last 50 scrubbed lines) at consent tiers that share crashes.setPreserve(false)so the snapshot can't survive (or be re-written mid-wipe by the dirty-flush — race caught during live validation).Phase 3 (durable IndexedDB capture) is intentionally deferred per the exploration. No changeset:
@xnetjs/devtoolsisprivate: true.Validation
Live-verified in the running app (see checked Validation Checklist in the doc): capture before the tab is opened / while other panels are active / with the dock closed; preserve round-trip with divider after reload; scrubbed snapshot vs raw live view; no storage writes with preserve off; wipe removes the key; tap overhead ~8µs/line. 27 new unit tests; 205 devtools tests green.
🤖 Generated with Claude Code