Hey, it's all working great so far: commits, edits, diffs. Thanks again for writing this! ❤️
New question
I've been using this technique – when I'm creating an entity on the client – I give it a negative int id, which is then recognised on the server as a client id. Server persists entity, generates permanent positive int id and dispatches an update.
This allows to have all ids as integers.
If I commit this to doxa [:dx/put {:db/id -1, :m/gist ""}]
I get this error
[core.cljc:180 2021-05-20T19:30:28.372Z ERROR [ribelo.doxa:334] - invalid commit [:dx/put {:db/id -1, :m/gist ""}]
Which may be caused by timbre's limitations.
I'm fine without negative ids.
If you want to support this – I can supply a failing test case and maybe help more.
Hey, it's all working great so far: commits, edits, diffs. Thanks again for writing this! ❤️
New question I've been using this technique – when I'm creating an entity on the client – I give it a negative int id, which is then recognised on the server as a client id. Server persists entity, generates permanent positive int id and dispatches an update. This allows to have all ids as integers.
If I commit this to doxa
[:dx/put {:db/id -1, :m/gist ""}]
I get this error[core.cljc:180 2021-05-20T19:30:28.372Z ERROR [ribelo.doxa:334] - invalid commit [:dx/put {:db/id -1, :m/gist ""}]
Which may be caused by timbre's limitations. I'm fine without negative ids.
If you want to support this – I can supply a failing test case and maybe help more.
Full trace
Source: (just replace the
new-id
with-1
) https://github.com/spacegangster/rf-doxa-etude/blob/main/src/rf_doxa/events.cljs#L66