Backend stamps last_fire_error ({at, detail}) on a job when a scheduled fire
can't reach the gateway loopback (gateway down / api_server not bound) —
the "job runs manually but never auto-fires" case. Previously invisible in
mobile.
- CronJob.kt: model as CronJobFireError(at, detail) — the backend sends a
nested object, NOT a flat string (issue's String? proposal would fail to
deserialize), plus the last_fire_error field.
- CronJobsScreen: "Fire failed" ERROR badge in the list + "Dispatch Error"
row (detail + timestamp) in the Run Details dialog.
- Strings en/zh/ko. Test: job with last_fire_error loads + parses.
Backward-compatible: field has a default, existing jobs without it parse fine.
Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
1039d7db1d
commit
79c2ea1341
6 files changed
+69
No files matched your search
@@ -194,6 +194,14 @@ fun CronJobsScreen(
|
||||
status = StatusBadgeType.INFO,
|
||||
)
|
||||
}
|
||||
// Dispatch error badge: a scheduled fire was missed
|
||||
// (gateway unreachable / api_server not bound).
|
||||
if (job.last_fire_error != null) {
|
||||
StatusBadge(
|
||||
text = stringResource(R.string.cron_badge_dispatch_error),
|
||||
status = StatusBadgeType.ERROR,
|
||||
)
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(spacing.xs))
|
||||
Text(
|
||||
@@ -305,6 +313,20 @@ fun CronJobsScreen(
|
||||
if (job.last_error != null && job.last_error.isNotBlank()) {
|
||||
RunDetailRow("Error", job.last_error)
|
||||
}
|
||||
job.last_fire_error?.let { fireErr ->
|
||||
if (fireErr.detail != null || fireErr.at != null) {
|
||||
RunDetailRow(
|
||||
stringResource(R.string.cron_detail_dispatch_error),
|
||||
buildString {
|
||||
fireErr.detail?.let { append(it) }
|
||||
fireErr.at?.let { at ->
|
||||
if (fireErr.detail != null) append(" ")
|
||||
append("($at)")
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
job.script?.let { if (it.isNotBlank()) RunDetailRow("Script", it) }
|
||||
job.monitorSource?.let { if (it.isNotBlank()) RunDetailRow("Monitor", it) }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user