Repository navigation
Commit b741286
fix(stats): treat orphaned sessions as top-level for cost aggregation
When a parent session is deleted (e.g. via direct DB deletion), its children
become orphans with parentID still set. The aggregateSessionStats function
only used totalCost for top-level sessions (no parentID). Orphaned sessions
were treated as non-top-level, so their descendants' costs were lost.
Now checks if the parentID actually exists in the session set. If not,
the session is treated as top-level and totalCost (BFS) is used.
Addresses janorga's comment about deleted-parent case (anomalyco#48306).
Co-Authored-By: zai-glm-52 <[email protected]>
Agent: @Feature-dev
Scope: anomalyco#436451 parent d230002 commit b741286
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | | - | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| |||
0 commit comments