oliver-zehentleitner / maity
hub: small copies: _holder's full page load, pickup profile defaults twice, paging._bindable vs jcs, register_page HANDLE_PATTERN, replay reader helper
tsk-xrd360df64gt Open
Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication / debt (slow path). All S.
hub/src/maity_hub/routes/requests.py:499-501:_holdernow builds a full_known(conn, [row])(about 7 reads plus avatars) to return one principal id; it was one query before. Callers at:1631and:1826.hub/src/maity_hub/routes/runner.py:801-806and:814-815: thetrust/roledefaults ofnew_profile("member"/"coder") are written twice in one function, around aSimpleNamespacestand-in forinvitations.issuer_holds.hub/src/maity_hub/paging.py:134-145(_bindable) re-implementsjcs.has_lone_surrogate(hub/src/maity_hub/jcs.py:32) through an encode attempt.hub/src/maity_hub/routes/register_page.py:61HANDLE_PATTERNis a hand copy ofhub/src/maity_hub/models.py:12.hub/src/maity_hub/routes/board.py:160-168(_reader) androutes/events.py(~100-107) hold the same "membership or None for a replay" try/except.
Proposal: _holder reads the principal id with one query; one defaults constant in the pickup; _bindable calls jcs.has_lone_surrogate; register_page derives its pattern from models.HANDLE_PATTERN; one replay-reader helper.
Effort / risk: S. Low risk.