For the farmbot, the approach to recover from this bug is now as follows:
- Count the number of times we still see the same report after clicking on the button. When this happens three consecutive times, we assume that the report display is now broken and start the process to recover.
- Open a fresh instance of the report list.
- Open the first report, just as we do at the beginning of each farming cycle. From this state, we can continue the farming cycle reusing the existing implementation.
The approach outlined above was tested successfully, but the process can be further optimized. Instead of opening the first report as we do at the beginning of each farming cycle, we can scroll down the report list and open the last report we saw before starting the recovery process. This saves us the time to skip through the first reports which we had already looked at in the current cycle.
13:32:29.473  : Clicked on report 'Segundo pueblo de playername ataca (Pueblo bárbaro ) Ayer a 20:26:58'.
13:32:28.904  : scrollOperationsResults: ;;;;;;;;;;;;;;;;;;;;
13:32:23.571  : I start to scroll down....
13:32:23.571  : I start the process to open the report 'Segundo pueblo de playername ataca (Pueblo bárbaro ) Ayer a 20:26:58' which is at position 58 in the report list.
13:32:23.507  : Report item to continue with: 'Segundo pueblo de playername ataca (Pueblo bárbaro ) Ayer a 20:26:58'
13:32:23.465  : I parsed 100 report items.
13:32:11.909  : I parse the reports in there to find the best to continue with.
13:32:05.086  : I clicked the button to open the report list. Next, I set the page size to 100.
13:32:02.811  : I begin the process to restart the report UI and continue at report with time '20:26:58'.
13:32:02.811  : Hey, I have seen a report with the same caption before! This has happened 3 consecutive times. This could be caused by the the bug in the Tribal Wars 2 Web App which breaks reports display (https://forum.botengine.org/t/bug-in-tribal-wars-2-web-app-broken-report-display/1457). I start the process to recover from this bug.
13:32:02.811  : Caption of the current open report: 'Ayer a 20:26:58 - Segundo pueblo de playername ataca (Pueblo bárbaro )'
13:31:59.426  : I click on the button to navigate to the next report.