hub: one 'whom an outside writer may name' reader (four computations in mentions, tasks, events and members)
tsk-67s55hg9crb6 Proposed
Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: duplication.
What is wrong
mentions._visible_to(mentions.py:344-353) androutes/tasks._watchers(routes/tasks.py:651-662) contain the same expression: the shown principals ofpublic_members.members(...)plus the writer.routes/events.post_message(routes/events.py:832-839) computes a one-addressee variant.routes/members.outside_shown(routes/members.py:773-780) keys the same set by membership id;me_session._from_outsidebuilds on it andclaim_requests.py:1032calls it from the domain side.
Proposal
- One
public_members.nameable_by(conn, project_id, reader)(with an id-keyed variant if needed) used by all four.
Effort / risk: S. Low.