Skip to content

Conversation

@mahamakifdar19
Copy link
Contributor

@mahamakifdar19 mahamakifdar19 commented Nov 6, 2025

Description
Issue:
After the recent merge of PR #1635 the LPR page became unresponsive on production due to an infinite API call loop. The root cause was that on AdminSearchForm the searchEnrollmentsList was being called inside a useEffect with the function itself in the dependency array. Since the function was recreated on every render, React treated it as a new dependency each time, causing useEffect to run repeatedly and trigger endless API calls.

Fix:
This PR fixes the infinite API call issue on the LPR page by passing the searchEnrollmentsList function directly to AdminSearchForm instead of recreating it on each render. This prevents the function from triggering repeatedly and resolves the unresponsiveness observed in production.

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.10%. Comparing base (b0e31a2) to head (594f3d5).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1717      +/-   ##
==========================================
- Coverage   87.10%   87.10%   -0.01%     
==========================================
  Files         780      780              
  Lines       17761    17760       -1     
  Branches     3734     3728       -6     
==========================================
- Hits        15471    15470       -1     
  Misses       2215     2215              
  Partials       75       75              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mahamakifdar19 mahamakifdar19 force-pushed the maham/fix-search-enrollments-list-dependency branch from 99d5e56 to da53733 Compare November 6, 2025 10:44
@mahamakifdar19 mahamakifdar19 force-pushed the maham/fix-search-enrollments-list-dependency branch from da53733 to 594f3d5 Compare November 6, 2025 12:34
@mahamakifdar19 mahamakifdar19 merged commit 50158c8 into master Nov 6, 2025
9 checks passed
@mahamakifdar19 mahamakifdar19 deleted the maham/fix-search-enrollments-list-dependency branch November 6, 2025 12:40
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.

3 participants