Skip to content

Commit 9e2bece

Browse files
committed
Small bugs: fix NPE, deal with thread-ts == ts
1 parent 4dc7024 commit 9e2bece

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

deps.edn

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
:sha "ff96d4f07d5b12b2fe0d8b206eb4a3713ad222d6"}}}
4747

4848
:datomic-free {:extra-paths ["profiles/datomic_on_prem"]
49-
:extra-deps {com.datomic/datomic-free {:mvn/version "1.0.6316"}}}
49+
:extra-deps {com.datomic/datomic-free {:mvn/version "0.9.5697"}}}
5050
:datomic-pro {:extra-paths ["profiles/datomic_on_prem"]
5151
:extra-deps {com.datomic/datomic-pro {:mvn/version "1.0.6316"}}}
5252
:datomic-cloud {:extra-paths ["profiles/datomic_cloud"]

src/clojurians_log/db/queries.clj

+4-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@
7474
;; Remove all thread messages except for the thread parent
7575
;; and except for brodcast messages.
7676
;; Note that thread parents do not have a :thread-ts value themselves
77-
(remove #(and (:message/thread-ts %) (not (:message/thread-broadcast? %))))
77+
(remove #(and (:message/thread-ts %)
78+
;; detect self-referenctial thread heads, this happens when importing backfilled data
79+
(not (= (:message/thread-ts %) (:message/ts %)))
80+
(not (:message/thread-broadcast? %))))
7881
(map #(if (:message/thread-broadcast? %)
7982
(assoc % :message/top-level? true)
8083
%))

src/clojurians_log/repl.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201

202202
(def result (load-files! (log-files)))
203203
;; or
204-
(def result (load-files! (files-from "2019-01-01")))
204+
(def result (load-files! (files-from "2021-08-25")))
205205

206206
;; see progress
207207
(future

src/clojurians_log/views.clj

+6-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@
129129
(when (= today a-date)
130130
index))
131131
$)
132-
(+ $ offset)
133-
(nth channel-days $ nil)
134-
(first $)))
132+
(when $
133+
(+ $ offset))
134+
(when $
135+
(nth channel-days $ nil))
136+
(when $
137+
(first $))))
135138

136139
(defn- channel-list [{:data/keys [date channels] :as context}]
137140
[:div.listings_channels

0 commit comments

Comments
 (0)