Skip to content

Return disposables from tracing start, take HAR start times from the browser - #92

Open
kblok wants to merge 1 commit into
mainfrom
port/tracing-har-expose
Open

kblok wants to merge 1 commit into
mainfrom
port/tracing-har-expose

Conversation

@kblok

@kblok kblok commented Oct 6, 2026

Copy link
Copy Markdown
Member

Upstream now returns a disposable from tracing.start() and tracing.startChunk(). Disposing it stops without exporting, so the trace or chunk is thrown away. ITracing comes from the Microsoft.Playwright package and still returns Task, so the expanded-parameter StartAsync(name: ...) / StartChunkAsync(name: ...) extensions now return the IAsyncDisposable. stopChunk also ends the chunk now, the same as upstream. Before, a second StopChunkAsync(path) quietly wrote an empty trace. Now it throws "Must start tracing before stopping".

HAR startedDateTime used ResourceTiming.StartTime. That is a float, so epoch milliseconds were rounded to about two minutes. Entries now use the request's browser wall time instead, the way upstream does with Request.wallTimeMs(). WebKit was also reading wallTime, but the protocol field is walltime, so it fell back to the monotonic timestamp.

The new pagehide binding test needs no library change. It passes on WebKit and is skipped on Chromium, as upstream's fixme does.

Closes #39, closes #51, closes #46

🤖 Generated with Claude Code

Tracing.StartAsync / StartChunkAsync expanded overloads now return a
disposable that discards the trace or chunk, and stopChunk now ends the
chunk like upstream. HAR entries take startedDateTime from the browser
wall time instead of the float ResourceTiming start time, and WebKit
reads the protocol's `walltime` field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant