Slide icon indicating copy to clipboard operation
Slide copied to clipboard

Post/comment score irregularity (1 extra point is added) [Video]

Open Controless opened this issue 10 years ago • 12 comments

Slide version: 5.3.3-alpha.5 (and 73d1e09) Android version: 6.0.1

When upvoting a post and refreshing, 1 extra point is added to the score. So if you upvote a post with score 1 and refresh, it will display 3 rather than 2. Downvoting and refreshing works properly.

Video: https://streamable.com/613m

Controless avatar Apr 30 '16 08:04 Controless

@Nxt3 :(

ccrama avatar Apr 30 '16 13:04 ccrama

Didn't read all the PRs and stuff on it because damn there were a fair few, but did you end up looking into the thing I suggested before switching server stuff around @Nxt3?

Load the score as is provided by the API in all scenarios, then inc/decrement the score when and only when the user taps on it (and only for that 'session', if you refresh the post would display the score given by the API)

Alexendoo avatar Apr 30 '16 14:04 Alexendoo

This extra point is caused by the API. Go to desktop--upvote something and refresh. The score changes between refreshes all the time. There isn't much more I can do. I already did what @Alexendoo suggested, and that doesn't work as well as you thought.

Nxt3 avatar Apr 30 '16 17:04 Nxt3

It doesn't occur on the desktop, the reason it happens is because of https://github.com/ccrama/Slide/blob/master/app/src/main/java/me/ccrama/redditslide/SubmissionViews/PopulateSubmissionViewHolder.java#L1403

Reddit.com handles it how I described (submit a post, unupvote it and refresh, then upvote it, it will display 2), the only issue with it on android however is that when a submission gets recycled it's recreated but the score isn't refreshed, so scrolling up/down loses that state. That's the reason the intricate chain of increments/decrements started in the first place, not sure there's a good solution without storing something extra

Alexendoo avatar Apr 30 '16 18:04 Alexendoo

I actually can't reproduce this. I'm upvoting something to 2pts--refreshing--and it's still at 2pts.

Nxt3 avatar Apr 30 '16 18:04 Nxt3

oh, dude; this has been fixed. I don't think the build you're on has this fix, @Controless. I spent a good portion of yesterday fixing this.

Nxt3 avatar Apr 30 '16 18:04 Nxt3

Still occurs on 73d1e094487334264d1a840e2511e1393cbb9564

Alexendoo avatar Apr 30 '16 19:04 Alexendoo

Can confirm, occurring for me as well on the latest commit.

Controless avatar Apr 30 '16 19:04 Controless

It is happening on every single post you up vote? Go to /r/testslideforreddit and attempt replication. This issue isn't happening consistently enough for me to fix. :/

Nxt3 avatar Apr 30 '16 20:04 Nxt3

Yes, unfortunately it does. Video: https://streamable.com/9sze

Controless avatar Apr 30 '16 20:04 Controless

Ugh. It doesn't happen on every post for me. I already tried what @Alexendoo suggested, but ran into other problems.

Nxt3 avatar Apr 30 '16 21:04 Nxt3

I think I've finally fixed this with my last few commits :)

ccrama avatar Aug 05 '16 15:08 ccrama