Slide icon indicating copy to clipboard operation
Slide copied to clipboard

Some posts marked as read incorrectly

Open Nxt3 opened this issue 10 years ago • 15 comments

I'll be viewing /r/all and randomly, I'll see posts that look like I've viewed them before despite me never seeing this submission before.

Edit: It appears that I can go to a subreddit, tap on the first post in the list, and witness a submission a few below that also be marked as read at the same time. In other words, it's marking two posts as read at the same time.

Nxt3 avatar Jul 10 '16 19:07 Nxt3

I'm getting this too, but only while clicking on posts. It often marks the post below as read

ccrama avatar Jul 11 '16 13:07 ccrama

So this is happening with me too. Just to confirm , this is not happening on the current alpha, right? If yes, then I think it is related to the comments feature I added. Git bisect at least is telling me so. I'll take a look at it tonight, but if anybody has time https://github.com/ccrama/Slide/commit/7f52804f1fbca137b0741ba6b57969ec67d7c47a is most probably the culprit commit.

prashantkhurana avatar Jul 12 '16 19:07 prashantkhurana

Yeah, the issue is making the RecyclerView static and getting an inference for the ViewHolder, both no-nos on Android. Will fix

ccrama avatar Jul 12 '16 19:07 ccrama

Thanks @ccrama . Let me know if you don't find time and want me to do it.

prashantkhurana avatar Jul 12 '16 19:07 prashantkhurana

No worries @prashantkhurana , just did it. Ended up making it not run off of clicking on the adapter position, but instead opening the submission URL as a new window. This fixes the issue, and correctly marks as read (because opening the image marks as read anyway). Should work as expected after my next commit! Thanks for the find

ccrama avatar Jul 12 '16 19:07 ccrama

Thanks. So that is what I had started with, when I started with the feature, but the issue then is that if you upvote, then the changes (in upvote icon) are not reflected back. Same happens with every other button. I verified this with your latest commit.

prashantkhurana avatar Jul 12 '16 19:07 prashantkhurana

I don't think there is a way to get both to work in reality, what could be done is adding in an ActivityResult, similar to what I do to get voting to work from between the comment screen and list view

ccrama avatar Jul 12 '16 20:07 ccrama

can you point me to that code?

prashantkhurana avatar Jul 12 '16 20:07 prashantkhurana

Sure thing! https://github.com/ccrama/Slide/blob/master/app/src/main/java/me/ccrama/redditslide/Activities/MainActivity.java#L296

I don't know how easily we could integrate that into the CommentScreenSingle Activity, but if you'd like to take a look that would be greatly appreciated! Thanks

ccrama avatar Jul 12 '16 20:07 ccrama

thanks! sure, I will have a look later tonight and hopefully make some progress. Without looking into it much, I am still intrigued by that static thing I did. What makes it mark 2 posts as seen.

prashantkhurana avatar Jul 12 '16 20:07 prashantkhurana

Thank you! And well it's static, so the reference could have changed on you without you knowing (just a general code issue).

I think the main issue, though, was either that the adapterposition was wrong or the reference to the ViewHolder was incorrect

ccrama avatar Jul 12 '16 21:07 ccrama

ohh yeah, that's a static issue, but I doubt that is what is happening here. It should still mark only 1. wrong one maybe, but still 1. Why it marks 2 things as read is weird to me. I'll give it a look also.

prashantkhurana avatar Jul 12 '16 21:07 prashantkhurana

This is still an issue.

Nxt3 avatar Jul 13 '16 04:07 Nxt3

Happening to me too, posts marked read below the post I click

amhrangel avatar Jul 14 '16 22:07 amhrangel

It's fixed now in the new PR

ccrama avatar Jul 15 '16 01:07 ccrama