gotson / komga

Media server for comics/mangas/BDs/magazines/eBooks with API, OPDS and Kobo Sync support
https://komga.org
MIT License
3.91k stars 232 forks source link

[Bug] Clicking to open the next volume opens the next volume at the last page #689

Closed kanjieater closed 3 years ago

kanjieater commented 3 years ago

Komga environment

Describe the bug

Clicking to open the next volume opens the next volume at the last page.

Steps to reproduce

  1. Click through to the end of a volume
  2. Click once on the last page to get the popup about clicking again to go to the next book
  3. Click to get to the next book
  4. It opens the last page If the book ahead of it has been opened before it won't do it. Not sure if it's related to right -> left reading mode, which i do have set for all books

Expected behavior

Opening the next volume doesn't jump to the last page, it should open the first page of the next volume.

Actual behavior

Clicking to open the next volume opened the last page of the 2nd volume. Spoilers! T_T

Additional context

N/A

Screenshots

N/A

Log file

If applicable, add an excerpt of the log file (max 20 lines) AND attach the complete log file or a link to a gist/pastebin containing the log file (where to find the logs).

gotson commented 3 years ago

Can you attach a video showing the problem, from the series page?

4. Not sure if it's related to right -> left reading mode, which i do have set for all books

Can you try and confirm behavior?

gotson commented 3 years ago

Please update the issue description too.

kanjieater commented 3 years ago

I am having difficulty preproducing it consistently. But I have had it happen multiple times.

bmfrosty commented 3 years ago

I'm seeing the same issue. I identified it while using Komga under unraid which is acting as a docker orchestrator. I don't know who's template I used, nor whether that matters. The gui shows that I'm running v0.128.1-master. I downloaded the files from the-eye - specifically something involving a man that was bitten by a spider, ultimately.

I had a theory for a bit that it starts happening in a session after opening cbz files or certain cbr files, but I don't know if that's correct. I also suspected that once I opened one file that triggered the behaviour it would happen in every file I opened after that. I don't know if any of that is correct.

kanjieater commented 3 years ago

Alright, I managed to capture how inconsistent it is too. https://imgur.com/a/REF7Jm4

It seems to have to do with page numbers. Notice in the gif, that if a book has MORE pages than the next book, it won't carry it over, if it has LESS it puts it near the end. Just try going through a book with more pages to less pages and you should be able to reproduce it.

Also the gif transitions from the Series start page as requested really quickly, like a 1 frame. But this is the state before I start clicking through to the next book, all 4 of these were unread - you can see this if you pause at the beginning like i did: image

gotson commented 3 years ago

I can't reproduce on my end. There is zero logging in the front-end at the moment, and that makes it impossible to troubleshoot javascript logic.

I am looking at some libraries to add logging in the front-end, so i could get useful logs from end-users when such problem arise, and be able to troubleshoot.

gotson commented 3 years ago

I have added basic logging in the webui for the web reader, around the places where i think the problem could be located.

Could you try to install v0.128.2? Then to enable the logs you will need to do the following:

Try to reproduce the problem with those logs enabled, and send me the logs alongside the book ID of the problematic book, so i can see what happened and when in the logs.

kanjieater commented 3 years ago

Here you go: localhost-1632168926462.log

I have added basic logging in the webui for the web reader, around the places where i think the problem could be located.

Could you try to install v0.128.2? Then to enable the logs you will need to do the following:

  • in the browser's developer console, type localStorage.setItem('loglevel','DEBUG');
  • reload the page (F5)
  • open a book for reading, you should see some output in the developer's console
  • to save the logs, in Chrome you can right click in the console and Save as... to save to a file

Try to reproduce the problem with those logs enabled, and send me the logs alongside the book ID of the problematic book, so i can see what happened and when in the logs.

I was trying to read book 065MZ2BE9MNWP. Went to it's last page, 191. CLicked the next button. and it opened 065MZ2BE9MNWQ at page 193, despite being unread.

gotson commented 3 years ago

I might need more logs, because:

BookReader.vue:632 setup bookId:065MZ2BE9MNWQ, page:NaN
BookReader.vue:657 pages count: 193
BookReader.vue:658 read progress: null
BookReader.vue:739 goTo: 1 <===== this here

Clearly says it's opening page 1.

Let me skim through the code, see where i can slap more log statements. I'm quite happy we have some way to get logs on the front-end now 😄

gotson commented 3 years ago

more logs will be available in 0.128.3 if you can give it a try (when it's out)

Daedren commented 3 years ago

Here's my 0.128.3 logs. I refreshed the page on 06AXYCPPK8R7C's last pages in Double Pages (no cover) mode, then went ahead to the next book (06AXYCPPK8R7D), which put me on page 19-20 of 21 total

daedren-20210922.log

I believe it's related to the book in this case having a double-spread (Not at the end, it was page 17 of 21) and me being on Double Pages (no cover) mode. It happens to me consistently. I can provide one of these offending books if needed.

gotson commented 3 years ago

@Daedren would you be able to send me the 2 books via Discord PM, so i can try to reproduce the situation?

gotson commented 3 years ago

I think i know what's happening:

Now i need to think of how to fix it 😅

gotson commented 3 years ago

@Daedren no need to send me the books, I managed to reproduce on my end.

gotson commented 3 years ago

closed in 13760c5ef3117749966e90db9612674f5ab68b33