Skip to content

Fix/improve behaviour of update check visualization #21290

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

Merged
merged 10 commits into from
Sep 27, 2023
Merged

Fix/improve behaviour of update check visualization #21290

merged 10 commits into from
Sep 27, 2023

Conversation

mneudert
Copy link
Member

Description:

Additional work was done to get the manual check working. The parsing of the result was not yet updated for the new vue component structure and flagged every response as "no update available".

Fixes #21259.

Review

@mneudert mneudert self-assigned this Sep 20, 2023
@mneudert mneudert force-pushed the m17190 branch 4 times, most recently from cddf824 to 04f17a7 Compare September 25, 2023 20:26
@mneudert mneudert added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Sep 25, 2023
@mneudert mneudert marked this pull request as ready for review September 25, 2023 21:04
@mneudert mneudert requested a review from a team September 25, 2023 21:05
@mneudert mneudert removed their assignment Sep 25, 2023
@mneudert mneudert added this to the 5.0.0 milestone Sep 25, 2023
@caddoo caddoo assigned caddoo and unassigned caddoo Sep 25, 2023
@michalkleiner michalkleiner self-assigned this Sep 26, 2023
@michalkleiner michalkleiner removed their assignment Sep 26, 2023
@michalkleiner
Copy link
Contributor

Yet to run it locally but code changes look good from my perspective.

@mneudert mneudert requested a review from a team September 26, 2023 11:36
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments. Otherwise tests are looking good and locally it worked without problems.

Option::set(self::LAST_TIME_CHECKED, $lastTimeChecked, $autoLoad = 1);
}

Option::set(self::LAST_CHECK_FAILED, $hasLastCheckFailed, $autoLoad = 1);
Option::set(self::LATEST_VERSION, $latestVersion);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to update the version if the last check failed? Shouldn't we maybe keep the previous record in that case?

Copy link
Member Author

@mneudert mneudert Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, it should not be worth setting the version if the check failed.

While it would prevent having "not the most up-to-date version" displayed it would also hide a previously available update if the request failed.

I also removed the autoLoad flag from the new option. After some previous code changes it is only ever read in the manual update action, no need to have it available for reading otherwise.

Comment on lines 2 to 4
{% set test_latest_version_available="4.0.0" %}
{% set test_piwikUrl='https://demo.matomo.org/' %}
{% set test_lastUpdateCheckFailed = false %}
{% set test_latest_version_available = '6.0.0' %}
{% set test_piwikUrl = 'https://demo.matomo.org/' %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess those variables are only for testing purpose and in order to use them the test_ prefix needs to be removed? Not sure if we actually want to keep such things. If we want to provide an easy way to allow to overwrite those variables for testing purpose we should rather use an event or DI to allow that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed them. They were existing for 10 years, but with the new UI tests, that are setting the options to specific values, there should be no benefit to keeping them 👍

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now

@sgiehl sgiehl merged commit 8ec64ff into 5.x-dev Sep 27, 2023
@sgiehl sgiehl deleted the m17190 branch September 27, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Development

Successfully merging this pull request may close these issues.

Matomo update check times out at times
4 participants