angee.messaging.runtime_migrations.public_thread_message_kind
Converge public-thread messages onto the COMMENT kind the ingest owner derives.
Before the kind decision moved to the ingest owner, each backend declared the functional kind, so the same act landed differently by arrival path — a broadcast-channel post ingested by a chat bridge was chat while a feed post was comment. The ingest owner now derives the kind from the thread's structural shape (public-thread content is a COMMENT); this one-time data fix converges the rows written under the per-backend rule. Downstream makemigrations cannot represent a data fix, hence the addon-owned runtime migration.
applies
def applies(project_state: ProjectState) -> boolReturn whether messaging carries the message kind and thread modality to fix.
A data-only fix has no new-state schema marker: it is applicable whenever the target shapes exist, and its body is idempotent (the predicate excludes already-converged rows), so materializing it on a fresh project is a no-op.
mark_public_thread_messages_comment
def mark_public_thread_messages_comment(apps, schema_editor) -> NoneRelabel chat-kind messages in public threads as comments.
Historical models through _base_manager — a migration is a system operation.
Migration
class Migration(migrations.Migration)Data fix: public-thread messages carry the COMMENT kind.