Skip to content

Commit fc3645f

Browse files
committed
fix: tail may have the same datoms that exists in db
Still don't know why this happens, I can't reproduce it anymore, but we don't want to see it in production environment.
1 parent d4940ea commit fc3645f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/datascript/storage.cljs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,13 @@
162162

163163
(defn db-with-tail [db tail]
164164
(reduce
165-
(fn [db datoms]
166-
(reduce db/with-datom db datoms))
167-
db tail))
165+
(fn [db datoms]
166+
(reduce (fn [db datom]
167+
(try (db/with-datom db datom)
168+
(catch :default e
169+
(js/console.error e)
170+
db))) db datoms))
171+
db tail))
168172

169173
(defn restore
170174
([storage]

0 commit comments

Comments
 (0)