martinrotter / rssguard

Feed reader (and podcast player) which supports RSS/ATOM/JSON and many web-based feed services.
GNU General Public License v3.0
1.45k stars 120 forks source link

[BUG]: Columns in article list are reset to default when quitting RSSGuard #778

Closed xfzv closed 1 year ago

xfzv commented 1 year ago

Brief description of the issue

Disclaimer: I cannot reproduce with a fresh profile, I have no idea what's going on with my config file.

If I set a new column in the articles list panel (I'd like to have "Feed", which isn't enabled by default) and quit RSSGuard, then after re-launching the app, the columns are reset to default, i.e the "Feed" column is no longer displayed and I have to enable it again manually. Happens with any criteria.

I use -d, --data /path/to/my/RSSGuard/directory where my config.ini and my database are located, if that matters.

How to reproduce the bug?

Disclaimer: I cannot reproduce with a fresh profile, I have no idea what's going on with my config file.

  1. In the articles list, right click on the column bar and check for example "Feed" so that the displayed columns are as follows: Read / Important / Feed / Title / Date
  2. Quit RSSGuard
  3. Open RSSGuard again
  4. Columns are reset to default (Read / Important / Title / Date)

What was the expected result?

Columns are memorized after quitting RSSGuard.

What actually happened?

Columns are reset to default after quitting RSSGuard.

Debug log

