Closed domkm closed 2 months ago
I discovered that EPUBNavigatorViewController
was being initialized twice. Resolving this seems to have fixed the issue, though I still don't understand how that caused this issue. Perhaps there is some global state which can break when two EPUBNavigatorViewController
s coexist? Anyway, I'll close this issue. Sorry for the noise.
There are no shared global state between two instances of EPUBNavigatorViewController
, AFAIK. And I already displayed two EPUBs side-by-side.
Could it be that you were doing the go()
calls on the instance that was not visible?
Describe the bug
I'm experiencing an interesting issue with
EPUBNavigatorViewController
and would appreciate help in diagnosing and potentially fixing it. I've tried reproducing it in a minimal codebase but, so far, have been unable to, so I'll describe what I'm experiencing and hope that may be enough.Sometimes,
EPUBNavigatorViewController
works exactly as I would expect. The book loads, I can swipe between pages, and I can usego(to: Locator)
to navigate elsewhere in the book.However, more often than not, the book loads, I can swipe between pages, but I can not use
go(to: Locator)
, which always returnsfalse
. When the view loads, I observe the following state changes:on(load(nil))
loading(pendingLocator: nil)
toloading(pendingLocator: nil)
on(loaded)
loading(pendingLocator: nil)
toidle
After that, I run
go(to: Locator)
and observe that:state
isloading(pendingLocator: nil)
instead ofidle
(I have no idea how this can happen without triggering thedidSet
onstate
)spreads
is emptyneedsReloadSpreads
isfalse
This causes the navigator to be stuck thinking it's loading and unable to
go
, yet rendering correctly and able to manually swipe between pages.Do you have any idea what might be causing this or any tips that may help me figure it out? Thank you.
How to reproduce?
I have been unable to reproduce it outside of my codebase.
Readium version
2.7.0
OS version
iOS 17.4, macOS (iPad version) 14.4
Testing device
iPhone 15 Pro Max (simular), MacBook Pro
Environment
Additional context
No response