fix broadcast id mismatch for matchmaking channel
This commit is contained in:
@@ -8,7 +8,10 @@
|
|||||||
# 5. Disconnecting (or sending { action: "stop" }) cancels the search.
|
# 5. Disconnecting (or sending { action: "stop" }) cancels the search.
|
||||||
class MatchmakingChannel < ApplicationCable::Channel
|
class MatchmakingChannel < ApplicationCable::Channel
|
||||||
def subscribed
|
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
|
# If a match was found while this user had no subscription
|
||||||
# (e.g. brief reconnect), deliver it now — exactly once.
|
# (e.g. brief reconnect), deliver it now — exactly once.
|
||||||
|
|||||||
Reference in New Issue
Block a user