Repository navigation
Commit 765bf30
committed
make value-tempid check eid-based like cljs
cljs check-value-tempids keys ::value-tempids by the eid each v-position
tempid resolves to and clears it when that eid appears as :e of an added
datom or in ::tx-redundant (redundant adds and unique-identity upserts).
The previous OCaml check was syntactic: only bare Temp_id/Entity_id<0
e-forms counted as entity usage, so a v-tempid whose entity materialized
through an upsert, redundant add, entity map, lookup-ref, or rebase
replay raised 'Tempids used only as value' where cljs clears it.
- record v-position tempids by resolved eid during ref-attr value
resolution (tempid -> eid), same channel cljs uses
- clear on added datoms in final tx_data plus a materialized-eid table
covering cljs ::tx-redundant: redundant adds (datom_tx_data = []),
unique-identity upsert hits, tempid-entity merges, raw-datom replays
- keep the raise for genuinely orphaned v-tempids; clear both tables on
fast-path fallback to apply_ops
- regression tests: upsert-redundant clearing, lookup-ref e-form
clearing, entity-map materialization clearing, unmaterialized raise1 parent 030032f commit 765bf30
3 files changed
Lines changed: 262 additions & 157 deletions
0 commit comments