Improve how topic is managed on ws notifications

This commit is contained in:
Andrey Antukh 2024-10-30 12:32:03 +01:00 committed by Alonso Torres
parent 9409078069
commit 97a1bf15ef
6 changed files with 16 additions and 21 deletions

View file

@ -80,9 +80,9 @@
(->> stream
(rx/filter (ptk/type? ::dws/message))
(rx/map deref)
(rx/filter (fn [{:keys [subs-id] :as msg}]
(or (= subs-id uuid/zero)
(= subs-id profile-id))))
(rx/filter (fn [{:keys [topic] :as msg}]
(or (= topic uuid/zero)
(= topic profile-id))))
(rx/map process-message))
;; Once the teams are fecthed, initialize features related

View file

@ -65,15 +65,16 @@
(->> (rx/from initmsg)
(rx/map dws/send))
;; Subscribe to notifications of the subscription
(->> stream
(rx/filter (ptk/type? ::dws/message))
(rx/map deref)
(rx/filter (fn [{:keys [subs-id] :as msg}]
(or (= subs-id uuid/zero)
(= subs-id profile-id)
(= subs-id team-id)
(= subs-id file-id))))
(rx/filter (fn [{:keys [topic] :as msg}]
(or (= topic uuid/zero)
(= topic profile-id)
(= topic team-id)
(= topic file-id))))
(rx/map process-message))
;; On reconnect, send again the subscription messages