       (if (not-empty vmsg)
         (send-end-msg ws {:op :validate :payload vmsg})
         (let [{:keys [cmd eid template]} params
-              dt (date-time-map)
-              resfut (actions/action cmd eid params get-toolinfo template)]
+              dt (date-time-stg)
+              resmap (actions/action cmd eid params get-toolinfo template)
+              resfut (resmap :fut)
+              jobdb-info (or (get-jdb [user eid phase]) [])]
           (aerial.utils.misc/sleep 250)
-          (swap! dbg (fn[M] (assoc M eid resfut)))
-          (infof "%s : %s" cmd resfut)
-          (update-jdb [user (dt :date) (dt :time)]
-                      {:action {:params params :template template}
-                       :result resfut})
-          (if (future-done? resfut)
-            (let [cause (->> @resfut (austr/split #">>") second
-                             (str "Launch Failed: "))]
+          (swap! dbg (fn[M] (assoc M eid resmap)))
+          (infof "%s : %s" cmd (prn-str resfut))
+          (update-jdb [user eid phase]
+                      (conj jobdb-info
+                            {:request {:timestamp dt
+                                       :params (dissoc params :ws)}
+                             :status (resmap :status)
+                             :result resfut}))
+          (if (and (future-done? resfut) (map? @resfut) (@resfut :error))
+            (let [cause (->> (or (@resfut :msg) (prn-str (@resfut :error)))
+                             (str "Job Launch : "))]
               (srv/send-msg ws {:op :error :payload cause}))
             (srv/send-msg ws {:op :launch :payload "Successful"}))
           (srv/send-msg ws {:op :stop :payload {}} :noenvelope true))))))
 
+
 (defn msg-handler [msg]
   (let [{:keys [ws data]} msg
         {:keys [op data]} data
-        {:keys [user cmd phase modifier compfile eid]} data
+        {:keys [user cmd phase modifier compfile eid action]} data
         eid (if (str/ends-with? eid "/") (austr/butlast 1 eid) eid)
         eid (if (str/starts-with? eid "/") (austr/drop 1 eid) eid)
         params {:user user, :cmd op, :modifier modifier
-                :phase phase, :eid eid :ws ws}]
+                :phase phase, :action action :eid eid :ws ws}]
     (infof "MSG-HANDLER: MSG %s" (msg :data))
     (try
       (case op
         (:done "done")
         (do (infof "WS: %s, sending stop msg" ws)
             (srv/send-msg ws {:op :stop :payload {}} :noenvelope true))
+
+        (:status "status")
+        (user-msg {:op op :params params})
+
         ;;null for now
         (let [vmsg (va/validate-sheets-exist eid)]
           (if (not-empty vmsg)

  ([key-path] (hc/get-db job-db key-path)))




;;; ------------------------------------------------------------------------;;;

  (infof "ERROR: unknown user message %s" msg)
  #_(srv/send-msg
     (msg :ws) {:op "error" :payload "ERROR: unknown user message"}))


(defmethod user-msg :status [msg]
  (let [params (msg :params)
        {:keys [ws user eid action]} params]
    (let [jinfo (hc/get-db (atom (valuefy @job-db)) [user eid action])
          result (if (seq jinfo)
                   (->> jinfo (sort-by #(-> % :request :timestamp))
                        (mapv #(vector (-> % :request :timestamp)
                                       (% :status)
                                       (% :result))))
                   (format "No job information for [%s %s %s]"
                           user eid action))
          retmsg (if (string? result)
                   result
                   (str/join
                    "\n"
                    (mapv #(let [timestamp (first %)
                                 status (second %)
                                 res (last %)
                                 rstg (if (= res :future-not-yet-finished)
                                        (format
                                         "Currently still running:\n%s"
                                         (with-out-str (pprint status)))
                                        (format
                                         "Finished:\n%s\nFinal result:\n%s"
                                         (with-out-str (pprint status))
                                         (with-out-str (pprint res))))]
                             (with-out-str
                               (print (format "%s : %s started @ %s\n%s"
                                              eid action timestamp rstg))))
                          result)))]
      (send-end-msg ws {:op :status :payload retmsg}))))


(defmethod user-msg :run [msg]
  (let [params (msg :params)
