oliver-zehentleitner / maity

hub: the bell's open inbox records follow the retention sweep's rule (mail_disabled while disabled; one helper)

Sign in to report

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-1012 lists mail_disabled only while row.at >= now - WINDOW, so after 30 days it is gone. The TODO(#280) at :996-999 waits 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, and docs/api.md:25707 and hub/context/notifications.md:1521 say 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_pending waiting set (items.py:1043-1059 _waiting_registrations vs retention.py:184-196, same SQL) and the newest agents_not_listening record (items.py:721-732 vs retention.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).