fix(observability): preserve browser and flush guarantees - #3268
Conversation
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR is a follow-up observability fix that keeps the public observability surface browser-linkable while tightening FileLogSubscriber.flush() durability guarantees so later flushes wait for writes accepted during an active flush.
Changes:
- Make
src/platform/compat/error-introspection.tsloadnode:util/typesonly on detected Node-compatible hosts (via dynamic import) to preserve browser/edge linkability. - Serialize file-log durability syncs with the write queue so a later
flush()does not resolve while writes accepted during an active flush are still pending. - Add targeted regressions: flush interleaving coverage in
file-log-subscriber.test.tsand expand browser-safe export checks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/platform/compat/error-introspection.ts | Replaces static node:util/types import with conditional dynamic import to keep browser imports linkable. |
| src/observability/file-log-subscriber.ts | Refactors flush tracking to snapshot the queue and gate new writes behind a flush barrier. |
| src/observability/file-log-subscriber.test.ts | Adds a regression test for flush interleaving (writes queued during an active flush). |
| scripts/build/browser-safe-exports.test.ts | Updates/extends browser bundle assertions for the observability public barrel. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9df06851d0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
c3d9595 to
ef05f85
Compare
ef05f85 to
c39614c
Compare
Description
Follow-up to #3237 that closes late durability and cross-runtime compatibility gaps without adding third-party dependencies.
flush()waits for writes accepted during an active flush.node:util/typesbrand checks synchronously at the runtime trust boundary while keeping browser and edge module graphs free of Node builtin imports.Runtime support after this change:
Review context:
Related Issue(s)
Follow-up to #3237.
Type of Change
Checklist
Verification
deno task verify:quickgit diff --check