Skip to content

Shravya/bugfix/duplicate_pagination_4196#5204

Open
ShravyaKudlu wants to merge 4 commits intodevelopmentfrom
shravya/bugfix/ImprovePagination/#4196
Open

Shravya/bugfix/duplicate_pagination_4196#5204
ShravyaKudlu wants to merge 4 commits intodevelopmentfrom
shravya/bugfix/ImprovePagination/#4196

Conversation

@ShravyaKudlu
Copy link
Copy Markdown
Contributor

@ShravyaKudlu ShravyaKudlu commented Apr 26, 2026

Description

Fixes #4196
821 Phase - 3: Fix Comment Duplication, Improve Pagination, and Allow Multiple Replies to Stay Open Related PR: #4196
image
image

Related PRS (if any):

This frontend PR is related to the development backend PR.

Main changes explained:

  1. Duplicate prevention - Added ID check before appending:
    const existingIds = new Set(comments.map(c => c.id));
    const newComments = result.comments.filter(c => !existingIds.has(c.id));

  2. Unique IDs - Changed from 100 + page * 10 + 1 to (page - 1) * 1000 + page * 2 to prevent collisions

  3. Total count - Now accumulates instead of replacing:
    setTotalComments(prevTotal => prevTotal + newComments.length);

  4. Reply interactions - Already worked correctly with comment IDs, no changes needed

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache, and local storage
  4. log as admin user
  5. go to path→ "/communityportal/activity/1/engagement/Comments"
  6. verify Load more comments, works, mo duplicates are shown, and its fast and performant and 2 replies are visible in the screen

Screenshots or videos of changes:

image

Note:

Include the information the reviewers need to know.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 26, 2026

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit f155945
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69edab741120520008e91c5f
😎 Deploy Preview https://deploy-preview-5204--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ShravyaKudlu ShravyaKudlu added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Apr 26, 2026
@sonarqubecloud
Copy link
Copy Markdown

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

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant