fix(gateway): re-join topic in phoenix-channel on error (#10397)

For whatever reason, we seem to sometimes lose the association with the
"room" we are meant to be in in order to send messages to the portal.
Without joining the right room, messages get dropped silently.

To fix this, we re-join the room on such errors. Long-term, this will be
fixed by ditching phoenix-channel in favor of simple HTTP requests.

Related: #9649
This commit is contained in:
Thomas Eizinger
2025-09-20 05:14:12 +00:00
committed by GitHub
parent c3e1bc8a5b
commit 88e801ad97

View File

@@ -652,6 +652,16 @@ async fn phoenix_channel_event_loop(
break;
}
}
Either::Left((
Ok(phoenix_channel::Event::ErrorResponse {
topic,
res: phoenix_channel::ErrorReply::UnmatchedTopic,
..
}),
_,
)) => {
portal.join(topic, ());
}
Either::Left((Ok(phoenix_channel::Event::ErrorResponse { topic, req_id, res }), _)) => {
tracing::warn!(%topic, %req_id, "Request failed: {res:?}");
}