fix(electron): skip extraction without IPC carrier - #10041
Conversation
Overall package sizeSelf size: 8.42 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.3 | 125.43 kB | 445.14 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2026-08-28 09:42:08 Comparing candidate commit c80f7ae in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2296 metrics, 14 unstable metrics.
|
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: c80f7ae | Docs | View more details | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10041 +/- ##
==========================================
- Coverage 98.58% 98.08% -0.51%
==========================================
Files 991 987 -4
Lines 149346 149057 -289
Branches 12707 12602 -105
==========================================
- Hits 147237 146197 -1040
- Misses 2109 2860 +751 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c80f7aece3
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (channel?.startsWith('datadog:')) return | ||
|
|
||
| const childOf = this._tracer.extract('text_map', args.at(-1)) | ||
| let childOf |
There was a problem hiding this comment.
Preserve a null parent when no carrier is present
When a carrier-less IPC callback runs while a legacy tracing store is active, childOf now remains undefined; TracingPlugin.startSpan() interprets that as “inherit store.span.” Previously, extract(undefined) returned null, which explicitly forced the receive span to be a root. Consequently, an uninstrumented renderer message can be attached to an unrelated active trace despite the intended root-span behavior; initialize childOf to null and only replace it after successful extraction.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
That seems true. @LotharSee mind having a look? It would suffice to just define childOf = null as such
What does this PR do?
Avoids calling
tracer.extract()when Electron renderer IPC does not include a propagation carrier. The receive span is still created as a root span for uninstrumented renderer messages.Adds a regression test that sends an uninstrumented
ipcRenderer.postMessage()through the real Electron IPC path and verifies that extraction is not attempted withundefined.Motivation
Electron IPC messages can arrive without the carrier appended by the renderer instrumentation. The Electron plugin should treat that carrier as optional instead of passing
undefinedto the propagation layer.Additional Notes
This is the caller-side companion to #9980 and remains independently safe if the propagation-layer guard changes separately.
Validation:
PLUGINS=electron npm run test:plugins(72 passing)PLUGINS=electron npm run test:plugins:ci(72 passing; changed production lines covered)npm run lint