Skip to content

Fix: Duplicates when click spam loading elements in FT (3/3)#9412

Open
Shadorc wants to merge 4 commits into
FreeTubeApp:developmentfrom
Shadorc:fix/fetch-more-duplicate-3
Open

Fix: Duplicates when click spam loading elements in FT (3/3)#9412
Shadorc wants to merge 4 commits into
FreeTubeApp:developmentfrom
Shadorc:fix/fetch-more-duplicate-3

Conversation

@Shadorc

@Shadorc Shadorc commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

partially addresses #3541 (comments)
closes #3541 if all three MRs are merged

Description

Same remarks from #9383 apply here + this comment #9383 (comment).
Those MRs are independent and can be merged in any order.

I've slightly refactored getPostCommentsInvidious to better match similar methods.

Screenshots

2026-07-12.14-34-25.mp4

New changes related to loading state
https://github.com/user-attachments/assets/68865337-3d93-4e32-b2a2-618089a798e1

Testing

More comments - Manual:

  1. Go to any video with enough comments to display "Load more comments"
  2. Click very fast on the "Load more comments" button at the bottom of the comments section
  3. Check that the button disappears when the comments are loading
  4. Check that no duplicated comments are shown once loaded

More comments - Automatic:

  1. Enable "Auto Load Next Page" setting
  2. Go to any video with enough comments to display "Load more comments"
  3. Scroll to the bottom of the comments section
  4. Check that the button disappears when the comments are loading
  5. Check that no duplicated comments are shown once loaded

View replies - Single:

  1. Go to any video with a comment showing "View n replies"
  2. Click very fast on the "View n replies" button (you can add a delay in getCommentReplies to make it easier)
  3. Check that the button is changed to a "Loading replies..." text
  4. Check that no duplicated replies are shown once loaded
  5. Check that the "Loading replies..." text is replace by "Hide n replies"
  6. Check that clicking "Hide n replies" and then "Show n replies" again does not shsow "Loading replies..."

View replies - Multiple:

  1. Go to any video with several comments showing "View n replies"
  2. Click very fast on several "View n replies" buttons (you can add a delay in getCommentReplies to make it easier)
  3. Same steps as above, applied to all clicked buttons

More replies:

  1. Go to a comment with enough replies to show "Show More Replies"
  2. Click very fast on "Show More Replies"
  3. Check that the button is changed to a "Loading replies..." text
  4. Check that no duplicated replies are shown once loaded

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) July 12, 2026 12:47
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 12, 2026
@PikachuEXE

Copy link
Copy Markdown
Member

Can we also make "View N replies" shows some loading state specific text (better then hidden coz user can request replies for multiple comments at the same time (and maybe remove the toast for Getting comments replies if that's done

@Shadorc

Shadorc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

"View N replies" is the only text in my three MRs that I don't hide, the behaviour is the same as before, the text is here while the replies have not loaded.
However, I can remove the toast and show some loading texts!

@PikachuEXE

Copy link
Copy Markdown
Member

Ya I don't need the text to be hidden unlike those "next page/load more" buttons
Also might need the same (loading text) for Show More Replies (or just hide if that's easier

auto-merge was automatically disabled July 13, 2026 07:36

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) July 13, 2026 07:36
@Shadorc

Shadorc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

I have added a loading message for "View n replies" and "Show more replies"
I have removed all now non-used translations
Test cases updated, and video added to show new behaviour

@Shadorc

Shadorc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

I didn't include it in the tests because there are already so many, but it behaves similarly in the Posts tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Duplicates when click spam loading elements in FT

2 participants