Skip to content

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

Merged
DeepDiver1975 merged 1 commit into
masterfrom
fix-router-app-loaded
Aug 10, 2015
Merged

DeepDiver1975 merged 1 commit into
masterfrom
fix-router-app-loaded

Conversation

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

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
Copy Markdown

A new inspection was created.

@ghost

ghost commented Aug 6, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor Author

@bartv2 @icewind1991 Please review, this fixes a regression

@icewind1991

Copy link
Copy Markdown
Contributor

👍 looks good

@DeepDiver1975

Copy link
Copy Markdown
Contributor

👍

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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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