oliver-zehentleitner / maity

web: one placement-actions helper for /runners and Managed agents; the /runners poll never keeps a stale read

Sign in to report

tsk-tty3c3yrs62v Open

Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication / debt.

What is wrong

  • #1938 added a placement list per runner on /runners: web/js/runners.js:274-312 (agentsOn) repeats Stop (PATCH {desired:"stopped"}) and Remove (window.confirm + DELETE) with its own labels and busy texts, next to web/js/placements.js:175-229 (path, actions).
  • runners.js:281 (placementPath) rebuilds M.api.projectPath by hand (split("/").map(encodeURIComponent)).
  • readLines clears and refills the shared linesOf map before reload() (runners.js:453-457) checks read !== reads, so a slow older poll can leave stale lines for the next draw.

Proposal: use M.api.projectPath; pull one placement-actions helper out of placements.js used by both; readLines returns its map, assigned only after the staleness check.

Effort / risk: M. Low-medium risk (smoke tests cover /runners).