mirror of
https://github.com/edufeed-org/edufeed-web.git
synced 2025-12-10 00:34:34 +00:00
sanitize subscription id when requesting d-tags
This commit is contained in:
parent
fe42a9bf66
commit
f1ba7eeab0
1 changed files with 6 additions and 2 deletions
|
|
@ -375,7 +375,9 @@
|
|||
_ (.log js/console (clj->js dispatch-events))]
|
||||
{:fx [[:dispatch-n dispatch-events]]})))
|
||||
|
||||
(defn sanitize-subscription-id [s]
|
||||
(defn sanitize-subscription-id
|
||||
"cuts the subscription string at 64 chars"
|
||||
[s]
|
||||
(str/join "" (take 64 s)))
|
||||
|
||||
(defn make-sub-id [prefix id]
|
||||
|
|
@ -449,11 +451,13 @@
|
|||
{:ids event-ids}]]
|
||||
{::request-from-relay [sockets query]})))
|
||||
|
||||
;; FIXME at some future point in time we should think about cancelling subscriptions after success
|
||||
;; at least for these it might make sense
|
||||
(re-frame/reg-event-fx
|
||||
::query-for-d-tag
|
||||
(fn [db [_ [sockets d-tags]]]
|
||||
(let [query ["REQ"
|
||||
"RAND42"
|
||||
(sanitize-subscription-id (first d-tags)) ;;TODO guess this can be made more sensible
|
||||
{:#d d-tags}]]
|
||||
{::request-from-relay [sockets query]})))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue