Skip to content

fix(speakers): Avoid refetching activities count unnecessarily#993

Open
mulldug wants to merge 1 commit into
masterfrom
fix/speaker-activities-count-targeted-refresh
Open

fix(speakers): Avoid refetching activities count unnecessarily#993
mulldug wants to merge 1 commit into
masterfrom
fix/speaker-activities-count-targeted-refresh

Conversation

@mulldug

@mulldug mulldug commented Jun 19, 2026

Copy link
Copy Markdown

ref: https://app.clickup.com/t/9014802374/86b9b1qrk

Avoid refetching activities count on page, sort, and search changes

Activities count only depends on filters, not on pagination, sort order, or search term. Extracted getSpeakersActivitiesCount and getSubmittersActivitiesCount as standalone exported actions and moved the dispatch to getBySummit in the page, skipping it for handlePageChange, handleSort, and handleSearch.

Summary by CodeRabbit

  • Performance Improvements
    • Optimized activity count refreshing for speakers and submitters list pages to avoid unnecessary re-fetches during pagination, sorting, and search operations.

…earch changes

Activities count only depends on filters, not on pagination, sort order, or search term.
Extracted getSpeakersActivitiesCount and getSubmittersActivitiesCount as standalone exported
actions and moved the dispatch to getBySummit in the page, skipping it for
handlePageChange, handleSort, and handleSearch.
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6c2830ba-c32f-4cc6-89d1-0dd5e0d603c9

📥 Commits

Reviewing files that changed from the base of the PR and between 23217a9 and 5446ee6.

📒 Files selected for processing (3)
  • src/actions/speaker-actions.js
  • src/actions/submitter-actions.js
  • src/pages/summit_speakers/summit-speakers-list-page.js

📝 Walkthrough

Walkthrough

getSpeakersActivitiesCount and getSubmittersActivitiesCount are converted from private, parameter-heavy functions into exported async thunks that derive currentSummit and accessToken from Redux state. Their inline dispatch inside the list-fetch thunks is removed. The speakers list page integrates the new thunks and adds a refreshCount flag to skip count requests during paging, sorting, and search.

Changes

Activities Count Thunk Extraction and Selective Refresh

Layer / File(s) Summary
Export activities-count thunks from speaker/submitter actions
src/actions/speaker-actions.js, src/actions/submitter-actions.js
getSpeakersActivitiesCount and getSubmittersActivitiesCount are rewritten as exported async thunks that read currentSummit and accessToken from Redux state and call parseFilters internally. The inline dispatch of these functions inside getSpeakersBySummit and getSubmittersBySummit is removed.
Selective count refresh in speakers list page
src/pages/summit_speakers/summit-speakers-list-page.js
Imports and connects the two new exported thunks. getBySummit gains an optional refreshCount flag (default true) that conditionally dispatches the count action. handlePageChange, handleSort, and handleSearch pass refreshCount=false to suppress count re-fetches during navigation and filtering interactions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • fntechgit/summit-admin#933: Directly modifies the same getSpeakersActivitiesCount, getSubmittersActivitiesCount, and get*BySummit dispatch behavior that this PR refactors.

Suggested reviewers

  • smarcet

Poem

🐇 Hop, hop, the count thunk leaps free,
No longer tucked inside the list spree!
Page, sort, and search skip the tally with grace,
While fresh loads still count at a rabbity pace.
Redux state whispers the summit's id,
Clean exports and flags — oh, what joy to see! 🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main optimization: avoiding unnecessary refetches of activities count in the speakers section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/speaker-activities-count-targeted-refresh

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant