-
Notifications
You must be signed in to change notification settings - Fork 4
Fix coco 4672 template processor race condition #39
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
base: develop-b2school
Are you sure you want to change the base?
Fix coco 4672 template processor race condition #39
Conversation
src/main/java/fr/wseduc/webutils/http/ProcessTemplateContext.java
Outdated
Show resolved
Hide resolved
| { | ||
| if (resourceName != null && !resourceName.trim().isEmpty()) | ||
| public void processTemplateWithLambdas(ProcessTemplateContext context, Handler<Writer> handler) { | ||
| context.lambdas(getLambdasFromRequest(context.request())); |
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.
En passant par public void renderTemplateView(final HttpServerRequest request, JsonObject params, String resourceName, Reader r, final int status, Map<String, Mustache.Lambda> lambdas) { j'ai l'impression qu'on fait 2 fois le boulot de getLambdasFromRequest
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.
oui c'et vrai
c4ba65d to
10ba9a4
Compare
d555e94 to
203bc65
Compare
17a826a to
257a49a
Compare
Description
Les TemplateProcessor largement utilisés dans le code ne sont pas thread safe au niveau des Lambda. On pourrait donc avoir des mélanges entre les paramètres de plusieurs utilisateurs lors de la génération de mail / notification / carte timeline etc… entre la langue, l’host, le thème ou le domaine => refactoring partiel pour corriger le problème. On conserve les anciennes API pour la retrocompatibilité avec les divers modules
Fixes
https://edifice-community.atlassian.net/browse/COCO-4672
Type of change
Please check options that are relevant.