log ``` time=" 0.052" type="debug" -> core: Initializing settings in '/home/xfzv/RSSGuard/config/config.ini' (custom way). time=" 0.054" type="debug" -> database: File-based SQLite database connection 'DatabaseFactory' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.054" type="debug" -> database: File-based SQLite database has version '2'. time=" 0.054" type="debug" -> gui: Available icon theme paths: (/usr/share/icons, :/icons, :/graphics, /home/xfzv/RSSGuard/icons, /usr/bin/icons) time=" 0.055" type="debug" -> gui: Icon theme 'Papirus-Dark' already loaded. time=" 0.056" type="debug" -> gui: Found path of base skin: ':/skins/nudus-base'. time=" 0.056" type="debug" -> gui: Local file ':/skins/nudus-dark/html_wrapper.html' exists, using it for the skin. time=" 0.056" type="debug" -> gui: Local file ':/skins/nudus-dark/html_style.css' exists, using it for the skin. time=" 0.056" type="debug" -> gui: Trying to load base file ':/skins/nudus-base/html_enclosure_image.html' for the skin. time=" 0.056" type="debug" -> gui: Trying to load base file ':/skins/nudus-base/html_single_message.html' for the skin. time=" 0.056" type="debug" -> gui: Trying to load base file ':/skins/nudus-base/html_enclosure_every.html' for the skin. time=" 0.056" type="debug" -> gui: Local file ':/skins/nudus-dark/qt_style.qss' exists, using it for the skin. time=" 0.056" type="debug" -> gui: Trying to load base file ':/skins/nudus-base/html_adblocked.html' for the skin. time=" 0.056" type="debug" -> gui: Setting style: 'kvantum-dark'. time=" 0.073" type="critical" -> gui: Skipped setting of application style and skin because there is already some style set. time=" 0.073" type="debug" -> gui: Skin 'nudus-dark' loaded. time=" 0.074" type="debug" -> network: Disabling application-wide proxy completely. time=" 0.075" type="debug" -> core: OpenSSL version: 'OpenSSL 1.1.1q 5 Jul 2022'. time=" 0.075" type="debug" -> core: OpenSSL supported: 'true'. time=" 0.075" type="debug" -> core: Starting RSS Guard 4.2.3. time=" 0.075" type="debug" -> core: Instantiated class 'Application'. time=" 0.075" type="debug" -> core: Starting to load active localization. Desired localization is 'en_US'. time=" 0.075" type="debug" -> core: Application localization 'en_US' loaded successfully, specifically sublocalization 'en_US' was loaded. time=" 0.075" type="warning" -> core: Qt localization 'en_US' WAS NOT loaded successfully. time=" 0.086" type="debug" -> database: SQLite database connection 'MessagesModel' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.087" type="debug" -> message-model: Repopulated model, SQL statement is now: 'SELECT Messages.id, Messages.is_read, Messages.is_important, Messages.is_deleted, Messages.is_pdeleted, Messages.feed, Messages.title, Messages.url, Messages.author, Messages.date_created, Messages.contents, Messages.enclosures, Messages.score, Messages.account_id, Messages.custom_id, Messages.custom_hash, Feeds.title, CASE WHEN length(Messages.enclosures) > 10 THEN 'true' ELSE 'false' END AS has_enclosures FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id AND Messages.account_id = Feeds.account_id WHERE 0 > 1;'. time=" 0.087" type="debug" -> core: Auto-download timer started with interval 60000 ms. time=" 0.088" type="debug" -> core: Creating FeedDownloader singleton. time=" 0.088" type="debug" -> core: Requesting update for all feeds on application startup. time=" 0.088" type="debug" -> gui: Creating main application form in thread: '0x7fe856f2a840'. time=" 0.129" type="debug" -> gui: Current row changed - proxy 'QModelIndex(-1,-1,0x0,QObject(0x0))', source 'QModelIndex(-1,-1,0x0,QObject(0x0))'. time=" 0.132" type="debug" -> network: Settings of BaseNetworkAccessManager loaded. time=" 0.133" type="debug" -> network: Settings of BaseNetworkAccessManager loaded. time=" 0.138" type="debug" -> network: Settings of BaseNetworkAccessManager loaded. time=" 0.147" type="debug" -> gui: Creating tray icon menu. time=" 0.148" type="debug" -> CTRL is NOT pressed while sorting articles - sorting with standard mode. time=" 0.148" type="debug" -> message-model: Repopulated model, SQL statement is now: 'SELECT Messages.id, Messages.is_read, Messages.is_important, Messages.is_deleted, Messages.is_pdeleted, Messages.feed, Messages.title, Messages.url, Messages.author, Messages.date_created, Messages.contents, Messages.enclosures, Messages.score, Messages.account_id, Messages.custom_id, Messages.custom_hash, Feeds.title, CASE WHEN length(Messages.enclosures) > 10 THEN 'true' ELSE 'false' END AS has_enclosures FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id AND Messages.account_id = Feeds.account_id WHERE 0 > 1 ORDER BY Messages.id DESC;'. time=" 0.148" type="debug" -> gui: Reloading of msg selections took 0 miliseconds. time=" 0.157" type="debug" -> CTRL is NOT pressed while sorting articles - sorting with standard mode. time=" 0.158" type="debug" -> message-model: Repopulated model, SQL statement is now: 'SELECT Messages.id, Messages.is_read, Messages.is_important, Messages.is_deleted, Messages.is_pdeleted, Messages.feed, Messages.title, Messages.url, Messages.author, Messages.date_created, Messages.contents, Messages.enclosures, Messages.score, Messages.account_id, Messages.custom_id, Messages.custom_hash, Feeds.title, CASE WHEN length(Messages.enclosures) > 10 THEN 'true' ELSE 'false' END AS has_enclosures FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id AND Messages.account_id = Feeds.account_id WHERE 0 > 1 ORDER BY Messages.date_created DESC, Messages.id DESC;'. time=" 0.159" type="debug" -> core: Showing the main window when the application is starting. time=" 0.188" type="debug" -> database: SQLite database connection 'FeedReader' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.189" type="debug" -> database: SQLite database connection 'FeedlyEntryPoint' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.189" type="debug" -> database: SQLite database connection 'GmailEntryPoint' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.189" type="debug" -> database: SQLite database connection 'GreaderEntryPoint' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.190" type="debug" -> database: SQLite database connection 'OwnCloudServiceEntryPoint' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.190" type="debug" -> database: SQLite database connection 'NewsBlurEntryPoint' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.190" type="debug" -> database: SQLite database connection 'RedditEntryPoint' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.191" type="debug" -> database: SQLite database connection 'StandardServiceEntryPoint' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.192" type="debug" -> core: Filter accepts row 'xfzv (RSS/ATOM/JSON)' and filter result is: 'true'. time=" 0.192" type="debug" -> database: SQLite database connection 'StandardServiceRoot' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.193" type="debug" -> core: Custom ID of feed when loading from DB is '1'. time=" 0.193" type="debug" -> core: Custom ID of feed when loading from DB is '2'. time=" 0.194" type="debug" -> core: Custom ID of feed when loading from DB is '3'. time=" 0.194" type="debug" -> core: Custom ID of feed when loading from DB is '4'. time=" 0.194" type="debug" -> core: Custom ID of feed when loading from DB is '5'. time=" 0.194" type="debug" -> core: Custom ID of feed when loading from DB is '6'. time=" 0.194" type="debug" -> core: Custom ID of feed when loading from DB is '7'. time=" 0.215" type="warning" -> libpng warning: iCCP: known incorrect sRGB profile time=" 0.240" type="debug" -> database: SQLite database connection 'RecycleBin' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.245" type="debug" -> database: SQLite database connection 'ImportantNode' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.250" type="debug" -> database: SQLite database connection 'RootItem' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.254" type="debug" -> database: SQLite connection 'StandardServiceRoot' is already active. time=" 0.254" type="debug" -> database: SQLite database connection 'StandardServiceRoot' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.261" type="debug" -> database: SQLite database connection 'TtRssServiceEntryPoint' to file '/home/xfzv/RSSGuard/database/database.db' seems to be established. time=" 0.262" type="debug" -> gui: Feed list item expanded - xfzv (RSS/ATOM/JSON) time=" 0.262" type="debug" -> core: Filter accepts row 'Recycle bin' and filter result is: 'true'. time=" 0.262" type="debug" -> core: Filter accepts row 'Important articles' and filter result is: 'true'. time=" 0.262" type="debug" -> core: Filter accepts row 'Unread articles' and filter result is: 'true'. time=" 0.262" type="debug" -> core: Filter accepts row 'Labels' and filter result is: 'true'. time=" 0.264" type="debug" -> gui: Feed list item expanded - IT time=" 0.264" type="debug" -> gui: Feed list item expanded - News time=" 0.265" type="debug" -> core: No execution message received from other app instances. time=" 0.292" type="debug" -> core: Filter accepts row 'xfzv (RSS/ATOM/JSON)' and filter result is: 'true'. time=" 0.305" type="debug" -> gui: Message splitter moved. time=" 1.092" type="debug" -> gui: Message list got focus with reason 'Qt::MouseFocusReason'. time=" 4.863" type="debug" -> gui: Message list got focus with reason 'Qt::PopupFocusReason'. time=" 5.238" type="debug" -> CTRL is NOT pressed while sorting articles - sorting with standard mode. time=" 5.238" type="debug" -> Displaying messages from feeds IDs: ''1'' and URLs: 'https://www.kernel.org/feeds/all.atom.xml'. time=" 5.250" type="debug" -> message-model: Repopulated model, SQL statement is now: 'SELECT Messages.id, Messages.is_read, Messages.is_important, Messages.is_deleted, Messages.is_pdeleted, Messages.feed, Messages.title, Messages.url, Messages.author, Messages.date_created, Messages.contents, Messages.enclosures, Messages.score, Messages.account_id, Messages.custom_id, Messages.custom_hash, Feeds.title, CASE WHEN length(Messages.enclosures) > 10 THEN 'true' ELSE 'false' END AS has_enclosures FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id AND Messages.account_id = Feeds.account_id WHERE Feeds.custom_id IN ('90') AND Messages.is_deleted = 0 AND Messages.is_pdeleted = 0 AND Messages.account_id = 1 ORDER BY Messages.date_created DESC, Messages.id DESC;'. time=" 8.973" type="debug" -> gui: Message list got focus with reason 'Qt::MouseFocusReason'. time=" 9.408" type="debug" -> gui: Main window's close event time=" 9.408" type="debug" -> gui: Main window's hide event time=" 9.411" type="debug" -> core: Cleaning up resources and saving application state. time=" 9.411" type="debug" -> core: Close lock was obtained safely. time=" 9.411" type="debug" -> core: Stopping StandardServiceRoot instance.time=" 9.411" type="debug" -> feed-downloader: Destroying FeedDownloader instance. time=" 9.411" type="debug" -> gui: Destroying FormMain instance. time=" 9.412" type="debug" -> gui: Destroying TabWidget instance. time=" 9.412" type="debug" -> gui: Destroying FeedMessageViewer instance. time=" 9.412" type="debug" -> gui: Destroying BaseToolBar instance. time=" 9.413" type="debug" -> network: Destroying Downloader instance. time=" 9.413" type="debug" -> network: Destroying SilentNetworkAccessManager instance. time=" 9.413" type="debug" -> network: Destroying Downloader instance. time=" 9.413" type="debug" -> network: Destroying SilentNetworkAccessManager instance. time=" 9.413" type="debug" -> gui: Destroying MessagesView instance. time=" 9.413" type="debug" -> gui: Destroying BaseToolBar instance. time=" 9.414" type="debug" -> gui: Destroying FeedsView instance. time=" 9.414" type="debug" -> gui: Destroying TabBar instance. time=" 9.414" type="debug" -> gui: Destroying StatusBar instance. time=" 9.418" type="debug" -> core: Destroying Application instance. time=" 9.418" type="debug" -> core: Destroying Mutex instance. time=" 9.445" type="debug" -> gui: Destroying IconFactory instance. time=" 9.445" type="debug" -> core: Destroying FeedReader instance. time=" 9.445" type="debug" -> feed-model: Destroying FeedsModel instance. time=" 9.446" type="debug" -> feed-model: Destroying FeedsProxyModel instance time=" 9.446" type="debug" -> message-model: Destroying MessagesModel instance. time=" 9.446" type="debug" -> message-model: Destroying MessagesProxyModel instance. ```

