Skip to content

Stats: Fix archive list showing incorrect totals#108578

Draft
kangzj wants to merge 1 commit intotrunkfrom
fix/stats-archive-max-value
Draft

Stats: Fix archive list showing incorrect totals#108578
kangzj wants to merge 1 commit intotrunkfrom
fix/stats-archive-max-value

Conversation

@kangzj
Copy link
Contributor

@kangzj kangzj commented Feb 8, 2026

Fixes STATS-211

Proposed Changes

  • Set max: 50 for the stats query in both the traffic page module and the summary/details page

Why are these changes being made?

The Archive tab in the top posts module was showing different totals than the view details page because they were using different max values for the backend API:

  • The module card on the traffic page used max: 10
  • The summary/details page used max: 0 (which fetches all results)

This caused a mismatch in the displayed totals. By setting max: 50 in both places, we ensure consistent results between the module card and the view details page.

Testing Instructions

  1. Navigate to Stats > Traffic on a site with archive content
  2. Switch to the Archive tab in the top posts module
  3. Note the total count shown
  4. Click "View details" to go to the summary page
  5. Verify the total count matches what was shown in the module card

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

The Archive tab in the top posts module was showing different totals
than the view details page because they were using different max
values for the backend API. The module card used max=10 while the
summary page used max=0 (all results).

This fixes the issue by setting max=50 in both places to ensure
consistent results.
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/stats-archive-max-value on your sandbox.

@kangzj kangzj self-assigned this Feb 9, 2026
@kangzj kangzj added [Feature] Stats Everything related to our analytics product at /stats/ Stats labels Feb 9, 2026
@kangzj kangzj requested a review from a team February 9, 2026 21:07
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Stats Everything related to our analytics product at /stats/ Stats [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants