Server assumes client gets messages sent

This commit is contained in:
Nicholas Kariniemi 2014-10-06 19:18:08 +03:00
parent 821ba079e0
commit 7126a6b7b3

View file

@ -24,9 +24,11 @@
{:keys [diff hash]} (sync/diff-states (sync/get-current-state new-states) new-shadow)]
(when-not (= states* new-states)
(reset! states new-states))
(when-not (sync/empty-diff? diff)
(when-not (or client? (sync/empty-diff? (:diff msg)))
(>! out (message/diff-msg diff hash)))
(recur new-shadow))
(if client?
(recur new-shadow)
(recur (sync/get-current-state new-states))))
(if client?
(do (>! out message/full-sync-request)
(recur shadow))