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

Update appinfo cache only if the app version is newer #39108

merged 2 commits into from
Sep 6, 2021


Copy link


Cache app info for the appid only if the version is newer.

Related Issue


Motivation and Context

If there are multiple versions of the same app in different locations, we're expected to use the one with the latest version.
Note that the problem happens having a local cache active.

How Has This Been Tested?

  1. Having at least 2 different app locations, install the same app (not the latest version) in all of them
  2. In the config.php file, set the first app location as writable
  3. Update the app via occ market:upgrade <app>

There is no problem with the upgrade. The installed version in the DB is the latest one (downloaded from the market). Reloading the page doesn't trigger the "update needed" page.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)


  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

Copy link

update-docs bot commented Aug 12, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link
Member Author

There are no clear steps to reproduce the original problem, so it's difficult to foresee if this PR will fix the issue.
The provided steps in this PR are convoluted and unlikely to happen for common users. This means that it might not fix the problem affecting those users.
This PR fixes the issue caused by following the provided steps, so it's still worthy to merge.

Copy link

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

Plus changelog, then LGTM. Hopefully it fixes the issue. But it's a good thing either way.

lib/private/App/AppManager.php Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Sep 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link

@VicDeo VicDeo left a comment

Choose a reason for hiding this comment

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

Ready to go

@VicDeo VicDeo added this to the development milestone Sep 6, 2021
@VicDeo VicDeo merged commit c8db8a8 into master Sep 6, 2021
@delete-merged-branch delete-merged-branch bot deleted the fix_app_cache branch September 6, 2021 08:53
Copy link

jnweiger commented Dec 1, 2021

cannot reproduce the issue now, but the changes look indeed very promising. Thanks for the hard digging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

4 participants