From df2a334d7cb9fc47dd291f1f7e1b1c965cd99481 Mon Sep 17 00:00:00 2001 From: Slavasil Date: Mon, 26 Oct 2026 00:00:19 +0300 Subject: [PATCH] fix broadcast id mismatch for matchmaking channel --- main-server/app/channels/matchmaking_channel.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main-server/app/channels/matchmaking_channel.rb b/main-server/app/channels/matchmaking_channel.rb index cc6d487..0782d05 100644 --- a/main-server/app/channels/matchmaking_channel.rb +++ b/main-server/app/channels/matchmaking_channel.rb @@ -8,7 +8,10 @@ # 5. Disconnecting (or sending { action: "stop" }) cancels the search. class MatchmakingChannel < ApplicationCable::Channel def subscribed - stream_for current_user + # NB: must mirror MatchmakingService.broadcast, which uses + # broadcast_to(user_id) → "matchmaking:". stream_for(current_user) + # would use the GlobalID-based name and never receive those broadcasts. + stream_from "matchmaking:#{current_user.id}" # If a match was found while this user had no subscription # (e.g. brief reconnect), deliver it now — exactly once.