When navigating from the end of one chapter to the beginning of another chapter, the url is not updated until after the api request has been completed. If there is a failure, such as the database not being able to handle your request at the moment, you are taken to the error page. Your url is not updated at this point though. The normal user action here is to reload the page until the request goes through. This, however, will take you back to the end of the chapter that you have just read. Eventually, this will load, but the next user action will be to click on the next page that will then send off another api request for the next chapter. Again, this will end up in the same loop of waiting for this page to load, which may fail and send the user back to requesting the previous chapter, when all they want to do is access the next chapter.
I propose instead, just before the request for the next chapter is made, to update the url to point to the new chapter, so that in the chance that the error page is hit, a reload of the page will result in the requested chapter being loaded instead of the previous one. This could remove a number of useless requests, hitting the api for a chapter that the user has already seen.
I propose instead, just before the request for the next chapter is made, to update the url to point to the new chapter, so that in the chance that the error page is hit, a reload of the page will result in the requested chapter being loaded instead of the previous one. This could remove a number of useless requests, hitting the api for a chapter that the user has already seen.