libyang icon indicating copy to clipboard operation
libyang copied to clipboard

lyd_diff_tree "escapes" to siblings

Open snar opened this issue 7 months ago • 1 comments

.. when called without flag LYD_DIFF_DEFAULTS on node having LYD_DEFAULT or when called on opaque node.

Root cause: nosiblings is checked only when node comparison completed but it not happens on opaque or LYD_DEFAULT nodes.

Workaround: modify application to not call lyd_diff_tree in such cases. But may be it makes sense to check nosiblings and break instead of continue there ?

snar avatar Jul 25 '25 14:07 snar

Changing this for opaque nodes may be okay. But for default nodes it would likely break many use-cases, one often does not even know that there are some default nodes (NP containers) so it could seem that no nodes were traversed at all.

michalvasko avatar Jul 28 '25 06:07 michalvasko