IATI / D-Portal

http://d-portal.org/
Other
30 stars 23 forks source link

XML Export changes the order of Transactions when 2 Transactions are almost the same but not quite #652

Closed odscjames closed 11 months ago

odscjames commented 11 months ago

Brief Description http://d-portal.org/ctrack.html#view=act&aid=XI-IATI-EC_ECHO-ECHO%2F-AF%2FBUD%2F2018%2F92048 Lists 9 transactions, the correct amount.

The source for that file is https://webgate.ec.europa.eu/edris/api/iatiFiles/ec-echo-2018.xml

If you look at http://d-portal.org/q.xml?aid=XI-IATI-EC_ECHO-ECHO/-AF/BUD/2018/92048 it has 9 transactions

BUT they are in the wrong order.

There are 2 items for 300,000 - in the original file they are next to each other, but in the D-Portal export one of them has moved to the bottom.

I assume persistent problem, but only checked this morning.

Severity Low?

Maybe this doesn't matter but it might point to other oddities when processing transactions?

Misc

Found when working on https://github.com/IATI/refresher/issues/266

xriss commented 11 months ago

As designed?

I know there has been a lot of, "the datastore must recreate xml files exactly" talk over the years, but dportal is not the datastore and I don't think the datastore even manages this.

Dportal does much more to the xml than just move the transactions around.

Mostly we are stabilizing the order of everything for sanity, an obvious benefit of this is that simple text diffs or human eyes, can easily spot changes over time without any hiccups caused by a publisher rearranging the xml without changing the data.

odscjames commented 11 months ago

"the datastore must recreate xml files exactly"

Oh, I wasn't even thinking of that, was just double checking as I was working on related. If you're happy it's fine.