Recently due to performance issues, there was a change on the observations API pagination. Instead of using the pages pagination it uses cursor pagination.
The next page link, to move to the next page of results is available in the standard response header Link
, so a program that uses the API, should use this way to navigate through the pages.
In this part of the code we can see that satnogs-monitor doesn’t use the Link
header but iterates infinitely the page
parameter, in other words to move on the next page it adds in the url this parameter ?page=x
where x is replaced each time with a page number. Unfortunately this way doesn’t work any more.
The way it is implemented uses two ways to break the infinite loop, the one is by getting a page with less than 25 results, which would mean that this is the last page. The other is by getting a 404 error, that the page doesn’t exist. With the current status, the ?page=x
parameter is ignored with any value for x
and returns always the first page. This means that it will never hit 404 error and if the station has more than 25 past observations, it will never hit the less than 25 results break. So it looks like it remains in the infinite loop and this is why you don’t see any results.
Unfortunately I’m not very fluent in Rust language so I can not propose a solution and from the comment in the code:
// We cannot use the response headers to know if there is next page with more
// results. So we iterate over every page and stop if we receive an HttpError 404.
I’m not sure how easy would be a code change to use the response headers and especially the Link
header that will allow navigation through the pages.
@wose maybe can take a look on it.
PS above is my guess of what looks like to be the issue, maybe there is another issue that I haven’t spotted