A job post’s applications, a page at a time
A hiring team’s review app reads one job post’s applications from a job board’s API, newest first, a page at a time: the first request gets page 1, and each page carries a token for the next. The board logs every session it opens, every page it serves and every close, and the cases read that log. Each level starts from the previous level’s finished code, so you can begin at any of them.
The job board’s API has started to fail now and then: a page request can come back with an error, and asking again usually works. The pull request under review makes Load more survive it: when a press hits a failed page, it starts the read again from the top, and if that fails too it shows what it has.
After a hiccup, reviewers see applicants they have already read appear again, and the first page is downloaded twice. When a page keeps failing, the screen shows an empty press as if the post had no more applications, and the team stops reviewing a post that still has some. The first view, which does not go through the screen, gets no retry at all.
Reproduce On a board of two one-name pages whose page 2 fails once, press Load more for 2: the screen shows Rosa, Rosa, and the log reads open, page 1, page 2 failed, close, open, page 1. newest(board, 3) on the same kind of board fails outright.
Acceptance criteria A page that fails once is asked for again from the same place: no application is shown twice, and no earlier page is fetched again. Every caller gets that retry, not only the screen: the first view survives a page that fails once. A page that fails twice is a failure, not the end of the list: the press shows what it got and the error, later presses show the error again and fetch nothing, and the session closes once. The earlier rules still hold: one session per screen, nothing fetched before the first press, and the session closed at the end. Notes A press that has an error prints it after its names: “(none) [error: page 2 unavailable]”. A failed newest prints “failed:” and the error. Show the board’s error message as it is. The board logs a failed request as “page N failed”. In the cases, a page fails once or every time. Retry a failed page at most once.