fix broadcast id mismatch for matchmaking channel

This commit is contained in:
2026-10-26 00:00:19 +03:00
parent 9987407187
commit df2a334d7c
@@ -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:<id>". 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.