From 1e95d835f9d94b0a9bad9a39a09c3908217badca Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Tue, 12 Oct 2021 13:35:25 +0300 Subject: [PATCH] [#12531 pairing] Sync read messages --- src/status_im/transport/message/core.cljs | 23 +---------------------- status-go-version.json | 6 +++--- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/status_im/transport/message/core.cljs b/src/status_im/transport/message/core.cljs index 8beabc6d2dd..1d6d9f73bc5 100644 --- a/src/status_im/transport/message/core.cljs +++ b/src/status_im/transport/message/core.cljs @@ -47,31 +47,10 @@ (seq chats) (do - (when (seq contacts) - ;; Note(rasom): in case if response contains contacts entries, some - ;; of them might be blocked. That means we might need to recalculate - ;; unviewed/mentions counters in chats where blocked users sent - ;; messages. Currently we ignore unviewed/mentions values which come - ;; from go side (see code few lines below) because it (probably) - ;; breaks app-db state. But we still have to apply those values when - ;; blocked contact is received from a paired device. - ;; In order to do so, we store all affected chats separately so that - ;; process loop might continue and then we use those chats on - ;; processing contacts update. Currently it causes one bug: for some - ;; reason own messages are counted as unviewed in 1-1 chat if they are - ;; sent on paired device. Although this change reveals the bug it is - ;; not the cause and thus the bug should be fixed separately. - (set! (.-chatsForContacts response-js) chats)) (js-delete response-js "chats") (fx/merge cofx (process-next response-js sync-handler) - (models.chat/ensure-chats (map #(-> % - (data-store.chats/<-rpc) - ;; We dissoc this fields as they are handled by status-react and - ;; not status-go, as there might be requests in-flight that change - ;; this value - (dissoc :unviewed-messages-count :unviewed-mentions-count)) - (types/js->clj chats))))) + (models.chat/ensure-chats (map data-store.chats/<-rpc (types/js->clj chats))))) (seq messages) (models.message/receive-many cofx response-js) diff --git a/status-go-version.json b/status-go-version.json index 284688b5680..696109a9869 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v0.89.14", - "commit-sha1": "c20e8ebdeffd14a881d8092ee64e5180ad53449e", - "src-sha256": "0jbmgj0m1hv1nx3frbzs7lsn8nqspsir5kpzn8lldfgkfgpv96h7" + "version": "feat/#12531-sync-read-messages", + "commit-sha1": "6023b551a9a8ef02be9a8fa312f57688419b1704", + "src-sha256": "09sj3s9q4snga4xk2g38fv4hv3l17b6s2almd5add0hlmvxvxqcq" }