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

Cache final result of update check #7562

Merged
merged 1 commit into from
Dec 19, 2017
Merged

Conversation

MorrisJobke
Copy link
Member

If the parsed data is not a valid response we should not cache it and only cache the preprocessed result set.

Fixes #7442

This method is called in

$data = $this->updater->check();

If the $data instead of $tmp is cached, then the returned value in the first call and the second call could be different, because a different object is cached causing the array access error in #7442.

I also added a unit test to verify that a missing attribute still results in a proper result with all keys.

If the parsed data is not a valid response we should not cache it and only cache the preprocessed result set.

Fixes #7442

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

Makes sense

@codecov
Copy link

codecov bot commented Dec 18, 2017

Codecov Report

Merging #7562 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master    #7562      +/-   ##
============================================
- Coverage     51.18%   51.17%   -0.01%     
  Complexity    24874    24874              
============================================
  Files          1601     1601              
  Lines         94701    94700       -1     
  Branches       1368     1368              
============================================
- Hits          48474    48467       -7     
- Misses        46227    46233       +6
Impacted Files Coverage Δ Complexity Δ
lib/private/Updater/VersionCheck.php 92.1% <100%> (-0.21%) 7 <0> (ø)
core/js/js.js 62.98% <0%> (-0.57%) 0% <0%> (ø)
apps/files_trashbin/lib/Trashbin.php 72.28% <0%> (-0.25%) 136% <0%> (ø)

@rullzer rullzer merged commit e550a3d into master Dec 19, 2017
@rullzer rullzer deleted the fix-wrongly-cached-result branch December 19, 2017 09:12
@MorrisJobke MorrisJobke mentioned this pull request Jan 2, 2018
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants