fix(gateway): keep non-Discord home-channel startup send byte-identical

The salvaged non_conversational marking made the home-channel startup
no-metadata branch always pass metadata= explicitly; for non-Discord
platforms _non_conversational_metadata returns None, so Telegram/etc.
went from adapter.send(chat_id, message) to adapter.send(..., metadata=None).
Behaviorally identical but broke test_restart_notification's exact
assert_called_once_with. Only attach metadata when the marker applies
(Discord), restoring the original call shape elsewhere.
This commit is contained in:
teknium1 2026-06-19 07:19:33 -07:00 committed by Teknium
parent caaa916289
commit df2420f571

View file

@ -12130,11 +12130,15 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew
metadata=_non_conversational_metadata(metadata, platform=platform),
)
else:
result = await adapter.send(
str(home.chat_id),
message,
metadata=_non_conversational_metadata(platform=platform),
)
_startup_meta = _non_conversational_metadata(platform=platform)
if _startup_meta:
result = await adapter.send(
str(home.chat_id),
message,
metadata=_startup_meta,
)
else:
result = await adapter.send(str(home.chat_id), message)
if result is not None and getattr(result, "success", True) is False:
logger.warning(
"Home-channel startup notification failed for %s:%s: %s",