Closed emmajclegg closed 8 months ago
Thanks @praweshsth ! Could you let us know a little more about how this part of the system works, and what happened?
We were surprised by this because we expected the XML download in the Publisher UI to be the same as the XML that's listed in the Registry.
Hi @robredpath ,
On Dec 18, we merged the changes in branch: #1300. The changes were made in accordance with issue/discussion #1299 . A huge module of how xml's were generated for publishing had to be rewritten. This bug stems from those changes.
In its entirety the bug stems from a single line of code where transactions of activities are fetched using the code:
correct | current |
---|---|
$activity->transactions ?? [] |
$activity->transaction ?? [] |
Change $activity->transaction ?? []
to $activity->transactions ?? []
.
" We were surprised by this because we expected the XML download in the Publisher UI to be the same as the XML that's listed in the Registry." - robredpath
Heres a brief summary of how xmls are published or downloaded.
<publisherId>-<activityId>.xml
.The xml value of that activity is also maintained in a parent xml (merged xml) with the name: <publisherId>-activities.xml
.
<xml>
<iati-activities version="2.03" generated-datetime="timestamp">
<iati-activity>...valid activity xml...</iati-activity>
<iati-activity>...valid activity xml...</iati-activity>
</iati-activities>
Thanks for the information @PG-Momik and @praweshsth - let me know when the fix has been deployed and I'll check the affected publishers' transaction data.
Hi @emmajclegg , The bug fix has been deployed to stage and is ready to be deployed to production. Activities will now be published with their transaction.
To fix broken data with, we can do any of the following:
The script is currently being tested by our QA. Once its approved, it can be executed on production.
[!NOTE] Do note that the script will only affect
published
activities and will not affect activities inrepublish
state.
To clarify @PG-Momik - has the first part of this (the bug fix to ensure activities publish with transactions) been deployed to production? Are we now focusing on the second part (the script to retrospectively republish affected publishers' activities)?
The retrospective republishing script will be needed as us in IATI Support won't be aware of all of the affected publishers, only those that have contacted us. But if this is holding up deploying the main bug fix, please do that first (from my testing on staging last week, it looked like transactions were publishing as expected)
@emmajclegg the bug fixing has not yet been deployed in the production but we can deploy it. and then fix the activities of the organisations that were affected by the bug. We can do both of these today.
The bug has been deployed but we are working on the script to fix the existing xml files of already published activities. @emmajclegg
@emmajclegg , the script has been deployed and executed to production. Here's what the script does:
<iati-activity>
node in the merged xml that the registry points to.last-updated-datetime
attribute of <iati-activity>
node has not changed.Thank you @PG-Momik
This has been completed and deployed to main. But it was reopened to mention the inner-working of the script. cc: @praweshsth @emmajclegg @robredpath
Multiple IATI Publisher users have reported that all activity transactions are now missing from their published IATI activity file. The transactions appear saved and published in IATI Publisher, but are not visible in their activity file on the IATI Registry.
It looks like these users have published (or republished) their activity data using IATI Publisher recently, since the 31st January.
I have replicated this issue today on the IATI Publisher staging site with the following test account and activity:
This activity has 2 transactions showing as published within IATI Publisher, which are also present in the activity XLS download from Publisher. However, no transactions are visible in the XML file on the IATI Registry staging site.
(Screenshots from IATI Publisher:)