I have 5 (titled 1 through 5) watched pages and I'm querying them on the Watchlist page (mobile). The first two pages are already shown on page load. I'm trying to get the next 2 pages with this query:
http://127.0.0.1:8080/w/api.php?action=query&prop=pageimages%7Cinfo&piprop=thumbnail&pithumbsize=80&format=json&generator=watchlistraw&gwrnamespace=0&gwrlimit=3&continue=&gwrfromtitle=2
Which returns
{"continue":{"picontinue":5,"continue":"||info"},"query":{"pages":{"4":{"pageid":4,"ns":0,"title":"2","contentmodel":"wikitext","pagelanguage":"en","touched":"2015-08-06T21:21:25Z","lastrevid":10,"length":13},"5":{"pageid":5,"ns":0,"title":"3","contentmodel":"wikitext","pagelanguage":"en","touched":"2015-08-06T18:53:22Z","lastrevid":6,"length":1,"new":""},"6":{"pageid":6,"ns":0,"title":"4","contentmodel":"wikitext","pagelanguage":"en","touched":"2015-08-06T18:53:32Z","lastrevid":7,"length":6,"new":""}}}}
Using the continue info from the above response throws the following error message:
{"error":{"code":"pi_badcontinue","info":"Invalid continue param. You should pass the original value returned by the previous query","*":"See http://127.0.0.1:8080/w/api.php for API usage"}}
So rather than using the continue parameters from above, I'm querying the next 2 pages with this url:
http://127.0.0.1:8080/w/api.php?action=query&prop=pageimages%7Cinfo&piprop=thumbnail&pithumbsize=80&format=json&generator=watchlistraw&gwrnamespace=0&gwrlimit=2&continue=&gwrfromtitle=4
(I know that the last title the API returned is 4.)
The response I get is this:
{"continue":{"picontinue":7,"continue":"||info"},"query":{"pages":{"6":{"pageid":6,"ns":0,"title":"4","contentmodel":"wikitext","pagelanguage":"en","touched":"2015-08-06T18:53:32Z","lastrevid":7,"length":6,"new":""},"7":{"pageid":7,"ns":0,"title":"5","contentmodel":"wikitext","pagelanguage":"en","touched":"2015-08-06T18:53:44Z","lastrevid":8,"length":6,"new":""}}}}
Notices still that the continue parameters are set even though the page 5 is the last page in my watchlist. This is the bug I think.
Just to see what I get next, I ping the following URL:
http://127.0.0.1:8080/w/api.php?action=query&prop=pageimages%7Cinfo&piprop=thumbnail&pithumbsize=80&format=json&generator=watchlistraw&gwrnamespace=0&gwrlimit=2&continue=&gwrfromtitle=5
Now the continue parameter is gone and I get only 1 result (which is correct because there are no more pages after page 5).
To sum it up, the continue parameter must be empty in the previous response (not the last response).