Skip to content

A message awaiting its scan looks identical to a finished one in the dashboard #233

Open

Description

@codingjoe

A message that waits for its spam scan looks the same as a finished message in the dashboard. A reader cannot tell them apart.

Deferred from the ClamAV work on #184 (codingjoe-turbo-spoon).

secretJoe defer line: defer: the dashboard renders whatever spam_action string is stored (get_spam_action_display falls back to the raw value); no verdict = blank badge, so "unscanned" is indistinguishable from "clean" in the UI. [services/email/message/templates/message/message_detail.html], [services/email/message/models.py]

What

services/email/mta/models.py:31-33 gives RECEIVED and WEBHOOK_SENT the same success badge:

case status_class.RECEIVED | status_class.WEBHOOK_SENT:
    return "success"

RECEIVED is where a message sits while the scan is outstanding. A message that waits on a scan therefore renders exactly like one that finished and dispatched its webhook. spam_badge_variant (services/email/message/models.py:172-184) does distinguish them, but the status badge is what a reader scans first.

Why the ClamAV work made this matter

The scan now retries for about a day (SPAM_SCAN_RETRY, 40 attempts). Before that change, the window was about 37 minutes. A day-long stretch of "looks green, is not done" is a different problem from a half-hour one.

A second gap compounds it. When the retry budget runs out, the task ends and the message stays in RECEIVED with no marker. Nothing in the UI says "this was never scanned".

Options

  1. Give RECEIVED its own badge, distinct from WEBHOOK_SENT.
  2. Add a terminal status for a message whose scan never completed. Exhaustion is then visible, not silent.

Option 1 is the small change. Option 2 corrects the silent part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCorrectnessside questOut-of-scope finding, deferred to its own issue

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions