Skip to content
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

[Post list] Post are not marked read first time you get back to posts list #239

Open
Matth7878 opened this issue Jan 9, 2025 · 14 comments · Fixed by #241 or #262
Open

[Post list] Post are not marked read first time you get back to posts list #239

Matth7878 opened this issue Jan 9, 2025 · 14 comments · Fixed by #241 or #262
Assignees
Labels
bug Something isn't working

Comments

@Matth7878
Copy link
Contributor

Describe the bug
When viewing a post then going back to posts list it's not marked as read. But if you open again the post and get back then it turns as read.
Weirdly it seems you need to go twice to a post to have post list marking it as read. It's like the first time a trigger fails, but second time it's OK.

To Reproduce
Steps to reproduce the behavior:

  1. Go to advanced settings and check that fading posts when read is toggle on
  2. Go to a post and get back to list
  3. Post is not greyed
  4. Go once more to same post and get back
  5. Post is correctly marked as read

Expected behavior
Post should be marked as read when you first get back to list.

Smartphone (please complete the following information):

  • Device: Oneplus 12
  • OS: Android 15
  • Version : 1.14.1-beta03
@Matth7878 Matth7878 added the bug Something isn't working label Jan 9, 2025
@AkesiSeli
Copy link
Contributor

Thanks for the report, I'll check it and come back to you soon!

@AkesiSeli AkesiSeli linked a pull request Jan 9, 2025 that will close this issue
@AkesiSeli AkesiSeli self-assigned this Jan 9, 2025
@AkesiSeli
Copy link
Contributor

There actually seems to be a small bug. I'll merge the above mentioned pull request and publish a new version. Thanks for continuing to test the application in the meantime.

@Matth7878
Copy link
Contributor Author

@AkesiSeli I just tested with latest beta and postposts are still not marked first time you visit and exit. It does only the second time or when refreshing posts list.

@AkesiSeli
Copy link
Contributor

That is very strange because I tested it, let us reopen it then.

@AkesiSeli AkesiSeli reopened this Jan 10, 2025
@Matth7878
Copy link
Contributor Author

Matth7878 commented Jan 10, 2025

I take a look since it was working for you.
What I found is that it doesn't work when using phone back button. But if I tap on the Raccoon's arrow to get back it works.

@Matth7878
Copy link
Contributor Author

Correction : thought yesterday it was working when using raccoon's back button, today nothing works after first exit. 😕
So issue is not about phone back button.

I am on subscribed communities list and I use compact layout and dark for UI theme.

@AkesiSeli
Copy link
Contributor

The supposed fix was worse than the bug, actually. I noticed images now glitch when you up vote/downvote everything due to a recomposition being triggered. I'll re-work on this shortly.

@AkesiSeli
Copy link
Contributor

I found an explanation for the nondeterministic behaviour you were experiencing (which I wasn't but I may just have been really lucky all the times): it was a concurrency issue.

I'll fix it but it will require some time, since there are many screens with the same issue.

@Matth7878
Copy link
Contributor Author

Sorry about it but still not working. 😔

@AkesiSeli
Copy link
Contributor

I ran out of ideas this time 😂

@AkesiSeli AkesiSeli reopened this Jan 13, 2025
@Matth7878
Copy link
Contributor Author

I don't know if it helps but it always work if post is upvoted, downvoted or saved in post and it's comments screen.
I tried to look at your code and it's over my head but those actions trigger a markAsRead function. (Looking at PostListViewModel.kt

If action to open a post is PostListMviModel.Intent.WillOpenDetail then is it normal it invokes markAsRead this way : markAsRead(post) ?
Vote and saving do : markAsRead(post = post)

@AkesiSeli
Copy link
Contributor

AkesiSeli commented Jan 14, 2025

Yes, it's the same thing (the argument name post = is optional here).

The main difference, to me, is that with upvote and downvote you remain in the same screen; whereas when you open the detail screen you move to another one so the post list screen changes its lifecycle state and stops processing events. Using the WillOpenDetail intent and OpenDetail side effect I made sure navigation happened only after the state was changed BUT there still may be issues apparently.

@Matth7878
Copy link
Contributor Author

Matth7878 commented Jan 14, 2025

What I wanted to point out is that vote and save on detail screen (for post not it's comments) and going back to post list always mark read correctly the post in list of posts.
So maybe marking as read when going to details, waiting to display and do the same thing as if user upvoted (without actually doing the upvoted) should result in always post being greyed correctly when going back to main list.

@AkesiSeli
Copy link
Contributor

AkesiSeli commented Jan 14, 2025

Ok it can be tried (but for me it will have the same nondeterministic result).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants