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

fix: duplicate comments #4422

Merged
merged 3 commits into from
Aug 11, 2023
Merged

fix: duplicate comments #4422

merged 3 commits into from
Aug 11, 2023

Conversation

salahmak
Copy link
Contributor

Fix #4291

Sometimes, the Piped API's response contains comments that were already given in previous pages, so I have added a filter to remove them.

This might not be the best way to do it, but this is my first time working with Kotlin/Android because I found this bug annoying and wanted to do whatever it takes to fix it, so if there is a better way, please do it.

:)

@FireMasterK
Copy link
Member

FireMasterK commented Aug 11, 2023

Can you give an example video where this happens?
The API shouldn't be doing that!

@salahmak
Copy link
Contributor Author

@FireMasterK I don't currently have a video of it happening, but it usually happens when doing these steps:

  1. Open comments section
  2. Scroll down (load 1 or 2 more pages)
  3. Open a comment's replies
  4. Close the replies
  5. Scroll down more comments (load more comments pages)
  6. Now you should start noticing it happen

I have confirmed this by checking for duplicates in the commentPage.comments List (I didn't include the code in the commit as it was for my debugging) and it confirmed it for me after doing the above steps

@salahmak
Copy link
Contributor Author

What I think is causing the problem is the process of loading the replies of a comment and then going back, perhaps the wrong parameters are being set or overridden. I couldn't get my head around how that transition is happening (as I'm a beginner in Kotlin)

@Bnyro Bnyro merged commit 8230c75 into libre-tube:master Aug 11, 2023
4 checks passed
@Bnyro
Copy link
Member

Bnyro commented Aug 11, 2023

Thank you!

@salahmak
Copy link
Contributor Author

You're welcome @Bnyro, although I still think that this is just a workaround to make it not happen, I'm kinda sure that the cause of the bug is something else related to moving from the comments view to a replies view and then going back.

Opening replies is buggy as well, as sometimes it opens the wrong comment (I'll open a different issue for this).

@Bnyro
Copy link
Member

Bnyro commented Aug 11, 2023

Yes, I agree, but it's better to have a temporary workaround/fix instead of keeping the issue present :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comment section sometimes shows the same comments from previous loads
3 participants