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

The cache is not always updated when a plugin is installed or updated #143

Closed
alberto234 opened this issue Oct 15, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@alberto234
Copy link

commented Oct 15, 2015

I stumbled upon this issue which occurs with plugins that have custom routes defined in their routing.yml file. The behavior is that after the plugin is installed, navigating to the custom route produces in "Not Found" message. After a while the route starts working.

I tested with Mibew 2.1.0 using the Wurrd Authorization API plugin. This issue is intermittent as I couldn't consistently reproduce it. I also couldn't determine how long the "while" is before it starts working. However, a workaround is to delete the "stash" directory under /cache. Navigating to the custom route will cause the cache to be regenerated this time with containing the route information.

As I haven't been able to consistently reproduce it, this is more of a question to you guys.

  1. Is a plugin developer responsible for refreshing the cache after install?
    • If so, how can one do so?
  2. Does the cache refresh itself after a set interval, or is that just some coincidence in my testing?

Thanks,
Eyong

@JustBlackBird

This comment has been minimized.

Copy link
Member

commented Oct 16, 2015

  1. Mibew's Core responsible for cache refreshing. Routes list is removed from cache anytime a plugin is enabled or disabled.
  2. If we talk only about routing its cache has no expiration time.
@alberto234

This comment has been minimized.

Copy link
Author

commented Oct 16, 2015

I appreciate the responses.
Could you point me to a section of code to where the refresh happens? Since this issue is intermittent I want to look at it some more before reporting a bug if necessary.

Thanks,
Eyong

@JustBlackBird

This comment has been minimized.

Copy link
Member

commented Oct 16, 2015

Sure. Here are cache clearing when:

Cache will filled up again then a route is requested.

@alberto234

This comment has been minimized.

Copy link
Author

commented Oct 16, 2015

Thanks. Will do some testing and provide an update.

@alberto234

This comment has been minimized.

Copy link
Author

commented Oct 24, 2015

I've been able to reproduce consistently now. Here are the steps:

  1. Use a plugin that uses configuration properties, and that exposes a route.
  2. Copy the plugin files to the plugin directory
  3. Do not modify the config.yml file.
  4. Go to the plugin page and enable the plugin. The state will say "not initialized"
  5. Navigate to one of the plugin's routes. A "Not found" message will be returned.
  6. Now add the properties to the config.yml file.
  7. Refresh the plugins page. The state will now say "working"
  8. Navigate to the plugin route from above.

If this issue exists, the route will still be returned as "Not found"
If this issue is fixed, the route should start working.

The issue here is that if the plugin is not properly configured, the plugin enable logic doesn't get to clear the cache. When the config properties are entered, the plugin starts working without the cache being cleared. A fix would be either to force the user to enable the plugin again, or to clear the cache if the plugin's state is changing from not initialized to working.

Eyong

@JustBlackBird JustBlackBird added bug and removed question labels Oct 26, 2015

@JustBlackBird

This comment has been minimized.

Copy link
Member

commented Oct 26, 2015

Yep, it seems to be a bug. We have to figure out how to solve the problem.

@faf faf referenced this issue Dec 29, 2016

Merged

Fix 143 #184

@faf faf closed this in 7f6b193 Dec 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.