Fork me on GitHub
#hyperfiddle
<
2023-05-21
>
teawaterwire10:05:14

i built a (silly 🙃 ) Electric app - it runs without erros on my machine, but when i deploy it to Fly it gives an error that i have trouble understanding: https://coffee-sign.fly.dev/ (`Reactor failure`) the source code is here: https://github.com/teawaterwire/CoffeeSign/blob/main/src/app/coffee_sign.cljc any idea what it could be? 🙏

1
Dustin Getz13:05:46

Remote error - 1011 Server process crash

Dustin Getz13:05:58

There should be something in the server logs

Dustin Getz13:05:30

i have it running locally, going to try to rep it locally (TY for github link)

Dustin Getz13:05:34

I repped it using the prod build locally

Dustin Getz13:05:42

ERROR hyperfiddle.electric-jetty-adapter: Websocket handler failure clojure.lang.ExceptionInfo: Unable to resolve symbol: app.coffee-sign/find-contract

Dustin Getz13:05:45

(This will be in your Fly logs)

Dustin Getz13:05:52

change to app.coffee-sign

Dustin Getz13:05:52

works in dev by accident because in dev, shadow and your app are sharing the same JVM so the app's server side got loaded by shadow

teawaterwire14:05:37

ah amazing! thanks 🙌 i just pushed let's see 🤞

teawaterwire18:05:23

i'm surprised to see that the in-memory db is not reset after redeploying. or it's maybe because i only changed css?

Dustin Getz18:05:26

perhaps it was a rolling deploy and you caught an old instance?

Benjamin C16:05:43

Haha @U5UCAE37Z, what a fun idea! I'm a fan 🙂

🙌 2
braai engineer13:05:13

What is supposed to happen with db symbol if you do this?

(e/defn App []
  (e/server [db (e/watch data/conn)]
    (ui/button
      (e/fn []
        (e/server
          (e/discard
            (ds/q db ...) ;; 1. will this db reference work?
            (ds/transact! data/conn ...))))))  ;; 2. won't this transact cause the e/fn to be cancelled?

2
Dustin Getz14:05:03

i mean define "work"

Dustin Getz14:05:10

it will resolve

braai engineer14:05:44

*amended by adding transact. Won’t the e/fn get cancelled mid-execution because data/conn has changed, triggering the e/watch?

braai engineer14:05:46

I am seeing some weird behaviour that I will have to get back to and try replicate. I have to deref data/conn in the button’s e/fn otherwise the db query seems to return empty, but I will have to verify what exactly is going on here.

Dustin Getz14:05:19

You're using datascript? The sample app has a working app

braai engineer14:05:13

I’m using both XTDB and DataScript (for semi-ephemeral things like user selections)