-
-
Notifications
You must be signed in to change notification settings - Fork 31
Fix unread feed selection in FoldersAndFeedsQueryBuilder #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e0fee01 to
168bfaa
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #276 +/- ##
=============================================
- Coverage 19.61% 18.71% -0.91%
- Complexity 452 458 +6
=============================================
Files 190 189 -1
Lines 10089 10234 +145
Branches 1577 1595 +18
=============================================
- Hits 1979 1915 -64
- Misses 7992 8212 +220
+ Partials 118 107 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| val selection = buildString { | ||
| append(FEED_SELECTION) | ||
| if (hideReadFeeds) { | ||
| if(useSeparateState) append("AND (ItemState.read = 0 OR ItemState.read IS NULL)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I tested your solution and it didn't work for me, I still had some feeds and folders with 0 unread items displayed in the drawer.
And the catch is here. ItemState table isn't a perfect representation of the remote database. During synchronization only a limited read/unread ids are fetched. That's why when no state for an item is available in ItemState, we consider this item read. So in AND (ItemState.read = 0 OR ItemState.read IS NULL), ItemState.read IS NULL shouldn't be here to get only feeds with unread items whose read state is available in ItemState.
|
I'm adding this in addition to the comment just above. I had written a test in Lastly, I haven't forgotten about #263. To answer to your last comment, please know I'm open to optimization and simplification. It's just that when you opened the PR, as stated in here, your solution wasn't satisfying enough. But now you tell me that you have iterated on it and consider meeting my requirements, I will take a look at it. Please also note that as Readrops 2.1 is around the corner, it is currently in feature freeze state. I would like to wait for the release before merging any work of this kind. |
I'm sorry to read that. Unfortunately, in the current state of the code, I can't progres any further. The creation of this SQL query is too complex for me. I really encourage you to look at #263 to simplify this part. You may not need the database view. That was just me experimenting with that solution. But at least look at that SQL query which I belive is the simpler and more optimized way to select things related to feeds which have unread items. Parts of this SQL query may search in a template string for other queries. |
Oh, I should have been more clearer. Your solution works if you remove Otherwise I understand if you don't want to work on this subject anymore, I will handle tests myself. |
168bfaa to
614839b
Compare
|
Ah right, sorry. Done. I added a test too. |
|
Alright, thanks for this! |
Fixes #255.