https://bugs.kde.org/show_bug.cgi?id=411797

            Bug ID: 411797
           Summary: Comic plasmoid cache behavior somewhat buggy
           Product: kdeplasma-addons
           Version: 5.16.4
          Platform: openSUSE RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Comic Applet
          Assignee: notm...@gmail.com
          Reporter: h...@urpla.net
  Target Milestone: ---

Created attachment 122580
  --> https://bugs.kde.org/attachment.cgi?id=122580&action=edit
Simple shell tool for comic strip management and development

This is a strange one, because it occurs only after a new comic strip is
published from the source.

The new strip is displayed, when tabbing to it, prev is active, as expected,
next is inactive, as expected. When hitting prev, the former strip is
displayed, but next is still inactive (not expected), therefor one cannot
change back to the current strip with prev and next buttons. One gets back to
the current strip, if changing comic sources back and forth. One can jump to
the current strip with the "Jump to" context menu option.

It smells like some synchronization problem between in memory and on disk
presentation of the strip.

STEPS TO REPRODUCE
1. Load Perscheid and another comic source, eg. Dilbert (that is working still)
2. Perscheid releases a new strip once every weekday, wait for the next strip
3. Switch sources, observe prev/next button behavior

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: oepnSUSE Tumbleweed 20190907
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.61.0
Qt Version: 5.13.0

Some notes:
I've attached a tool plasma-comic-tool.sh, that helps with comic source
development. When you load my Perscheid source, it should display the current
strip. Since Perscheid doesn't provide a name, I've assigned the strip number
to the additionalText attribute, displayed on hovering the strip. At the time
of this writing, it's 4023, and the system is running for a day. When it
started, 4022 was current. After clearing the strip cache with
"plasma-comic-tool.sh -s perscheid clean" and switching sources, this logging
is triggered (display with "journalctl --all --follow --identifier
plasmashell"):

```
Sep 10 17:37:13 xrated plasmashell[2900]: qml: onCurrentTabChanged:dilbert
Sep 10 17:37:14 xrated plasmashell[2900]: qml: onCurrentTabChanged:perscheid
Sep 10 17:37:14 xrated plasmashell[2900]: Fetch page
http://www.martin-perscheid.de/4023.html
Sep 10 17:37:14 xrated plasmashell[2900]: No next strip.
Sep 10 17:37:14 xrated plasmashell[2900]: Fetch image
http://www.martin-perscheid.de/image/cartoon/4023.gif
Sep 10 17:37:14 xrated plasmashell[2900]: "Author................" "Martin
Perscheid"
Sep 10 17:37:14 xrated plasmashell[2900]: "Website URL..........."
"http://www.martin-perscheid.de/";
Sep 10 17:37:14 xrated plasmashell[2900]: "Shop URL.............."
"http://www.martin-perscheid.de/shop.html";
Sep 10 17:37:14 xrated plasmashell[2900]: "Title................." ""
Sep 10 17:37:14 xrated plasmashell[2900]: "Additional Text......." "4023"
Sep 10 17:37:14 xrated plasmashell[2900]: "Identifier............"
QVariant(int, 4023)
Sep 10 17:37:14 xrated plasmashell[2900]: "First Identifier......"
QVariant(int, 3999)
Sep 10 17:37:14 xrated plasmashell[2900]: "Last Identifier......."
QVariant(int, 4023)
Sep 10 17:37:14 xrated plasmashell[2900]: "Next Identifier......."
QVariant(Invalid)
Sep 10 17:37:14 xrated plasmashell[2900]: "Previous Identifier..."
QVariant(int, 4022)
```

I've removed some unrelated output. Interestingly, no cache files are created
at this point (probably due to not expecting those cache files vanishing), but
when hitting prev, things start to look strange:

```
Sep 10 17:44:21 xrated plasmashell[2900]: Fetch page
http://www.martin-perscheid.de/4021.html
Sep 10 17:44:21 xrated plasmashell[2900]: Fetch image
http://www.martin-perscheid.de/image/cartoon/4021.gif
Sep 10 17:44:21 xrated plasmashell[2900]: "Author................" "Martin
Perscheid"
Sep 10 17:44:21 xrated plasmashell[2900]: "Website URL..........."
"http://www.martin-perscheid.de/";
Sep 10 17:44:21 xrated plasmashell[2900]: "Shop URL.............."
"http://www.martin-perscheid.de/shop.html";
Sep 10 17:44:21 xrated plasmashell[2900]: "Title................." ""
Sep 10 17:44:21 xrated plasmashell[2900]: "Additional Text......." "4021"
Sep 10 17:44:21 xrated plasmashell[2900]: "Identifier............"
QVariant(int, 4021)
Sep 10 17:44:21 xrated plasmashell[2900]: "First Identifier......"
QVariant(int, 3999)
Sep 10 17:44:21 xrated plasmashell[2900]: "Last Identifier......."
QVariant(int, 4023)
Sep 10 17:44:21 xrated plasmashell[2900]: "Next Identifier......."
QVariant(int, 4022)
Sep 10 17:44:21 xrated plasmashell[2900]: "Previous Identifier..."
QVariant(int, 4020)
Sep 10 17:44:21 xrated plasmashell[2900]: "MaxComicLimit on."

```

While it is displaying the strip 4022 correctly, logging tells us, it loaded
4021, and the cache is set now with:
```
-rw-rw-r-- 1 hp lisa 97661 10. Sep 17:44 perscheid%3A4021
-rw-rw-r-- 1 hp lisa   209 10. Sep 17:44 perscheid%3A4021.conf
-rw-rw-r-- 1 hp lisa   206 10. Sep 17:44 perscheid.conf
```

and perscheid.conf reveals some inconsistencies:
```
[General]
comics=perscheid%3A4021
firstStripIdentifier=3999
isLeftToRight=1
isTopToBottom=1
lastCachedStripIdentifier=4021
shopUrl=http://www.martin-perscheid.de/shop.html
suffixType=Number
title=Perscheid
```

It's obviously missing 4022 and 4023, and consequently noting strip 4021 only,
while it displays 4022, and misses the return path to 4023 via next button.
Jumping back und forth (with prev and next) fills the cache with images up to
4021. 

Issues: why does it not store (cache) 4022 and 4023 (again), if it's missing.
Related, this misbehavior prevents 4023 from being accessible (the usual way),
since the highest cached file is 4021, which makes 4022 accessible, as
observed:
```
$ cat perscheid%3A4021.conf
[General]
additionalText=4021
comicAuthor=Martin Perscheid
imageUrl=http://www.martin-perscheid.de/image/cartoon/4021.gif
nextIdentifier=4022
previousIdentifier=4020
websiteUrl=http://www.martin-perscheid.de/
```

It's not related to clearing the cache, since I started debugging with the
cache untouched! Somehow, it remembers the initially loaded 4022 as current,
and doesn't correct this state, when a new strip is published. I don't see a
way, how I could be responsible or fix this behavior within my comic source
script.

My Perscheid comic source is available on https://www.pling.com/p/1323091/
and https://github.com/frispete/plasma-addon-comic-perscheid.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to