Fork me on GitHub
#biff
<
2023-11-27
>
Lyn Headley04:11:21

I don't think submit-tx actually waits for transactions

(defn submit-tx [{:keys [biff.xtdb/retry biff.xtdb/node]
                  :or {retry true}
                  :as ctx} biff-tx]
  (if retry
    (submit-with-retries ctx #(biff-tx->xt % biff-tx))
    (xt/submit-tx node (-> (assoc-db ctx)
                           (assoc :biff/now (java.util.Date.))
                           (biff-tx->xt biff-tx)))))

Jacob O'Bryant04:11:30

it does by default--it won't if you set :biff.xtdb/retry to false (naming is hard πŸ™‚)

Jacob O'Bryant04:11:11

note that to see the result of a transaction you'll need to call xt/db to get a new db value

Lyn Headley04:11:41

ok, whoops. hmm. yes, that sounds like my actual issue.

πŸ‘Œ 1
πŸŽ… 1
Lyn Headley04:11:08

Biff also provides a higher-level wrapper over xtdb.api/submit-tx. It lets you specify document types from your schema. If the document you're trying to write doesn't match its respective schema, the transaction will fail. In addition, Biff will call xt/await-tx on the result, so you can read your writes.

Olav Fosse15:11:24

Does anyone here do end-to-end testing of their biff apps? I’m very interested to hear how you go about this πŸ€“

Jacob O'Bryant18:11:15

..."testing"? what's "testing"?

Olav Fosse19:11:07

it’s what comes after deploying πŸ˜›

πŸ˜„ 1
squirrel 1