fix(monitor): keep failing publications visible outside the queue page

- The attention lane was derived from page 1 of the queue (limit 50, newest
  by updated_at), so failures ranked past 50 silently disappeared from
  "needs attention" as the completed backlog grew.
- Fetch attention items with a dedicated request: the API now accepts a
  comma-separated processing_state list (failed,stalled) and the view prefers
  that result set over the paged queue.
- Batch retry/cancel targets are computed from the same failure set instead of
  the visible page, so actions reach every failing item.
- 全部任务 shows 已显示 N / 共 M plus 加载更多 so rows past 50 are reachable.
- Fix pre-existing ui_settings integration test: strict JSON decoding rejects
  the legacy updated_by field (actor comes from the session).
- Tests: view regression (attention item outside the page, load-more
  affordance) + handler multi-state filter + isolated-DB set filter.
This commit is contained in:
姚章浩
2026-09-16 08:53:18 +08:00
parent 553eff5f7f
commit 1d6ba6dc2e
10 changed files with 149 additions and 21 deletions
+3 -2
View File
@@ -34,7 +34,8 @@ export interface AcceptanceRecord {
}
export interface TestPublicationQuery {
processing_state: ProcessingState | ''
// A single state, or several at once (joined into a comma list server-side).
processing_state: ProcessingState | '' | ProcessingState[]
target_scope?: 'internal' | 'external' | ''
limit: number
offset: number
@@ -93,7 +94,7 @@ export function parseTestPublicationsResponse(value: unknown): TestPublicationPa
export async function fetchTestPublications(query: TestPublicationQuery, signal?: AbortSignal): Promise<TestPublicationPage> {
const parameters = new URLSearchParams()
if (query.processing_state) parameters.set('processing_state', query.processing_state)
if (query.processing_state) parameters.set('processing_state', Array.isArray(query.processing_state) ? query.processing_state.join(',') : query.processing_state)
if (query.target_scope) parameters.set('target_scope', query.target_scope)
parameters.set('limit', String(query.limit))
parameters.set('offset', String(query.offset))