fix(FN-1313): use stable mission event ordering
- Replace mission event list sorting fallback from rowid to id for deterministic ordering - Update latest mission error lookup to order by id instead of rowid when timestamps tie
This commit is contained in:
@@ -405,7 +405,7 @@ export class MissionStore extends EventEmitter<MissionStoreEvents> {
|
||||
SELECT *
|
||||
FROM mission_events
|
||||
WHERE ${whereSql}
|
||||
ORDER BY timestamp DESC, rowid DESC
|
||||
ORDER BY timestamp DESC, id DESC
|
||||
LIMIT ? OFFSET ?
|
||||
`).all(...params, limit, offset) as any[];
|
||||
|
||||
@@ -479,7 +479,7 @@ export class MissionStore extends EventEmitter<MissionStoreEvents> {
|
||||
SELECT timestamp, description
|
||||
FROM mission_events
|
||||
WHERE missionId = ? AND eventType = 'error'
|
||||
ORDER BY timestamp DESC, rowid DESC
|
||||
ORDER BY timestamp DESC, id DESC
|
||||
LIMIT 1
|
||||
`).get(missionId) as { timestamp: string; description: string } | undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user