fix: Resolve TypeScript excess property error in TraceStatistics grouping logic#3718
Conversation
- Replaced nested filter operation with Map-based lookup for parent grouping. - Used single-pass for-loops to reduce intermediate array allocations. - Significantly improved performance for traces with large numbers of spans. Co-authored-by: jkowall <1859948+jkowall@users.noreply.github.com>
- Use property spreading for 'key' and 'children' in TraceStatistics. - Matches original implementation's object-merging pattern. - Resolves lint-build failure in CI. Co-authored-by: jkowall <1859948+jkowall@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates TraceStatistics table grouping to avoid TypeScript’s excess property check when attaching Ant Design Table-only fields (key, children) onto ITableSpan records.
Changes:
- Replaces
filter()-based partitioning with a single-pass split intowithDetail/withoutDetail. - Pre-indexes detail rows by
parentElementusing aMapto avoid repeated filtering per parent row. - Adds
keyandchildrenvia object spreading (using intermediate objects) to bypass TS2353 excess property errors without changingITableSpan.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3718 +/- ##
==========================================
+ Coverage 89.18% 89.22% +0.03%
==========================================
Files 308 330 +22
Lines 9787 9904 +117
Branches 2599 2572 -27
==========================================
+ Hits 8729 8837 +108
+ Misses 1054 925 -129
- Partials 4 142 +138 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
💡 What
Updated the optimized
groupAndSubgroupSpanDatafunction inTraceStatistics/index.tsxto use property spreading when addingkeyandchildrenproperties toITableSpanobjects.🎯 Why
The previous implementation directly included the
keyproperty in an object literal alongside the spread ofITableSpan. This triggered TypeScript's excess property check (error TS2353), askeyis not part of theITableSpaninterface. The new implementation follows the same pattern as the original code (using separate objects and spreading them), which correctly bypasses these strict checks.✅ Verified
ITableSpaninterface.Note: The PR still requires a
changelog:label to pass the CI label check.PR created automatically by Jules for task 4195882467421278995 started by @jkowall