zulip/zerver/worker
Alex Vandiver 98362de185 models: Add content_type to ImageAttachment.
This means that only ImageAttachment row needs to be fetched, and
removes the need to pass around an extra parameter.  This
denormalization is safe, since in general Attachment rows are
read-only, so we are not concerned with drift between the Attachment
and ImageAttachment tables.

We cannot make content_type non-null, since while the both the
`content_type` column in Attachment and populating that from requests
predates the ImageAttachment table, we have both backfilled
ImageAttachment rows to consider, and imports may also leave files
with no `content_type`.  Any backfill of currently-null `content_type`
values will thus need to update both tables.

This change fixes a race condition when importing. ImageAttachment
rows are imported before rendering Messages, which are both before
importing Attachment rows; if the thumbnailing finished after the
Message was imported but before Attachment rows were imported, then
the re-rendering step would not know the image's content-type.
2025-01-31 14:29:57 -08:00
..
__init__.py Add new system for defining and running queue-processing workers 2013-09-24 20:44:15 -04:00
base.py worker: Address sentry_sdk deprecations. 2024-10-22 10:05:01 -07:00
deferred_work.py realm: Add option to schedule data deletion while deactivating. 2024-12-18 23:06:12 -08:00
digest_emails.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
email_mirror.py send_email: Parse emails in a way mypy 1.14 understands. 2024-12-21 21:06:53 -08:00
email_senders.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
embed_links.py embed_links: Add savepoint=False to avoid creating savepoints. 2024-11-21 14:55:15 -08:00
embedded_bots.py worker: Flag messages processed by embedded bot. 2025-01-24 17:56:44 -08:00
missedmessage_emails.py ruff: Fix PLC0206 Extracting value from dictionary without calling .items(). 2024-12-21 21:06:53 -08:00
missedmessage_mobile_notifications.py ruff: Fix PLR6104 Use += to perform an augmented assignment directly. 2024-07-14 13:49:51 -07:00
outgoing_webhooks.py worker: Flag messages processed by outgoing bot. 2025-01-24 17:56:44 -08:00
queue_processors.py ruff: Fix UP007 Use X | Y for type annotations. 2024-07-13 22:28:22 -07:00
test.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
thumbnail.py models: Add content_type to ImageAttachment. 2025-01-31 14:29:57 -08:00
user_activity_interval.py ruff: Fix UP035 Import from collections.abc, typing instead. 2024-07-13 22:28:22 -07:00
user_activity.py ruff: Fix UP006 Use list instead of List for type annotation. 2024-07-13 22:28:22 -07:00