fix(messages): use HTML strong tag instead of markdown, remove reply_to mapping from migration
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-03-27 13:43:21 +01:00
parent f8f8c22bee
commit 51f041baa4

View File

@ -27,7 +27,7 @@ from database import (SessionLocal, PrivateMessage, MessageGroup, MessageGroupMe
def build_content(subject, content): def build_content(subject, content):
"""Prepend subject as bold line if present.""" """Prepend subject as bold line if present."""
if subject and subject.strip(): if subject and subject.strip():
return f"**{subject.strip()}**\n\n{content}" return f"<p><strong>{subject.strip()}</strong></p>{content}"
return content return content
@ -95,16 +95,15 @@ def migrate_private_messages(db, dry_run):
for pm in pair_msgs: for pm in pair_msgs:
full_content = build_content(pm.subject, pm.content) full_content = build_content(pm.subject, pm.content)
# Resolve reply_to_id from old parent_id # Note: old parent_id was thread-root (email-style), not a specific quote.
reply_to_id = None # Don't map to reply_to_id — it would create visual clutter with every
if pm.parent_id and pm.parent_id in pm_id_map: # reply quoting the same root message.
reply_to_id = pm_id_map[pm.parent_id]
conv_msg = ConvMessage( conv_msg = ConvMessage(
conversation_id=conv.id, conversation_id=conv.id,
sender_id=pm.sender_id, sender_id=pm.sender_id,
content=full_content, content=full_content,
reply_to_id=reply_to_id, reply_to_id=None,
created_at=pm.created_at, created_at=pm.created_at,
) )
db.add(conv_msg) db.add(conv_msg)