@diosmosis opened this Pull Request on May 11th 2021 Member

Description:

This solves a very convoluted bug involving CustomReports:

  • user creates a custom report with just unique visitors and places it in the visitors overview
  • user views a large range (eg, 2021-01-01,2021-03-31)
  • the first request on the page, for visits summary data succeeds creating plugin specific range archives with data
  • the custom report request is triggered
  • the custom report data is successfully requested
  • since its for a range, CustomReports decides we're not allowed to archive unique visitors (because of an INI config setting) and removes it from the columns_to_display
  • Visualization tries to get the site summary to build totals data
  • this issues an API request to API.get for a range, using columns_to_display, which is empty
  • API.get issues a request to VisitsSummary.get w/ 0 columns
  • VisitsSummary.get creates an Archive instance and calls getDataTableFromNumeric() with an empty array for $names
  • since it's a range, Archive.php tries to launch archiving. since no data is requested, there is no specific plugin to load, so we assume it's the all plugins archive. so we create a 'done' archive.
  • PluginsArchiver does nothing, since there is nothing being requested
  • then we finalize the 'done' archive w/ the DONE_OK flag
  • now on the next request, all archive requests to got the new 'done' archive for the range, even though it contains nothing
  • the user sees 0 for all metrics for the range

This is fixed in this PR by not launching archiving if nothing is requested in Archive.php.

Review

  • [ ] Functional review done
  • [ ] Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • [ ] Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • [ ] Security review done see checklist
  • [ ] Code review done
  • [ ] Tests were added if useful/possible
  • [ ] Reviewed for breaking changes
  • [ ] Developer changelog updated if needed
  • [ ] Documentation added if needed
  • [ ] Existing documentation updated if needed
This Pull Request was closed on May 11th 2021
Powered by GitHub Issue Mirror