 (defmethod ws-handler :frontend/subscribe [{:keys [client-uuid ?data] :as req}]
   (let [document-id (-> ?data :document-id)]
     (log/infof "subscribing %s to %s" client-uuid document-id)
-    (subscribe-to-doc document-id client-uuid)))
+    (subscribe-to-doc document-id (client-uuid->uuid client-uuid))))
 
 (defn setup-ws-handlers [sente-state]
   (let [tap (async/chan (async/sliding-buffer 100))

;; TODO: find a way to restart sente
(defonce sente-state (atom {}))

(defn user-id-fn [ring-req]
  (UUID/randomUUID))

;; hash-map of document-id to set of connected user-ids
;; Used to keep track of which transactions to send to which user

(ns pc.http.sente
  (:require [clojure.core.async :as async]
            [clojure.set :as set]
            [clojure.string :as str]
            [clojure.tools.logging :as log]
            [taoensso.sente :as sente])
  (:import java.util.UUID))
