Convex-Dev / convex.cljc

Any aspect of the Convex stack, from Clojure
Apache License 2.0
53 stars 7 forks source link

Lookup address symbol in query mode gives wrong error #10

Closed claj closed 1 year ago

claj commented 1 year ago

Setup: One account, #6685 has run the transactional expression

(def x "Joe")

Another account, #6686, runs - in QUERY mode:

(lookup #6685 'x)

Error (COMPILE)
COMPILE: lookup requires a Symbol as last argument
Trace
Compiling:(lookup #6685 (quote x))

When running in transaction mode the right value ("Joe") is returned.

It is confusing that the error message complains about a well formed expression but in the wrong "execution mode".

mikera commented 1 year ago

Thanks for the report - is this on the Sandbox? It might be a Sandbox parsing issue.

The lookup form should be something like:

(lookup *address* x) ;; note the symbol does not need to be quoted

From my quick tests, this works in both Query and Transaction mode.

claj commented 1 year ago

Yes, now it worked for me as well. Sorry!

mikera commented 1 year ago

Awesome, glad problem solved!