oliver-zehentleitner / maity

web: placements quota words from the refusal's details, one refusal helper, no copied default 8

Sign in to report

tsk-cghs51sathfh Open

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

What is wrong

  • web/js/placements.js:618 falls back details.max -> policy.max_placements -> 8 (max === undefined ? 8 : max), and web/js/app.js:1321 copies the product default (PLACEMENTS_DEFAULT = 8, PLACEMENTS_MAX = 1000). Since #1960 the contract (§6.31) says every placement_quota refusal carries details.limit/count/max/raise, so the chain is a compat path.
  • The max_placements form checks locally against 1000 and never reads above_ceiling / details.ceiling, so an operator's lower ceiling only shows as the hub's generic message.
  • said(err) is written twice in placements.js (:151 and :607-612; the second only adds the field list); runnerPart returns said (:630, doc comment :413) but nothing reads viaRunner.said (join.js uses only refuse).

Proposal: take details.limit from the refusal; keep one constant only if policy can really be missing; say above_ceiling at the field; one module-level said; drop said from the returned object and its doc comment.

Effort / risk: S. Low risk.