Skip to content

Conversation

@jimchamp
Copy link
Collaborator

@jimchamp jimchamp commented Jul 31, 2025

Closes #11085

Addresses bug which prevents lists from loading on author and orphaned edition pages.

Technical

The My Books Droppers that are rendered on author page sidebars are not associated with a work ID (the same is true for droppers on orphaned edition pages). The HTML for the check-in components is not rendered for these droppers, as check-ins require a work ID.

Whenever this.checkInComponents.initialize() was called by a dropper that didn't include the check-in HTML, it threw an exception that prevented the initMyBooksAffordances function from fetching the list data and updating the view.

Now, if there is no check-in HTML included with a dropper, we set this.checkInComponents to null and check for the object before calling initialize(). This null check is only needed here, as it is present in all other places where this.checkInComponents is referenced.

Testing

Screenshot

Stakeholders

@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.85%. Comparing base (e027195) to head (704289d).
⚠️ Report is 504 commits behind head on master.

Files with missing lines Patch % Lines
.../plugins/openlibrary/js/my-books/MyBooksDropper.js 0.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11086      +/-   ##
==========================================
+ Coverage   17.14%   17.85%   +0.70%     
==========================================
  Files          91       92       +1     
  Lines        4981     5097     +116     
  Branches      867      889      +22     
==========================================
+ Hits          854      910      +56     
- Misses       3588     3638      +50     
- Partials      539      549      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +93 to +95
if (this.checkInComponents) {
this.checkInComponents.initialize()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This might be a good place for the JS optional chaining operator:

Suggested change
if (this.checkInComponents) {
this.checkInComponents.initialize()
}
this.checkInComponents?.initialize()

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Tested on https://testing.openlibrary.org/authors/OL15003393A/Dayeon_Auh and works like a charm! Merge at your discretion.

@cdrini cdrini self-assigned this Jul 31, 2025
@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Aug 1, 2025
@cdrini cdrini merged commit e5e801e into internetarchive:master Aug 11, 2025
4 checks passed
@jimchamp jimchamp deleted the bug/author-page-lists-widget-fix branch September 19, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Response Issues which require feedback from lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lists on author pages do not load

3 participants