-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] Need to clear cache when updating Annotation Groups on Entities #40856
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
Conversation
@@ -51,14 +51,14 @@ public function getMetadataFor($value) | |||
return $this->loadedClasses[$class]; | |||
} | |||
|
|||
$key = rawurlencode(strtr($class, '\\', '_')); | |||
$metadata = $this->decorated->getMetadataFor($value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this basically circumventing the cache now that the metadata is loaded here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can switch to another implementation of debug is enabled on the framework bundle extension. Need some help here so we can fix this issue that only happens in dev.
Closing as this cannot be the correct implementation. In #40034, I'm suggesting to unregister the |
Thanks here. @nicolas-grekas could you guide us (me ^^) to where is registered this service. It is a part of Symfony I never dig into. |
@jc-oclock , did a new PR with Nicolas suggestion about this: #41961 You can take a look. If you have any doubts let me know. |
…Groups on Entities (monteiro) This PR was squashed before being merged into the 5.3 branch. Discussion ---------- [Serializer] Need to clear cache when updating Annotation Groups on Entities | Q | A | ------------- | --- | Branch? | 5.3 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #40034 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT Sample project that mimics this behavior: https://github.com/monteiro/PR-40856 The solution was suggested by `@nicolas`-grekas [here](#40856). Commits ------- a6829be [Serializer] Need to clear cache when updating Annotation Groups on Entities
Thanks a lot. I checked the PR, if I understand well :
Is it ok ? Thank you for bringing me light in a part that was still obscure to me 💡 🙏🏻 |
Sample project that mimics this behavior: https://github.com/monteiro/PR-40856
The solution proposed is just appending an hash of the metadata, so it gets refreshed every time there is a change.
Don't know if this impacts performance, but fixes the issue in development which does not refresh the metadata of the annotation during development.