Fix swipe gesture attempting to mark feeds and groups as read #522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After some digging into #515, I think I've figured out the root cause of the various issues with "swipe to mark as read" marking unrelated items as read.
Internally, Read You has a
markAsRead
function that is called when a part of the app wants to mark an article as read. It takes a few parameters: either a group ID, feed ID, or article ID. It would take appropriate action depending on which ID was provided.Now, an unwritten assumption of this bit of code was that only one of the IDs would be supplied to
markAsRead
at once. This assumption was violated by the swipe to dismiss code, which provided all three. This manifested as various inconsistent behavior throughout the app, especially on the Fever API - which has additional mark as read code.The fix is simple: make sure the swipe to mark as read code only provides the article ID. That's what this PR does. I've tested it on Fever, and it seems to work.
FYI, in case you're curious, @Ashinch @kid1412621 and @nvllz. Resolves #515.