I've observed some serious latency with some of our API calls, and several of our users seem to be reporting similar phenomena. We need to track this down and fix it right away.
Here are some observations and theories:
- This seems to be somewhat device-specific. It happens on my real device (Nexus 6P, API 26), but doesn't happen on my emulators, or my other real device (Galaxy S7, API 25).
- It seems to be specific to certain MediaWiki API calls, but not all of them. For example the API for searching (action=query&generator=prefixsearch) is affected, but others are not.
- The latency, when it happens, seems to be nearly precisely 5 seconds (or a bit greater than 5 seconds), which is suspicious. This suggests that there may be something on the client side that is deliberately blocking the request for 5 seconds, or something on the server side that is deliberately waiting 5 seconds before processing the request.