Comments (7)
Hi!
Thanks for pointing out this!
I've looked into this bug and the problem is in your commit request.
If you reset currPageNumber to 1 only when the saved value of currPageToLoad is 0 (which in my calculation was impossible even before your contribution)... well, the chance you are resetting the variable to 1 are equal to 0 :P
I'm fixing this with the bug pointed out in the issue #36.
from baker.
Fixed with the commit b8a6d2e
As for issue #36 I'll wait for a positive feedback on the fix before closing this up.
from baker.
Well, this is different than issues #37/#38. Reproducing the problem with page 0 is probably impossible with unmodified sources (barring any bugs).
This issue however is 100% reproducible, see the steps I outlined above.
from baker.
Uhm, I saw you reverted the change that protects against currPageToLoad=0.
As I said, I agree it should never happen, but you shouldn't assume it never will.
Imagine the app was just started but we lose focus immediately (for instance, an SMS comes in) before we have even completed -initBook:
In that case, rootViewController.currentPageNumber will still be nil (it's not set in RootViewController:-init) so -saveLastPageReference will probably save lastPageViewed=0.
In that case, reading it back will get a 0 here.
Actually, in my commit I meant to protect again this particular scenario in -saveLastPageReference, but I botched it:
if (lastPageViewed != 0) {
That's just plain wrong, sorry about that :( It should probably be:
if (rootViewController.currentPageNumber > 0) {
Anyway, the bottom line is, you should never trust that something will never happen; a bug in other parts of code may lead to this invariant not being true, and that will positively crash the app. I think you'll agree that's not nice :)
from baker.
I completely agree with you, even if it shouldn't be possible it's better to reduce any chance of the app crashing down, and in fact I didn't revert your change on lastPageView value check before saving it :)
However, as you have said here, the check as it is need a quick fix, I'll apply that as soon as I finish writing this, thanks for pointing it out.
Back to the topic of this issue, I try the step to reproduce the bug (link on page 5 a .hpub with only 3 pages) and it seems that everything works pretty well with the last commit. Could you please confirm that?
from baker.
Works for me, too. Thanks for looking at this :)
from baker.
Thank you for your precious support on the project :D
I'm closing this up.
from baker.
Related Issues (20)
- File may not be a valid hpub archive. HOT 1
- Weird parsing error in xcode project. HOT 1
- Issues not showing on newsstand HOT 1
- Termintated due to memory error HOT 1
- Copy and paste in the magazine HOT 2
- Display only downloaded magazine on baker shelf HOT 2
- Error on AppleStore HOT 1
- Working with big pdf's HOT 1
- Auto renewable subscription fail in ITC HOT 1
- Baker 4.3 padding on Cells HOT 1
- Attempting to badge the application icon but haven't received permission from the user to badge the application HOT 1
- Baker Standalone App and In-App Purchase HOT 8
- Adding a button to the shelf HOT 1
- ★ THE PROJECT HAS MOVED → BakerFramework/baker
- Issues with HTML images on Baker framework on iPad HOT 1
- Scrolling model: Vertical (view article content) Horizontal (change article) HOT 1
- Side panel links do not react on iPad HOT 2
- hi, would you mind i translate what you say to chinese? HOT 1
- Migrating from InDesign to Baker Framework HOT 2
- free subsciptions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baker.