From bc519231d95100a5b2767c3d52d017a021bdf7e2 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Tue, 8 Nov 2022 12:57:50 +0200 Subject: [PATCH] added wildcard realtime topic support --- apis/realtime.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apis/realtime.go b/apis/realtime.go index 5ba3fdb6..646af821 100644 --- a/apis/realtime.go +++ b/apis/realtime.go @@ -307,8 +307,11 @@ func (api *realtimeApi) broadcastRecord(action string, record *models.Record) er subscriptionRuleMap := map[string]*string{ (collection.Name + "/" + cleanRecord.Id): collection.ViewRule, (collection.Id + "/" + cleanRecord.Id): collection.ViewRule, - collection.Name: collection.ListRule, - collection.Id: collection.ListRule, + (collection.Name + "/*"): collection.ListRule, + (collection.Id + "/*"): collection.ListRule, + // @deprecated: the same as the wildcard topic but kept for backward compatibility + collection.Name: collection.ListRule, + collection.Id: collection.ListRule, } data := &recordData{