fix: dashboard: mapTimingPhases does not sort timing phase buckets chronologically (oldest -> newest)

Closed
AH
24d ago
+15-10

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 by timestamp (oldest -> newest) before mapping in mapTimingPhases, matching mapLatency.
  • Tested with unit tests verifying chronological sorting and safe handling of empty/null inputs.