mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-04 12:55:03 +00:00
[#12531 pairing] Sync read messages
This commit is contained in:
parent
9035954f8b
commit
adca53f3ec
@ -50,31 +50,10 @@
|
|||||||
|
|
||||||
(seq chats)
|
(seq chats)
|
||||||
(do
|
(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")
|
(js-delete response-js "chats")
|
||||||
(fx/merge cofx
|
(fx/merge cofx
|
||||||
(process-next response-js sync-handler)
|
(process-next response-js sync-handler)
|
||||||
(models.chat/ensure-chats (map #(-> %
|
(models.chat/ensure-chats (map data-store.chats/<-rpc (types/js->clj chats)))))
|
||||||
(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)))))
|
|
||||||
|
|
||||||
(seq messages)
|
(seq messages)
|
||||||
(models.message/receive-many cofx response-js)
|
(models.message/receive-many cofx response-js)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||||
"owner": "status-im",
|
"owner": "status-im",
|
||||||
"repo": "status-go",
|
"repo": "status-go",
|
||||||
"version": "v0.89.15",
|
"version": "v0.89.18",
|
||||||
"commit-sha1": "9693d59e614899557e8b2f4f19ad541bbad3be39",
|
"commit-sha1": "4a0ad1cf69dada9569664cefee81f3cf7a9312ae",
|
||||||
"src-sha256": "19nl5g5vhrsm510mi0nddi5n67h6z27nx6vixk72bwyvlpz22sij"
|
"src-sha256": "19rghmv0jqdw7l66rnib9001rxl2hszmkam2v0q4999x8qnj2jfl"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user