Skip to content

fix(trace): Preserve EAP transaction parentage#112492

Merged
nsdeschenes merged 5 commits intomasterfrom
nd/EXP-756/fix-waterfall-eap-transaction-reparenting
Apr 10, 2026
Merged

fix(trace): Preserve EAP transaction parentage#112492
nsdeschenes merged 5 commits intomasterfrom
nd/EXP-756/fix-waterfall-eap-transaction-reparenting

Conversation

@nsdeschenes
Copy link
Copy Markdown
Contributor

@nsdeschenes nsdeschenes commented Apr 8, 2026

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

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 8, 2026
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 8, 2026

nsdeschenes and others added 3 commits April 9, 2026 09:17
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>
@nsdeschenes nsdeschenes force-pushed the nd/EXP-756/fix-waterfall-eap-transaction-reparenting branch from f6e5a76 to 603b82a Compare April 9, 2026 12:38
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

@nsdeschenes nsdeschenes requested a review from Abdkhan14 April 9, 2026 12:48
@nsdeschenes nsdeschenes marked this pull request as ready for review April 9, 2026 12:48
@nsdeschenes nsdeschenes requested a review from a team as a code owner April 9, 2026 12:48
Copy link
Copy Markdown
Contributor

@Abdkhan14 Abdkhan14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@nsdeschenes nsdeschenes merged commit 5de27bd into master Apr 10, 2026
65 checks passed
@nsdeschenes nsdeschenes deleted the nd/EXP-756/fix-waterfall-eap-transaction-reparenting branch April 10, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants