           (.printStackTrace e)))
       (log/debug "Profile data for zid" (:zid conv) ": " prof))))
 
-;; XXX WIP; need to flesh out and think about all the ins and outs
+;; XXX This is temporary; should be switching to schema work in conversation ns
 ;; Also, should place this in conversation, but for now...
 (def Conversation
   "A schema for what valid conversations should look like (WIP)"

  (let [rid (:rid report-data)
        tids (map :tid (postgres/query (:postgres conv-man) (postgres/report-tids rid)))
        corr-mat (corr/compute-corr conv tids)]
    (postgres/insert-correlationmatrix! postgres rid corr-mat)
    (postgres/mark-task-complete! postgres (-> report-data :task-record :rid))))


;; Need to think about what to do if failed conversations lead to messages piling up in the message queue XXX

        (error-callback votes start-time (:opts' conv) e)
        conv))))

(defn write-conv-updates!
  [{:as conv-man :keys [postgres]} {:as updated-conv :keys [zid]}]
  ;; TODO Really need to extract these writes so that mod updates do whta they're supposed to! And also run in async/thread for better parallelism
  ; Format and upload main results
  (async/thread
    (doseq [[prep-fn uploader] [[prep-main db/upload-math-main] ; main math results, for client
                                [prep-bidToPid db/upload-math-bidtopid] ; bidtopid mapping, for server
                                [prep-ptpt-stats db/upload-math-ptptstats]]]
      (->> updated-conv
           prep-fn
           (uploader postgres zid)))
    (log/info "Finished uploading math results for zid:" zid)))

;; Maybe switch over to using this with arbitrary attrs map with zid and other data? XXX
;(defmacro try-with-error-log
