oliver-zehentleitner / maity
web: every view reads the project's own roles through trust.projectRoles (one read per view)
tsk-ts7pg7cpg56m Open
Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: design / duplication. Different from tsk-pxz9wnx7qad2 (own roles in more pickers).
What is wrong: #1948 added M.trust.projectRoles (web/js/trust.js:77-89) as the one cached GET …/roles per view and moved join.js, invite.js and members.js onto it. Three sites still call M.api.get(ctx.base + "/roles") directly, each with its own empty .catch(() => {}): web/js/app.js:1217 (agentOwnersForm), web/js/project-roles.js:59 (settings section load), web/js/board-edit.js:232 (needsSelect). On Settings -> Members and agents the outside-roles form and the roles section both fetch the list on the same draw.
Proposal: app.js and board-edit.js use M.trust.projectRoles(ctx, arrived). project-roles.js needs version and builtin, so let the cache keep the whole answer ({custom, builtin, version}) and let project-roles.js drop it after a save.
Effort / risk: S. Low risk (the pickers already handle roles arriving late).