8000 [Router] Decorating router might miss WarmableInterface · Issue #23403 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Router] Decorating router might miss WarmableInterface #23403

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

Closed
linaori opened this issue Jul 5, 2017 · 1 comment
Closed

[Router] Decorating router might miss WarmableInterface #23403

linaori opened this issue Jul 5, 2017 · 1 comment

Comments

@linaori
Copy link
Contributor
linaori commented Jul 5, 2017
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.2.x

When using the FrameworkBundle, a new router will be added that extends the router from the routing component. This router adds the WarmableInterface, which causes the RouterCacheWarmer to warm the cache. However, if you decorate the router based on the component, rather than the FrameworkBundle, you'll never get hinted to use the WarmableInterface, which results in not warming the cache properly in Symfony.

While the current behavior is correct, it might unknowingly "break" the cache warmup for the router, if the WarmableInterface is not implemented on the decorating router. This would be the fix for any decorator: linaori/http-bundle#20. I'm not sure what a good fix would be in Symfony. I'd like to see a warning of sorts, but I have no idea how to efficiently let the developer know about this.

@nicolas-grekas
Copy link
Member

we might just log something in the "else" case in the warmer ?

@fabpot fabpot closed this as completed Jan 26, 2018
fabpot added a commit that referenced this issue Jan 26, 2018
…terface without warmupInterface in RouterCacheWarmer (Simperfit)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[FrameworkBundle] add a notice when passing a routerInterface without warmupInterface in RouterCacheWarmer

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yesish
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #23403
| License       | MIT
| Doc PR        | none

I'm adding a test to RouterCacheWarmer since there were none.

Commits
-------

daa7f02 [FrameworkBundle] add a notice when passing a routerInterface with warmupInterface in RouterCacheWarmer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0