oliver-zehentleitner / maity

hub: outside_chat reads marks and unread counts per agent on every bell read and conversation list (one grouped read per human)

Sign in to report

tsk-cegwjfz94y97 Proposed

Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: debt (per-item queries on a hot path).

What is wrong

  • outside_chat.unread_by_project (outside_chat.py:207-213) runs one mark read plus one count per outside agent; notifications/listing.counts (notifications/listing.py:62) calls it on every bell read.
  • owner_marks (:134-142) runs one query per agent.
  • entries (:231-258) runs a last-message read, a mark read and an unread count per agent for the conversation list.

Proposal

  • One grouped read of marks and unread counts (and last message) for all of a human outside agents, used by the three functions.

Effort / risk: M. Low; the counts must stay equal, which the outside-chat tests pin.