Operating system and version

xfzv commented 1 year ago

Video:

https://user-images.githubusercontent.com/78810647/185698761-7c982e76-2d3f-48e2-b536-85faacbd7621.mp4

xfzv commented 1 year ago

Still occurs after deleting config.ini and using the default one so I guess it's not my config file?

akinokonomi commented 1 year ago

Disclaimer: I cannot reproduce with a fresh profile,

Still occurs after deleting config.ini

Are you sure RSS Guard was not running when you removed the config? Like, minimized to tray?
The (only?) related line in config is msg_view_state=.... You should be fine removing just that one line.

Otherwise, did you ever install development builds/have built on some random git commit ever since you started using your current database file?

I remember few months back there were experiments on SQL database with breaking changes that were fixed afterwards, so it did not affect tags.

(Maybe there was another such change since then, not sure.)

Anyway, if so, git commits are not really supported.

On the other note, I can't reproduce it on latest commit.

Read / Important / Feed / Title / Date

Even with this column order.


Oh, and how are you quitting RSS Guard? Ctrl+Q/Alt+F+Q? Some DE/WM-specific shortcut?

xfzv commented 1 year ago

Disclaimer: I cannot reproduce with a fresh profile,

Still occurs after deleting config.ini

Are you sure RSS Guard was not running when you removed the config? Like, minimized to tray? The (only?) related line in config is msg_view_state=.... You should be fine removing just that one line.

