zulip/zerver/actions
Alex Vandiver 6f20c15ae9 thumbnail: Resolve a race condition when rendering messages.
Messages are rendered outside of a transaction, for performance
reasons, and then sent inside of one.  This opens thumbnailing up to a
race where the thumbnails have not yet been written when the message
is rendered, but the message has not been sent when thumbnailing
completes, causing `rewrite_thumbnailed_images` to be a no-op and the
message being left with a spinner which never resolves.

Explicitly lock and use he ImageAttachment data inside the
message-sending transaction, to rewrite the message content with the
latest information about the existing thumbnails.

Despite the thumbnailing worker taking a lock on Message rows to
update them, this does not lead to deadlocks -- the INSERT of the
Message rows happens in a transaction, ensuring that either the
message rending blocks the thumbnailing until the Message row is
created, or that the `rewrite_thumbnailed_images` and Message INSERT
waits until thumbnailing is complete (and updated no Message rows).
2024-08-01 16:48:16 -07:00
..
__init__.py
alert_words.py alert_words: Update remove_alert_word codepath to send event on commit. 2024-07-31 22:33:52 -07:00
bots.py ruff: Fix PLR6104 Use `+=` to perform an augmented assignment directly. 2024-07-14 13:49:51 -07:00
create_realm.py zerver: Replace uri with url in local variables and comments. 2024-07-14 22:30:28 -07:00
create_user.py ruff: Fix UP035 Import from `collections.abc`, `typing` instead. 2024-07-13 22:28:22 -07:00
custom_profile_fields.py ruff: Fix UP035 Import from `collections.abc`, `typing` instead. 2024-07-13 22:28:22 -07:00
default_streams.py ruff: Fix UP035 Import from `collections.abc`, `typing` instead. 2024-07-13 22:28:22 -07:00
invites.py invites: Use the realm on the PreregistrationUser, to save a join. 2024-08-01 16:44:18 -07:00
message_delete.py events: Send `delete_message` event to user who deleted the message. 2024-07-16 23:29:02 -07:00
message_edit.py markdown: Show thumbnails for uploaded images. 2024-07-21 18:41:59 -07:00
message_flags.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
message_send.py thumbnail: Resolve a race condition when rendering messages. 2024-08-01 16:48:16 -07:00
muted_users.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
onboarding_steps.py onboarding_steps: Rename 'hotspots' files to 'onboarding_steps'. 2024-05-10 12:30:22 -07:00
presence.py presence: Remove the queue worker. 2024-07-31 16:46:42 -07:00
reactions.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
realm_domains.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
realm_emoji.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
realm_export.py migration: Rename extra_data_json to extra_data in audit log models. 2023-08-16 17:18:14 -07:00
realm_icon.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
realm_linkifiers.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
realm_logo.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
realm_playgrounds.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
realm_settings.py settings: Require clients to pass dense_mode value when needed. 2024-07-18 11:36:53 -07:00
scheduled_messages.py schedule_messages: Update do_schedule_messages to send event on commit. 2024-07-31 22:33:52 -07:00
streams.py ruff: Fix PLR6104 Use `+=` to perform an augmented assignment directly. 2024-07-14 13:49:51 -07:00
submessage.py typos: Fix typos caught by mwic. 2024-05-20 13:55:00 -07:00
typing.py ruff: Fix UP006 Use `list` instead of `List` for type annotation. 2024-07-13 22:28:22 -07:00
uploads.py thumbnail: Move get_image_thumbnail_path and split_thumbnail_path. 2024-07-18 13:50:28 -07:00
user_activity.py queue_processors: Process user_activity in one query. 2024-01-22 16:25:13 -08:00
user_groups.py ruff: Fix UP035 Import from `collections.abc`, `typing` instead. 2024-07-13 22:28:22 -07:00
user_settings.py settings: Require clients to pass dense_mode value when needed. 2024-07-18 11:36:53 -07:00
user_status.py user_status: Update do_update_user_status to send event on commit. 2024-07-31 22:33:52 -07:00
user_topics.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00
users.py refactor: Rename `huddle` to `direct_message_group` in non api files. 2024-07-31 23:25:56 -07:00
video_calls.py ruff: Fix UP007 Use `X | Y` for type annotations. 2024-07-13 22:28:22 -07:00