hyperfiddle-2020
hyperfiddle-2020 copied to clipboard
'#() breaks EvalRequest equality causing incorrect loading screen
(defn hydrate-impl [rt pid request]
(r/fmap-> (r/cursor (state/state rt) [:hyperfiddle.runtime/partitions pid :ptm])
(get request (either/left {:message "Loading" :data {:request request}}))))
It's using the request in get, or returing the "Loading" message we're seeing Since the forms are macro expanded with different variable gensyms, which I saw happening in the debugger, there get doesn't find the exact request, and returns the default



I’m not sure if the notion of a “Request” is necessary anymore, perhaps the whole thing can be refactored to be driven by routes all the way through, so the equality is in terms of {:hyperfiddle.route/fiddle :a/c}
regex literals also break equality for eval and trigger bad loading msg (This happens in Rosie)
(= '(last (clojure.string/split (or (:sub-req/teacher req) "none") #" "))
'(last (clojure.string/split (or (:sub-req/teacher req) "none") #" ")))
=> false
(= '#" " '#" ")
false