Anomaly 4 — Frontend polling may create overlapping requests
Title
Dashboard polling should prevent overlapping API requests
Type
bug, frontend, performance, polling
Problem
The dashboard appears to poll /printers and /jobs every few seconds. If the backend is slow, unreachable, or blocked, a new polling tick may start before the previous request has completed.
This can produce request accumulation:
t=0s GET /printers starts
t=5s previous still pending, new GET /printers starts
t=10s another GET /printers starts
...
Over time this can make both frontend and backend behavior worse.
Expected behavior
Polling must be non-overlapping.
For each polling loop:
- do not start a new request if the previous one is still running
- optionally abort old request with
AbortController
- count timeout/network failures
- keep only the latest successful state
- avoid updating the DOM from stale responses
Acceptance criteria
- If
/printers request is still pending, the next /printers poll is skipped or delayed.
- If
/jobs request is still pending, the next /jobs poll is skipped or delayed.
- Slow backend responses do not create a request backlog.
- Stale responses cannot overwrite newer dashboard state.
- Network failures are counted by the offline-state mechanism.
Anomaly 4 — Frontend polling may create overlapping requests
Title
Dashboard polling should prevent overlapping API requestsType
bug,frontend,performance,pollingProblem
The dashboard appears to poll
/printersand/jobsevery few seconds. If the backend is slow, unreachable, or blocked, a new polling tick may start before the previous request has completed.This can produce request accumulation:
Over time this can make both frontend and backend behavior worse.
Expected behavior
Polling must be non-overlapping.
For each polling loop:
AbortControllerAcceptance criteria
/printersrequest is still pending, the next/printerspoll is skipped or delayed./jobsrequest is still pending, the next/jobspoll is skipped or delayed.