automerge/rust/automerge
alexjg 9b44a75f69
fix: don't panic when generating parents for hidden objects (#500)
Problem: the `OpSet::export_key` method uses `query::ElemIdPos` to
determine the index of sequence elements when exporting a key. This
query returned `None` for invisible elements. The `Parents` iterator
which is used to generate paths to objects in patches in
`automerge-wasm` used `export_key`. The end result is that applying a
remote change which deletes an object in a sequence would panic as it
tries to generate a path for an invisible object.

Solution: modify `query::ElemIdPos` to include invisible objects. This
does mean that the path generated will refer to the previous visible
object in the sequence as it's index, but this is probably fine as for
an invisible object the path shouldn't be used anyway.

While we're here also change the return value of `OpSet::export_key` to
an `Option` and make `query::Index::ops` private as obeisance to the
Lady of the Golden Blade.
2023-01-19 21:11:36 +00:00
..
benches Move rust workspace into ./rust 2022-10-16 19:55:51 +01:00
examples Text v2. JS Api now uses text by default (#462) 2022-12-09 23:48:07 +00:00
src fix: don't panic when generating parents for hidden objects (#500) 2023-01-19 21:11:36 +00:00
tests wasm: Allow a choice of text representations 2023-01-10 12:52:19 +00:00
.gitignore Move rust workspace into ./rust 2022-10-16 19:55:51 +01:00
Cargo.toml automerge-cli: remove a bunch of bad dependencies (#478) 2022-12-14 18:06:19 +00:00