Skip to content
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

Fix goodreads custom shelf bug #8306

Conversation

akhil-rasheed
Copy link
Contributor

Closes #8158

Fixes the bug wherein an unchecked or custom shelved book causes the entire import to fail

Technical

Replaced 'return false' in the unchecked or custom shelf condition with a 'return'. This statement was causing the code to break out of the loop entirely when the condition was encountered

Testing

  1. Go to ... import options.
  2. Do ... try to import Goodreads data containing a custom exclusive shelf, or an unchecked book
    The bug should be fixed, and the import completes with error messages

Screenshot

Screenshot from 2023-09-19 15-03-38

Stakeholders

@jimchamp

@codecov-commenter
Copy link

Codecov Report

Merging #8306 (3a0856c) into master (586466c) will decrease coverage by 0.01%.
Report is 40 commits behind head on master.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #8306      +/-   ##
==========================================
- Coverage   16.99%   16.99%   -0.01%     
==========================================
  Files          75       75              
  Lines        3942     3943       +1     
  Branches      674      674              
==========================================
  Hits          670      670              
- Misses       2842     2843       +1     
  Partials      430      430              
Files Coverage Δ
...library/plugins/openlibrary/js/goodreads_import.js 0.00% <0.00%> (ø)

Copy link
Collaborator

@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @akhil-rasheed! This seems to be working as expected.

@jimchamp jimchamp merged commit eacde86 into internetarchive:master Sep 27, 2023
2 checks passed
@jimchamp
Copy link
Collaborator

While reviewing this, I noticed that all best-fit ISBN to OLID matching is happening via client-side calls. If we do these checks server-side, before page load, we can likely avoid having any client-side code for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Goodreads import fails if data contains a custom shelf
3 participants