fix(photon): ignore iMessage media placeholders

Cherry-picked from PR #54514; dropped frozen AUTHOR_MAP hunk in scripts/release.py, contributor mapping added instead.
This commit is contained in:
kelsia14 2026-07-28 11:06:10 -07:00 committed by Teknium
parent be05741349
commit fd4f756492
3 changed files with 32 additions and 0 deletions

View file

@ -726,6 +726,19 @@ class PhotonAdapter(BasePlatformAdapter):
)
ctype = content.get("type")
if ctype == "text":
raw_text = content.get("text") or ""
# iMessage emits U+FFFC OBJECT REPLACEMENT CHARACTER as a transient
# placeholder for some media bubbles (notably voice notes). Photon
# can then deliver the real attachment/voice event immediately
# afterwards with a different message id. If we dispatch the
# placeholder as a standalone text turn, the subsequent media event
# arrives while that turn is active and the gateway sends a bogus
# "Interrupting current task" busy ack. Drop placeholder-only text
# at the platform boundary; the real media event carries the bytes.
if raw_text.strip() == "\ufffc":
logger.debug("[photon] ignoring iMessage object-placeholder text event")
return
if ctype == "reaction":
# Route only tapbacks on messages WE sent — those are implicitly
# addressed to the bot (feishu precedent: synthetic text event).