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.