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

Rendering bug due to unfulfilled promise #100

Open
bluefirepatrick opened this issue Jan 13, 2025 · 8 comments
Open

Rendering bug due to unfulfilled promise #100

bluefirepatrick opened this issue Jan 13, 2025 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@bluefirepatrick
Copy link
Member

bluefirepatrick commented Jan 13, 2025

There is a bug in ts-toolkit where the book content will not render after navigation. It is reproducible both in testapp/vanilla and the playground app on both Safari and Chrome on MacOS Sequoia.

Steps to reproduce:

  1. Clone the readiumCSS-v2 branch of ts-toolkit.
  2. Build all projects and run the vanilla testapp.
  3. Load the Moby Dick test book from go-toolkit develop branch into the test app.
  4. Use the TOC control to choose Chapter 4.
  5. Use the left arrow UI button to advance the pages backward until you are on any page in Chapter 2.
  6. Use the TOC control to choose Chapter 4 again.

The book text will disappear. This is caused by line 143 in FramePoolManager never resolving:
await progressPromise; // Wait on the job to finish...

This causes the chain of promises kicked off by EpubNavigator.go to all fail resulting in a blank page. It also causes the frame for chapter 4 to be in a 'waiting' state so that it can never be loaded in the future.

@chocolatkey chocolatkey added the bug Something isn't working label Jan 14, 2025
@chocolatkey chocolatkey self-assigned this Jan 14, 2025
@chocolatkey
Copy link
Member

@bluefirepatrick Thanks for reporting, I'm able to reproduce this and have started looking into it

@chocolatkey
Copy link
Member

@bluefirepatrick Due to the importance of the bug and the relatively obvious fix, I went ahead and committed the fix and pushed a new version of the NPM package for @readium/navigator - 1.3.4. The culprit is this line eb61441#diff-a38ace15e75f4767793e027579d1055b9e9303b376e893673126a9b03f7bd755R71

Please confirm the fix

@bluefirepatrick
Copy link
Member Author

@chocolatkey thanks. I am now seeing a different issues where the book pages are initially blank.

Steps to reproduce:

  1. Clone the develop branch of ts-toolkit.
  2. Build all projects and run the vanilla testapp.
  3. Load the Moby Dick test book from go-toolkit develop branch into the test app.
  4. The cover page of Moby Dick shows top blank.
  5. Use the right arrow UI button to advance the pages until Chapter 1.
  6. The book pages now show up.
  7. Book navigation now works normally including the Chapter 4 test from above.

So I think that you solved the issue I first reported but there seems to be an initialization issue that is new.

@chocolatkey
Copy link
Member

@bluefirepatrick I am not having this issue:
Image

If you could make a screen recording, or provide more details, that would be useful

@bluefirepatrick
Copy link
Member Author

The problem seems to be with the very first time you run the app with pnpm run dev. I have seen two behaviors:
1 . The cover is blank and if you use the left right page arrow buttons the pages before Chapter 1 may also not show up.
2. The book cover shows up but if you choose Chapter 4 from the TOC it is blank.

I am running go-toolkit develop branch so the manifest of Moby Dick is at
http://localhost:15080/bW9ieS1kaWNrLmVwdWI/manifest.json

For ts-toolkit, I just do a fresh clone of readiumCSS-v2, build the projects and run the vanilla reader with pnpm run dev.

Here is a screen cap of the behavior.
https://bluefireproductions.box.com/s/aqhxyg21xkjh7eq292adq7xovc6hdtz8

@bluefirepatrick
Copy link
Member Author

UPDATE: Unlike the original issue this new issue seems to be confined to Safari on MacOS. It does not happen on Firefox or Chrome for MacOS. But on Safari it is always reproducible and happens quite often.

@bluefirepatrick
Copy link
Member Author

UPDATE2: resizing the window in Safari fixes the issue. Hopefully that may help to shed some light on things.

I will log this as a new issue as it may not be related to the promise resolution issue that was addressed.

Steps to repeat:

  1. On Safari 18.2 (latest) for macOS Sequoia 15.2 (latest)
  2. Clone and run develop branch of go-toolkit.
  3. Clone and build develop branch of ts-toolkit
  4. Change line 25 of testapp/vanilla main.ts to publicationURL = "http://localhost:15080/bW9ieS1kaWNrLmVwdWI/manifest.json" so that reader loads Moby Dick from go-tookit.
  5. Open the reader via http://localhost:5174
  6. The first page of the book will not show up (and paging forward will show blank pages for the next four pages).
  7. Reload the reader. First page does not show up still but resize the browser window.
  8. The first page of the book shows up and subsequent pages also show up.

@chocolatkey
Copy link
Member

@bluefirepatrick Can I close this issue now that you've opened the other one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants