hub: the bell's open inbox records follow the retention sweep's rule (mail_disabled while disabled; one helper)
tsk-n4k3tkacestm Open
Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: design / docs drift / duplication.
What is wrong
hub/src/maity_hub/notifications/items.py:995-1012listsmail_disabledonly whilerow.at >= now - WINDOW, so after 30 days it is gone. TheTODO(#280)at:996-999waits for an address state that now exists (address_status).hub/src/maity_hub/notifications/retention.py:197-207(still_open) keeps the record while the address stays disabled, anddocs/api.md:25707andhub/context/notifications.md:1521say it is counted until the address is set again. The record survives in the table but the bell and counts stop showing it.- The other open-record rules are written twice between the two modules: the
registration_pendingwaiting set (items.py:1043-1059_waiting_registrationsvsretention.py:184-196, same SQL) and the newestagents_not_listeningrecord (items.py:721-732vsretention.py:208-225).
Proposal: one open_records(conn, rows) in records.py or retention.py, used by bell and sweep; read address_status for mail_disabled; drop the TODO.
Effort / risk: M. Low-medium risk (bell counts change for old disabled addresses).