               (print-to-stream stream args)))
     (wait-for-connection repl-env)
     (let [ev-connections (eval-connections repl-env)
-          result (let [v (deref (send-for-eval ev-connections js)
+          result (let [v (deref (send-for-eval repl-env ev-connections js)
                                 (or repl-timeout 8000)
                                 timeout-val)]
-                   (if (= timeout-val v)
-                     {:status :exception
-                      :value "Eval timed out!"
-                      :stacktrace "No stacktrace available."}
-                     v))]
+                   (cond (= timeout-val v)
+                     (do
+                       (when @focus-session-name
+                         (reset! focus-session-name nil))
+                       {:status :exception
+                        :value "Eval timed out!"
+                        :stacktrace "No stacktrace available."})
+                     (::no-connection-made (meta v))
+                     (do
+                       (when @focus-session-name
+                         (reset! focus-session-name nil))
+                       v)
+                     :else v))]
       (when-let [out (:out result)]
         (when (not (string/blank? out))
           (repl-env-print repl-env :out [(string/trim-newline out)])))


  scratch


  (do
    (cljs.repl/-tear-down re)
    (def re (repl-env* {:output-to "dev-resources/public/out/main.js"}))
    (cljs.repl/-setup re {}))


  (connections-available re)
  (open-connections)
  (evaluate re "33")

  (evaluate re "setTimeout(function() {cljs.core.prn(\"hey hey\")}, 1000);")


(defn connection-send [{:keys [send-fn] :as conn} data]
  (send-fn conn data))

(defn send-for-response* [prom conn msg]
  (let [uuid (str (java.util.UUID/randomUUID))
        listener (fn listen [msg]
                   (when (= uuid (:uuid msg))
                     (when-let [result (:response msg)]
                       (deliver prom
                                (if (instance? clojure.lang.IMeta result)
                                  (vary-meta result assoc ::message msg)
                                  result)))
                     (remove-listener listen)))]
    (add-listener listener)
    (try
      (connection-send
       conn
       (json/write-str
        (-> (select-keys conn [:session-id :session-name])
            (merge msg)
            (assoc :uuid uuid))))
      (catch Throwable t
        (remove-listener listener)
        (throw t)))))

(def no-connection-result
  (vary-meta
   {:status :exception
    :value "Expected REPL Connections Evaporated!"
    :stacktrace "No stacktrace available."}
   assoc ::no-connection-made true))

(defn broadcast-for-response [connections msg]
  (let [prom (promise)
        cnt  (->> connections
                  (mapv #(try
                           (send-for-response* prom % msg)
                           true
                           (catch Throwable t
                             nil)))
                  (filter some?)
                  count)]
    (when (zero? cnt)
      (deliver prom no-connection-result))
    prom))

(defn send-for-response [connections msg]
  (let [prom (promise)
        sent (loop [[conn & xc] connections]
               (when conn
                 (if-not (try
                           (send-for-response* prom conn msg)
                           true
                           (catch Throwable t
                             false))
                   (recur xc)
                   true)))]
    (when-not sent
      (deliver prom no-connection-result))
    prom))

(defn http-long-polling-connect [ring-request respond raise]
