Stop sending seen messages
Currently, these messages are not used and should be properly revisited later. It only generates extra traffic on discovery topic.
This commit is contained in:
parent
d3f1b37c12
commit
9daef17f11
|
@ -209,7 +209,8 @@
|
||||||
updated-statuses)
|
updated-statuses)
|
||||||
:data-store/tx [(user-statuses-store/save-statuses-tx updated-statuses)]}
|
:data-store/tx [(user-statuses-store/save-statuses-tx updated-statuses)]}
|
||||||
(update-chats-unviewed-messages-count {:chat-id chat-id})
|
(update-chats-unviewed-messages-count {:chat-id chat-id})
|
||||||
(send-messages-seen chat-id loaded-unviewed-ids)
|
;;TODO(rasom): uncomment when seen messages will be revisited
|
||||||
|
#_(send-messages-seen chat-id loaded-unviewed-ids)
|
||||||
(when platform/desktop?
|
(when platform/desktop?
|
||||||
(update-dock-badge-label))))))
|
(update-dock-badge-label))))))
|
||||||
|
|
||||||
|
|
|
@ -198,10 +198,11 @@
|
||||||
current-chat? :seen
|
current-chat? :seen
|
||||||
:else :received))
|
:else :received))
|
||||||
(commands-receiving/receive message)
|
(commands-receiving/receive message)
|
||||||
(send-message-seen chat-id message-id (and (not group-chat)
|
;;TODO(rasom): uncomment when seen messages will be revisited
|
||||||
current-chat?
|
#_(send-message-seen chat-id message-id (and (not group-chat)
|
||||||
(not (= constants/system from))
|
current-chat?
|
||||||
(not (:outgoing message)))))))
|
(not (= constants/system from))
|
||||||
|
(not (:outgoing message)))))))
|
||||||
|
|
||||||
(fx/defn update-group-messages [cofx chat->message chat-id]
|
(fx/defn update-group-messages [cofx chat->message chat-id]
|
||||||
(fx/merge cofx
|
(fx/merge cofx
|
||||||
|
|
|
@ -245,10 +245,11 @@
|
||||||
(testing "With empty unviewed set, no effects are produced"
|
(testing "With empty unviewed set, no effects are produced"
|
||||||
(is (= nil (chat/mark-messages-seen {:db test-db} "opened"))))
|
(is (= nil (chat/mark-messages-seen {:db test-db} "opened"))))
|
||||||
|
|
||||||
(testing "For 1-1 chat, we send seen messages confirmation to the recipient as well"
|
#_(testing "For 1-1 chat, we send seen messages confirmation to the
|
||||||
(is (= #{"4" "5" "6"}
|
recipient as well"
|
||||||
(set (get-in (chat/mark-messages-seen {:db test-db} "1-1")
|
(is (= #{"4" "5" "6"}
|
||||||
[:shh/post 0 :message :payload :message-ids]))))))
|
(set (get-in (chat/mark-messages-seen {:db test-db} "1-1")
|
||||||
|
[:shh/post 0 :message :payload :message-ids]))))))
|
||||||
|
|
||||||
(deftest update-dock-badge-label
|
(deftest update-dock-badge-label
|
||||||
(testing "When user has unseen private messages"
|
(testing "When user has unseen private messages"
|
||||||
|
|
|
@ -162,10 +162,10 @@
|
||||||
:clock-value 1
|
:clock-value 1
|
||||||
:timestamp 0}
|
:timestamp 0}
|
||||||
extract-seen (comp :payload :message first :shh/post)]
|
extract-seen (comp :payload :message first :shh/post)]
|
||||||
(testing "it send a seen message when the chat is 1-to-1 and is open"
|
#_(testing "it sends a seen message when the chat is 1-to-1 and is open"
|
||||||
(is (instance? protocol/MessagesSeen
|
(is (instance? protocol/MessagesSeen
|
||||||
(extract-seen (message/receive-many cofx [message]))))
|
(extract-seen (message/receive-many cofx [message]))))
|
||||||
(is (= #{"1"} (:message-ids (extract-seen (message/receive-many cofx [message]))))))
|
(is (= #{"1"} (:message-ids (extract-seen (message/receive-many cofx [message]))))))
|
||||||
(testing "it does not send any when the chat is a group-chat"
|
(testing "it does not send any when the chat is a group-chat"
|
||||||
(is (nil? (extract-seen
|
(is (nil? (extract-seen
|
||||||
(message/receive-many
|
(message/receive-many
|
||||||
|
|
Loading…
Reference in New Issue