email_mirror: Migrate missed message addresses from redis to database.

Addresses point 1 of #13533.

MissedMessageEmailAddress objects get tied to the specific that was
missed by the user. A useful benefit of that is that email message sent
to that address will handle topic changes - if the message that was
missed gets its topic changed, the email response will get posted under
the new topic, while in the old model it would get posted under the
old topic, which could potentially be confusing.

Migrating redis data to this new model is a bit tricky, so the migration
code has comments explaining some of the compromises made there, and
test_migrations.py tests handling of the various possible cases that
could arise.
This commit is contained in:
Mateusz Mandera
2019-12-26 13:46:55 +01:00
committed by Tim Abbott
parent 9077bbfefd
commit c011d2c6d3
7 changed files with 238 additions and 109 deletions

View File

@@ -570,7 +570,7 @@ class MirrorWorker(QueueProcessingWorker):
return
mirror_email(email.message_from_string(event["message"]),
rcpt_to=rcpt_to, pre_checked=True)
rcpt_to=rcpt_to)
@assign_queue('test', queue_type="test")
class TestWorker(QueueProcessingWorker):