Steps to Reproduce
- Set up an account with 22 reading lists
- Perform a get request (https://en.wikipedia.org/api/rest_v1/data/lists/)
Expected results: the response includes the "next" parameter that can be piped into the next request as documented here https://en.wikipedia.org/api/rest_v1/#/Reading%20lists/get_data_lists_
Actual results: the response does not include the "next" parameter and does not include all reading lists (the default reading list is missing and the count is not right)
Affects all GET endpoints, not just lists.
Analysis
rMWd9f688698ce0: rdbms: clean up and refactor ResultWrapper classes (deployed with wmf/1.34.0-wmf.8, so between June 4-6) changed a detail of how MediaWiki iterates DB results (when iterated in a foreach loop, indexes changed from 1-based to 0-based), which broke the check in the ReadingLists extension detecting whether there are more results available (when 10 results are requested, the extension would fetch 11 and check if the 11th exists). Since extension CI tests are only run when the extension code changes, not when core code changes, this was only caught the next time extension code was changed (T226640: ReadingLists CI broken). The error was fixed in rERLS151625b93bc9: Fix API continuation and that was deployed on July 3.
Impact
Applications which have updated their local copy of the lists based on one of the erroneous responses have incorrect local copies (partial or outdated, depending on whether the bug affected them during a fetch or a sync) and their local copies will have to be invalidated.
Conclusions
- Tests should be run periodically, not just on patch upload - T93414: Regularly run mwext-{name}-testextension-* jobs to make sure they are still passing after core or dependency changes
- The same core change can affect other code and should be reverted or announced as a breaking change. (Note if it gets reverted, ReadingLists code needs to be updated again.) - T227665: Announce or revert ResultWrapper iteration change
- There should probably be an impact evaluation and notification of known clients when an API bug is found. Android only learned by accident that this bug existed.