Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] \Piwik\Archive\ArchiveInvalidator::removeInvalidationsSafely says idSites can be int, but that's not completely accurate #22673

Open
4 tasks done
snake14 opened this issue Oct 11, 2024 · 0 comments · May be fixed by #22674
Labels
Bug For errors / faults / flaws / inconsistencies etc. triaged

Comments

@snake14
Copy link
Contributor

snake14 commented Oct 11, 2024

What happened?

I noticed that custom reports were archiving even after being deleted. Debugging, I ended up finding that if a single site ID is passed as the idSites argument, the removeInvalidationsFromDistributedList method doesn't handle it properly because of a TypeError on line 690.

What should happen?

Since the comment block says that int is an allowed type for idSites, the removeInvalidationsFromDistributedList should handle that as well, or the removeInvalidationsSafely method should wrap it with an array before passing isSites on to removeInvalidationsFromDistributedList.

How can this be reproduced?

Using CustomReports 5.0.17 or earlier do the following:

  • Create a new report
  • Note that the option record named ReArchiveList was updated to add the newly created report
  • Delete the newly created report
  • Note that the option record named ReArchiveList was not updated
  • Note that archiving is done for the deleted report the next time archiving runs

Matomo version

5.x-dev

PHP version

8.1.30

Server operating system

Ubuntu 22.04

What browsers are you seeing the problem on?

Not applicable (e.g. an API call etc.)

Computer operating system

Ubuntu 22.04

Relevant log output

No response

Validations

@snake14 snake14 added the Bug For errors / faults / flaws / inconsistencies etc. label Oct 11, 2024
@snake14 snake14 linked a pull request Oct 11, 2024 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants