-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve lending error handling #8371
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mekarpeles
commented
Oct 5, 2023
mekarpeles
added
the
Priority: 1
Do this week, receiving emails, time sensitive, . [managed]
label
Oct 17, 2023
mekarpeles
commented
Oct 18, 2023
mekarpeles
commented
Oct 18, 2023
for more information, see https://pre-commit.ci
mekarpeles
changed the title
WIP improve lending error handling
Improve lending error handling
Oct 19, 2023
mekarpeles
added
the
On testing.openlibrary.org
This PR has been deployed to testing.openlibrary.org for testing
label
Oct 23, 2023
@bfalling and I were discussing what to do if lending fails for a title. We may want to redirect to the Open Library book page and show a toast message |
mekarpeles
added
the
Needs: Community Discussion
This issue is to be brought up in the next community call. [managed]
label
Oct 27, 2023
jimchamp
approved these changes
Nov 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Will add the toast messages in a separate branch.
jimchamp
removed
the
On testing.openlibrary.org
This PR has been deployed to testing.openlibrary.org for testing
label
Apr 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Needs: Community Discussion
This issue is to be brought up in the next community call. [managed]
Priority: 1
Do this week, receiving emails, time sensitive, . [managed]
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #8372. Loosely related to #3429, we think we're seeing an uptick of lending error exception cases perhaps related to system limit. We want to add more specific reporting (e.g. response
429
instead of generic400
or401
) so we know internally where these error cases are coming from and how to deal with them gracefully for patrons.EDIT: I think we may have converged on
409
HTTP Response: Conflict or429
.This PR likely depends on changes being made internally within petabox, perhaps near:
https://git.archive.org/ia/petabox/-/blob/master/www/common/Lending.inc#L111-114
Which also pertains to https://git.archive.org/ia/petabox/-/blob/master/www/common/Lending/BookLoanService.inc#L525-534 and https://git.archive.org/ia/petabox/-/blob/master/www/common/Lending/BookLoanService.inc#L570-586
Technical Notes
With this PR, when a 400 or 409 is encountered, we won't perform the borrow and will redirect the patron to archive.org (which isn't great -- they'll re-attempt to borrow and then see a indescript archive.org error -- but this is better than Open Library's stacktrace / generic see:
123871281.html
page)Stakeholders
@seabelis @judec @bfalling