codingjoe / codingjoe/relay

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

Open
#233 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4
Forks
0
Avg merge
8h 24m
Merged PRs (30d)
115

Description

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:

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

`RECEIVED` is where a message sits while the scan is outstanding. So a message waiting on a scan 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 the thing 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, 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.

It compounds with a second gap: 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, so exhaustion is visible rather than silent.

Option 1 is the small change. Option 2 is the one that fixes the silent part.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.