getodk / javarosa

The core library that many of the ODK tools are built around. It's written in Java, implements the ODK XForms spec, and runs on mobile devices and cloud servers. ✨🏗✨
Other
54 stars 107 forks source link

Handle entities without IDs #763

Closed seadowg closed 5 months ago

seadowg commented 5 months ago

Work towards https://github.com/getodk/collect/issues/6109

What has been done to verify that this works as intended?

New tests.

Why is this the best possible solution? Were any other approaches considered?

The idea here is to still expose these entities, but make entity ID explicity null. Being more lenient here allows the UI (Collect) to make a decision about how it wants to deal with the problem. We could have altnernatively just hidden this happening, but that would restrict us from logging or even showing an error in the future.

The emerging philosophy here is that JavaRosa's Entity is more of a representation of the XML node than of the conceptiual "entity" itself. The versioning logic disagress with this, but we'll be changing that soon most likely (with discussions of runID etc).