Commit b8bdd93
authored
Fix PUT/DELETE submodel-element-by-id-short-path not persisting changes (#80)
* Fix PUT/DELETE submodel-element-by-id-short-path not persisting changes
put_submodel_submodel_elements_id_short_path and
delete_submodel_submodel_elements_id_short_path each fetched the submodel
twice: once (indirectly) to locate/mutate the target element, and again
to pass to object_store.commit(). For object stores that deserialize a
fresh object graph on every get (e.g. Neo4jObjectStore), these are two
distinct instances, so the mutation made on the first instance was never
part of the object passed to commit() and the change was silently lost.
Fetch the submodel once, navigate to the nested element within that same
instance, mutate it, and commit that same submodel instance.1 parent 9da157c commit b8bdd93
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
833 | | - | |
| 833 | + | |
| 834 | + | |
834 | 835 | | |
835 | 836 | | |
836 | 837 | | |
837 | 838 | | |
838 | 839 | | |
839 | 840 | | |
840 | | - | |
| 841 | + | |
841 | 842 | | |
842 | 843 | | |
843 | 844 | | |
844 | 845 | | |
845 | 846 | | |
846 | | - | |
| 847 | + | |
| 848 | + | |
847 | 849 | | |
848 | 850 | | |
849 | | - | |
| 851 | + | |
850 | 852 | | |
851 | 853 | | |
852 | 854 | | |
| |||
0 commit comments