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

Support ranges with two dates for invalidateArchivedReports API call #20413

Merged
merged 9 commits into from Mar 23, 2023

Conversation

bx80
Copy link
Contributor

@bx80 bx80 commented Mar 2, 2023

Description:

Fixes #20400

invalidateArchivedReports API calls with specific date ranges were failing with an invalid date error due to the was the date string was being processed:

/index.php?module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=1&period=range&dates=2023-01-01,2023-03-03&token_auth=xxx

This PR adds explicit handling for specific date ranges.

@bx80 bx80 added Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Mar 2, 2023
@bx80 bx80 added this to the 4.13.4 milestone Mar 2, 2023
@bx80 bx80 self-assigned this Mar 2, 2023
@bx80 bx80 linked an issue Mar 2, 2023 that may be closed by this pull request
@bx80 bx80 added the Needs Review PRs that need a code review label Mar 8, 2023
@sgiehl
Copy link
Member

sgiehl commented Mar 9, 2023

@bx80 Was there any reason for putting this into Matomo 4? Maybe we should move this to Matomo 5 instead. Btw. would be good to add new test cases.

@bx80 bx80 modified the milestones: 4.14.0, 5.0.0 Mar 13, 2023
@bx80 bx80 changed the base branch from 4.x-dev to 5.x-dev March 13, 2023 00:44
@bx80 bx80 force-pushed the m20400-invalidate-api-range branch from 419c8e3 to 05a9213 Compare March 13, 2023 00:55
@github-actions
Copy link
Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Mar 20, 2023
@mattab mattab added the 5.0.0 label Mar 23, 2023
@sgiehl
Copy link
Member

sgiehl commented Mar 23, 2023

@bx80 I had another very close look to the API and actually I think the changes were not really needed. At least not that way.
The method was already able to parse ranges, but they are actually expected them to be passed as array.
A small adjustment was actually enough to also support ranges passed as string and to fix errors thrown for some invalid dates.
I'll push a change for that. Feel free to have a look and merge it if that works for you :-)

@sgiehl sgiehl force-pushed the m20400-invalidate-api-range branch from b0ba65d to 34c84b7 Compare March 23, 2023 15:54
@bx80
Copy link
Contributor Author

bx80 commented Mar 23, 2023

Nice spot 👍

@bx80 bx80 merged commit ae0a355 into 5.x-dev Mar 23, 2023
17 of 19 checks passed
@bx80 bx80 deleted the m20400-invalidate-api-range branch March 23, 2023 20:38
@sgiehl sgiehl removed Needs Review PRs that need a code review Stale The label used by the Close Stale Issues action labels Mar 24, 2023
@sgiehl sgiehl removed the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label May 16, 2023
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.
Projects
None yet
3 participants