What is the problem?
Sometimes when loading Special:Contributions, the IPInfo infobox does not load correctly. See below screen capture.
You notice that the infobox, although expanded, does not appear. Then, when I collapse the infobox it adds the IPInfo to the DOM (but it is hidden). It also sends an API request to API:Options saving the state of the infobox as expanded (i.e. {"change": "ipinfo-infobox-expanded=1"}).
I have also seen a similar thing happen when the saved state of the infobox is collapsed. After the page loads, when I expand the infobox it does not load the info.
So far, this happens for me more often on a slow internet connection (you can simulate this in Firefox and Chrome devtools). For example, the above screen capture was done on Firefox simulating a "Regular 3G" connection.
It can also happen when you refresh the page twice in quick succession.
It might be because changes in the initialisation logic made here have made it more vulnerable to race-conditions and to the wrong logic being followed. I tried to reproduce this bug before that patch, but was unsuccessful.
Steps to reproduce problem
- Login as a user with IPInfo rights (and set all their preferences etc.)
- Go to Special:Contributions page of an IP
- Expand the IPInfo infobox
- Keep refreshing the page until the infobox does not load (it might help to artificially throttle your connection, as I mentioned above)
Expected behavior: IPInfo infobox shows every time
Observed behavior: IPInfo infobox sometimes fails to load
Environment
Browser: Firefox 91, Chromium 87
Wiki(s): local docker IP Info 0.0.0 (fe1ba73) 07:15, 21 February 2022.