Closed wladimirleite closed 10 months ago
Thank you @tc-wleite for your time spent investigating this!
Just to avoid confusion, I used the #1866 branch to test (and take these screenshots), but this is not related to it. The user that reported the issue was using 4.1.4, and I was able to reproduce it using the master branch.
This was reported to me by a user from another location, so I didn't have the cases used here. It is a tricky issue, and took me quite a while to reproduce and find out the root cause.
Steps to reproduce the issue:
SaveStateThread.run()
made the issue easier to reproduce.Cause:
When generating a report from a multicase, the method IPEDReader.copyBookmarksToReport() is called multiple times. At the end of this method, there is a call to
reportState.saveState()
, that will save the state of the report case bookmarks file asynchronously, using aSaveStateThread
. The issue happens when saving is slower than the nextreportState.saveState()
. The bookmarks to be saved are inserted into aHashMap
(namedstateMap
), then they can be processed in a different order than they were originally added to the map.EDIT: As there are calls to
loadState()
when copying bookmarks to report, it seems that synchronoussaveState()
should be used here.