From 9b8d73ef86d13c8dca10da1b2bf6b5b4a33937a7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 1 Mar 2021 16:37:58 +0100 Subject: [PATCH] :bug: Fix topic encoding on msg publication. --- backend/src/app/msgbus.clj | 2 +- backend/src/app/rpc/mutations/files.clj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/app/msgbus.clj b/backend/src/app/msgbus.clj index 143d5c08f..63ea00ae4 100644 --- a/backend/src/app/msgbus.clj +++ b/backend/src/app/msgbus.clj @@ -219,7 +219,7 @@ (defn- impl-redis-pub [rac {:keys [topic message]}] - (let [topic (str topic) + (let [topic (str (cfg/get :tenant) "." topic) message (blob/encode message) res (a/chan 1)] (-> (.publish ^RedisAsyncCommands rac ^String topic ^bytes message) diff --git a/backend/src/app/rpc/mutations/files.clj b/backend/src/app/rpc/mutations/files.clj index 82cd365d7..bb453122f 100644 --- a/backend/src/app/rpc/mutations/files.clj +++ b/backend/src/app/rpc/mutations/files.clj @@ -313,7 +313,7 @@ (let [lchanges (filter library-change? changes)] ;; Asynchronously publish message to the msgbus - (msgbus :pub {:topic (str (:id file)) + (msgbus :pub {:topic (:id file) :message {:type :file-change :profile-id (:profile-id params) @@ -325,7 +325,7 @@ (when (and (:is-shared file) (seq lchanges)) (let [team-id (retrieve-team-id conn (:project-id file))] ;; Asynchronously publish message to the msgbus - (msgbus :pub {:topic (str team-id) + (msgbus :pub {:topic team-id :message {:type :library-change :profile-id (:profile-id params)