Skip to content

Commit 44b66cc

Browse files
committed
fix: create ghost msg/emoji entities if not found
The problem here is with the lookup-refs. Some times reaction data refers to message-keys which are not existing, this can happen for older messages which aren't in our archives. So by passing the lookup ref as maps datomic will create an entitify if it doesn't exist.
1 parent e238eaa commit 44b66cc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/clojurians_log/db/import.clj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,11 @@
9595
:url url})
9696

9797
(defmethod event->tx ["reaction_added" nil] [{:keys [user item reaction item_user event_ts ts]}]
98-
;; Placeholder just to show that we're getting some data.
99-
;; TODO: return Datomic transaction data to create a reaction entity
10098
{:reaction/type "reaction_added"
101-
:reaction/emoji [:emoji/shortcode reaction]
99+
:reaction/emoji {:emoji/shortcode reaction}
102100
:reaction/ts ts
103101
:reaction/user [:user/slack-id user]
104-
:reaction/message [:message/key (message-key item)]})
102+
:reaction/message {:message/key (message-key item)}})
105103

106104
(defmethod event->tx ["reaction_removed" nil] [{:keys [user item reaction item_user event_ts ts]}]
107105
;; Placeholder just to show that we're getting some data.

0 commit comments

Comments
 (0)