I don't use tray icon. I'm positive RSSGuard was not running when removing config.ini, I've just tried again and the issue persists. Also tried to remove msc_view_state= line from config.ini but columns are still reset.

Otherwise, did you ever install development builds/have built on some random git commit ever since you started using your current database file?

I remember few months back there were experiments on SQL database with breaking changes that were fixed afterwards, so it did not affect tags.

(Maybe there was another such change since then, not sure.)

Anyway, if so, git commits are not really supported.

Interesting. Yes I did a few days ago. I reported https://github.com/martinrotter/rssguard/issues/774 and ran the latest nowebengine-linux64.AppImage with the relevant commit that fixed the issue to make sure it was fixed indeed.

Considering I can reproduce the issue with a fresh config.ini but not with a fresh config.ini and database, maybe using the AppImage caused issues to my database.

Oh, and how are you quitting RSS Guard? Ctrl+Q/Alt+F+Q? Some DE/WM-specific shortcut?

I'm using my own Plasma shortcut (Mod+Q) but "File > Quit" or Ctrl+Q doesn't seem to make any difference.

Anyway, I'm going to start from scratch with a new config.ini and database. I'll report back.

Thank you!

xfzv commented 1 year ago

After starting from scratch, I finally found the culprit.

The issue occurs as soon as I uncheck "Use skin colors" in Settings > User Interface and apply.

image

This change requires a RSSGuard restart and as soon as I restart, the column are reset to default.

If I check this setting again, restart RSSGuard as prompted, re-do my columns, exit and restart RSSGuard, my columns are saved as expected.

