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

Only load app routes if the app has already been loaded #18109

Merged
merged 1 commit into from
Aug 10, 2015

Conversation

RobinMcCorkell
Copy link
Member

Fixes #18095

If an app isn't loaded when the router tries to load routes, it marks itself as 'not loaded', so the next time a route is requested any non-loaded routes attempt to get loaded again.

cc @schiesbn @LukasReschke @PVince81 @DeepDiver1975

@RobinMcCorkell RobinMcCorkell added this to the 8.2-current milestone Aug 6, 2015
@scrutinizer-notifier
Copy link

A new inspection was created.

@ghost
Copy link

ghost commented Aug 6, 2015

🚀 Test PASSed.🚀
chuck

if (!\OC_App::isAppLoaded($app)) {
// app MUST be loaded before app routes
// try again next time loadRoutes() is called
$this->loaded = false;
Copy link
Member

Choose a reason for hiding this comment

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

hmmm ... this might have a negative impact on perf? @icewind1991

Copy link
Member Author

Choose a reason for hiding this comment

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

This variable shortcuts loading all routes, but even when set to false each set of routes (an individual app) doesn't get reloaded due to the check on line 152: if (!isset($this->loadedApps[$app])) {

Copy link
Contributor

Choose a reason for hiding this comment

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

While this helps loading the normal routes, it does not help loading ocs routes of apps.
I will make a second PR fixing this.

@RobinMcCorkell
Copy link
Member Author

@bartv2 @icewind1991 Please review, this fixes a regression

@icewind1991
Copy link
Contributor

👍 looks good

@DeepDiver1975
Copy link
Member

👍

DeepDiver1975 added a commit that referenced this pull request Aug 10, 2015
Only load app routes if the app has already been loaded
@DeepDiver1975 DeepDiver1975 merged commit 54aa57b into master Aug 10, 2015
@DeepDiver1975 DeepDiver1975 deleted the fix-router-app-loaded branch August 10, 2015 19:42
@RobinMcCorkell
Copy link
Member Author

This problem has manifested itself again...

Displaying the upgrade page results in the Router trying to load all app routes, even though no apps are loaded during the upgrade. This leads to a white screen when an upgrade is required: #15914 (comment)

@DeepDiver1975 @icewind1991 @schiesbn We have two options - re-merge this patch, or put a dirty needUpgrade() check before getting all app routes. Thoughts?

@PVince81
Copy link
Contributor

Or revert this https://github.com/owncloud/core/pull/17961/files#diff-66338aea9c5877c3368c5c7b0ed484ebR69 and not call linkToRoute too early. This is what originally produced the series of fixes to try and make the router work earlier than normal.

@RobinMcCorkell
Copy link
Member Author

@PVince81 That was the original problem, fixed in #18202. This is more fundemental, and has been an issue in ownCloud for a while now. It's amazing it hasn't blown up yet - apparently according to @LukasReschke it has a few times.

Basically, somewhere in the upgrade code path, a Router is needed, which tries to load app routes, regardless of whether the app is loaded or not yet.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[regression] [master] App routes are loaded before the app itself
6 participants