   (:require [cemerick.url :as url]
             [cheshire.core :as json]
             [clojure.core.async :as async]
+            [clojure.set :as set]
             [clojure.tools.logging :as log]
             [clojure.tools.reader.edn :as edn]
             [clj-time.core :as time]

         :body (:public-message t)})
      (catch Object e
        (log/error e)
        {:status 500
         :body "Sorry, something completely unexpected happened!"}))))


  (or (= :https (:scheme req))
      (= "https" (get-in req [:headers "x-forwarded-proto"]))))

(def bucket-doc-ids (atom #{}))

(defn clean-bucket-doc-ids []
  (swap! bucket-doc-ids (fn [b]
                          (set/intersection b (set (keys @sente/document-subs))))))

(defn app [sente-state]
  (routes
   (POST "/api/entity-ids" request