martinrotter commented 1 year ago

@xfzv will test, thanks for pinpointing possible cause of this problem. It does seem unlikely for me as the real cause, but will test.

martinrotter commented 1 year ago

Do you use x11 or wayland? I will have to test on Linux (I use Arch), because on Windows I am not able to reproduce and I tried hard.

xfzv commented 1 year ago

Do you use x11 or wayland? I will have to test on Linux (I use Arch), because on Windows I am not able to reproduce and I tried hard.

X11

akinokonomi commented 1 year ago

After starting from scratch, I finally found the culprit.

The issue occurs as soon as I uncheck "Use skin colors" in Settings > User Interface and apply.

@xfzv, Thanks for this! I can reproduce it even with clean profile. It's really weird.

@martinrotter

  1. Click checkbox to add the "Feed" column to articles list
  2. Go to Settings and uncheck "Use skin colors"
  3. Agree to Restart prompt
  4. After restart Feed column disappears
  5. Click checkbox to add Feed column again
  6. Quit RSS Guard with Ctrl-Q and start it back
  7. See no "Feed" column

The same happens to many other columns too, not just Feed.
Perhaps all of them, except the default ones (Read, Important, Title, Author, and Date), which I can hide, and their state will be preserved even after restart.

Checking "Use skin colors" back fixes the issue for me.

Edit: (Compiled against Qt 6.3.1.)

martinrotter commented 1 year ago

Do you use x11 or wayland? I will have to test on Linux (I use Arch), because on Windows I am not able to reproduce and I tried hard.

X11

COmpiled against which qt version?

xfzv commented 1 year ago

Do you use x11 or wayland? I will have to test on Linux (I use Arch), because on Windows I am not able to reproduce and I tried hard.

X11

COmpiled against which qt version?

5.15.5

akinokonomi commented 1 year ago

@martinrotter, I can trace it back down to RSS Guard 4.2.0 release (Qt 6.3.1), where that checkbox was introduced (as far as I remember).

Can't reproduce it with 0c10e8fe compiled against older Qt 5.15.3, but can reproduce it with the same commit compiled against older 6.2.3 (system Qt is 6.3.1, so this test can be incorrect).

martinrotter commented 1 year ago

After starting from scratch, I finally found the culprit. The issue occurs as soon as I uncheck "Use skin colors" in Settings > User Interface and apply.

@xfzv, Thanks for this! I can reproduce it even with clean profile. It's really weird.

@martinrotter

1. Click checkbox to add the "Feed" column to articles list

2. Go to Settings and uncheck "Use skin colors"

3. Agree to Restart prompt

4. After restart Feed column disappears

5. Click checkbox to add Feed column again

6. Quit RSS Guard with Ctrl-Q and start it back

7. See no  "Feed" column

The same happens to many other columns too, not just Feed. Perhaps all of them, except the default ones (Read, Important, Title, Author, and Date), which I can hide, and their state will be preserved even after restart.

Checking "Use skin colors" back fixes the issue for me.

Edit: (Compiled against Qt 6.3.1.)

I managed to reproduce it. WTF is happening. World really does not make any sense to me these days.

EDIT1: Step 3 is not needed and quitting app via "Quit" button triggers the bug too.

martinrotter commented 1 year ago

OK, I think I found the problem. It is funny because point 2 caused totally unrelated problem somewhere else in the application, which result in race condition state which essentially caused the settings for columns to be almost completely ignored.

There were also some related problems when saving THE setting into settings file.

Jesus.

Pushed 6e8841eac.

Pls test when it compiles and report back. I tested in both Qt 5 and Qt 6.

akinokonomi commented 1 year ago

EDIT1: Step 3 is not needed and quitting app via "Quit" button triggers the bug too.

@martinrotter, Yep. Sorry, I should've mentioned that.


Fixed for me. Tested only with Qt 6.3.1

Thanks!

martinrotter commented 1 year ago

It turned out to by one of the most complicated bugs I had to solve for quite some time in rssguard. I am not still entirely happy with the fix as it feels bit as a hack, and what is worse, the bug manifested bit differently between 5.15.2 and 6.3.1 of Qt. Once Qt 5 will be dumped for good, state will be overally better.

I will have to somehow upgrade my scripts to produce Qt 6 appimage.