Skip to content

Fix a race condition when initializing the EPUB navigator #622

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

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

mickael-menu
Copy link
Member

Fixed

Navigator

  • Fixed a race condition causing EPUB decorations to be applied twice when opening a publication.

If the application called applyDecorations() when a web view is loaded but its resource not yet loaded, it caused the decorations to be applied twice. You can reproduce this by opening several times a publication with a highlight, until you see that the color is darker (two identical decorations on top of each other). I fixed it by only applying the decorations in fully loaded resources.

I also reapply the Readium CSS properties when the web view is loaded, in case they changed since their first static injection in the HTML document.

@mickael-menu mickael-menu requested a review from qnga February 28, 2025 17:50
Copy link
Member

@qnga qnga left a comment

Choose a reason for hiding this comment

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

Sounds good

@mickael-menu mickael-menu merged commit 85c0f7c into main Mar 7, 2025
3 checks passed
@mickael-menu mickael-menu deleted the fix/decorations-race-condition branch March 7, 2025 15:34
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.

2 participants