fix: dashboard: mapTimingPhases does not sort timing phase buckets chronologically (oldest -> newest)
Closed
AH
24d ago+15+15+01234567890123456789-10-10-01234567890123456789
Description
Fixes #2987
In mapTimingPhases (apps/dashboard/src/data/metrics.client.ts), Tinybird metric rows were mapped directly without sorting, which caused timing phases charts to render buckets in reverse or inconsistent order whenever the pipe returned rows descending.
Changes
- Sort
[...(timingPhases.data ?? [])]ascending bytimestamp(oldest -> newest) before mapping inmapTimingPhases, matchingmapLatency. - Tested with unit tests verifying chronological sorting and safe handling of empty/null inputs.