fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.35k stars 343 forks source link

Warning when marking all items read #1386

Open aslmx opened 1 year ago

aslmx commented 1 year ago

Selfoss 2.19

There is this Toast/Alert/Popup that says "Cant mark all visible elements as read. Offline storage is not available" it is a cosmetic problem (for me) but is not really nice

Steps to reproduce:

  1. Filter for a Tag with a few unread items
  2. mark all Items read by reading them (or not reading... but just clicking them to mark them read is enough) (Result: all items that are shown are marked Read - okay)
  3. Click the "Mark read" / "All Read" (not sure how it is called in english, the big green button on the top left that marks everything read ;) ) Expected Result: nothing should really happen now? Actual Result: The Popup i mentioned above is shown. It implies there is some problem, but there really isn't?
jtojnar commented 1 year ago

Looks like the issue is actually caused by attempting to mark zero items:

selfoss.DEBUG: Executing SQL {"sql":"UPDATE items SET unread=? WHERE id IN ()"} 
selfoss.ERROR: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1

And then, when the failure tries to disable the offline mode (apparently it is still tangled into the error handler), the failure to disable unavailable offline mode masks the original error.