riverqueue / riverui

A web interface for River, fast and reliable background jobs in Go.
https://ui.riverqueue.com/
Mozilla Public License 2.0
43 stars 3 forks source link

fix unhandled timeline scenario for retryable jobs #47

Closed bgentry closed 1 week ago

bgentry commented 1 week ago

The Wait step in the timeline attempts to show how long a job waited between its scheduled_at time and when it was picked up for work with attempted_at.

This works well for nearly all cases, but it doesn't work well for jobs that error and become retryable because those jobs overwrite the scheduled_at with the new time for the next attempt, so there is no longer any way to deduce how long a job waited before being executed.

Longer term this is something I'd like to think about addressing with a new way of storing more details on individual job attempts so that no detail is lost along the way like this. But for now, the best we can do is detect this scenario and show some empty text instead of a nonsensical negative duration like this:

Screenshot 2024-06-20 at 9 34 13 AM