fix(trace): Preserve EAP transaction parentage#112492
Merged
nsdeschenes merged 5 commits intomasterfrom Apr 10, 2026
Merged
Conversation
Keep EAP transaction nodes attached to their actual parent spans so the collapsed tree no longer assigns transaction-flagged spans to the wrong ancestor branch. Derive the summarized transactions-only view from visibility rules instead of mutating parentage during construction. Co-Authored-By: GPT-5.4 <noreply@openai.com> Made-with: Cursor
Align the EAP span node test helper with the real TraceTree list type so tsgo accepts collapsed transaction visibility cases again. Refs EXP-756 Co-Authored-By: GPT-5.4 <noreply@openai.com> Made-with: Cursor
Keep collapsed EAP transaction summaries walking through wrapper nodes created by preferences so nested descendant transactions stay visible. Document the traversal contract and cover the regression with tests. Refs EXP-756 Co-Authored-By: GPT-5.4 <noreply@openai.com> Made-with: Cursor
The getCollapsedTransactionChildren traversal was missing cycle detection that every other tree traversal in the codebase includes. Add a visited Set to guard against infinite loops from circular parent_span_id references in trace data. Also fix a stale duplicate comment left from the reparenting removal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f6e5a76 to
603b82a
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 603b82a. Configure here.
Abdkhan14
approved these changes
Apr 10, 2026
Contributor
Abdkhan14
left a comment
There was a problem hiding this comment.
lgtm, I would just check the comment from the agent about sort
The DFS traversal in getCollapsedTransactionChildren() returns nested transactions in tree-structure order, not chronological order. When sibling branches have non-monotonic timestamps, the collapsed summary renders transactions out of order. Sort the result with traceChronologicalSort to match the expected waterfall ordering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Fixes the EAP trace waterfall placing transaction-flagged spans under the wrong parent.
Previously, the constructor hoisted these spans to the nearest ancestor transaction, which broke branch ordering in the collapsed view. Now the real parent-child relationships from the API are preserved, and the transactions-only summary is derived from visibility rules instead.
Also fixes autogroup wrapper traversal and adds cycle detection to the collapsed transaction walk.
Snapshot updates reflect real tree depth replacing the old synthetic hoisted depth.
Refs EXP-756