hyperfiddle-2020 icon indicating copy to clipboard operation
hyperfiddle-2020 copied to clipboard

'#() breaks EvalRequest equality causing incorrect loading screen

Open dustingetz opened this issue 5 years ago • 2 comments

(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

image

image

image

dustingetz avatar Apr 12 '20 20:04 dustingetz

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}

dustingetz avatar Apr 12 '20 20:04 dustingetz

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

dustingetz avatar Apr 13 '20 15:04 dustingetz