research: fix Draft 'Invalid Date' + stale-error leak in pipeline card
Two cosmetic bugs surfaced by the successful v0.8.3 pipeline run: 1. **'produced Invalid Date'** — research_outcomes.created_at was an OffsetDateTime serialized by time's default array format (`[y, ordinal, hh, mm, ss, ns, tz]`), which browser's `new Date(...)` can't parse. Add `#[serde(with = "time::serde::rfc3339")]` matching the pattern already in threads.rs / routine_runs.rs. 2. **Stale error text on pipeline card** — the runs stage's `latest_error` walked every run by `created_at DESC` and returned the first non-empty error, so a topic with an earlier failed run + a later completed run kept displaying the old error next to '1 completed'. Now the error only surfaces when the MOST RECENT run itself failed. Historical failures stay in the run count but don't leak their message.
This commit is contained in:
@@ -22,6 +22,11 @@ pub struct Outcome {
|
||||
pub version: i32,
|
||||
pub body_md: String,
|
||||
pub produced_by_run_id: Option<Uuid>,
|
||||
// RFC3339 on the wire so `new Date(...)` in the browser parses it
|
||||
// instead of choking on the `time` crate's default `[y, ordinal,
|
||||
// ...]` array format (surfaced as "Invalid Date" in the Draft
|
||||
// header).
|
||||
#[serde(with = "time::serde::rfc3339")]
|
||||
pub created_at: OffsetDateTime,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user