fix: preserve Chatwoot message visibility and identity

This commit is contained in:
plx
2026-08-14 14:08:23 +00:00
parent 475ff15b9b
commit c4d55d37ed
10 changed files with 531 additions and 71 deletions

View File

@@ -416,7 +416,11 @@ async def process_saved_chatwoot_raw_event(raw_event_id: str, payload: Dict[str,
contact_id=extracted["contact_id"],
)
response = await analyze(analyze_request, raw_event_id=raw_event_id)
response = await analyze(
analyze_request,
raw_event_id=raw_event_id,
source_event_id=extracted.get("source_event_id"),
)
chatwoot_note_result = {
"status": "skipped",
@@ -429,11 +433,14 @@ async def process_saved_chatwoot_raw_event(raw_event_id: str, payload: Dict[str,
action_result=response.action_result,
)
ignored_action = str(response.action_result.action_code or "").upper() in {
"IGNORE_BOUNCE", "IGNORE_SPAM", "SPAM",
}
mark_raw_event_processed(
raw_event_id=raw_event_id,
action_run_id=response.action_run_id,
message_id=response.message_id,
ignored=False,
ignored=ignored_action,
error=None,
)