-
Notifications
You must be signed in to change notification settings - Fork 780
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
"Content with characters ', " or & may need to be escaped with three brackets" unnecesary warning #965
Comments
I am having this problem as well and would like this to change for the same reasons as @noway mentioned. I did see a function called 'setHideWarnings' in the helper, but not sure how to use this. |
FWIW, #932 adds a @thinkingserious The above not withstanding, #790 and #932 should both be reverted because, frankly, this feature is completely broken as it stands.
Fundamentally, the problem here is that the JS client code is being overly aggressive with these warnings because it doesn't know which tokens are triple-bracketed in the template. For developers that like clean logs (pretty much all of us), this is alarming and frustrating. This warning logic should either be removed or moved to the server and only applied for double-bracketed tokens. |
@broofa just so you know, I have templates that use exclusively triple brackets. I still get this warning! |
I'm experiencing the same thing. We have automated check-in/confirmation emails and these warnings are polluting our server logs. I've found that you can potentially hide any warnings that might surface with a UPDATE: I tried to the above |
@thakichowdhury it turns out your suggestion doesn't work currently. The latest release of the SDK on NPM is May 6, 2019. The functionality was added in this commit 10 days later. |
have anyone found a solution for this? |
@broofa It seems like that is not the case. I'll try to reach out to dx@sendgrid.com to see if a new release can be made. |
@ErwinAI thank you for this. If you hear anything back please let us know. |
I'm also facing this issue, did you get anything back from them @ErwinAI? |
Is it just a warning? I my case it's error. It breaks the code and not sending the email |
We still have this polluting our logs, also in some templates that exclusively use triple brackets. Anyone seen any fixes for this being worked on? |
Fixed by #932 which was included in the 6.5.0 release. |
Well this sent me off on a wild goose chase, trying to find faulty characters.... >.< |
@sendgrid/mail": "^7.2.5 |
@Kostanos Are you hiding the warnings? https://github.com/sendgrid/sendgrid-nodejs/blob/main/docs/use-cases/hide-warnings.md |
I missed this one. It works. I hope it will not disable some important warnings. |
I added Is anyone able to shed some light on this? |
Warning still showing up as of version 7.6.0 Using only one instance of triple handlebars (none doble) on a dynamic template, but perhaps it's the specific use case?
Both versions show the warning |
@LukeXF @AngelFHC It looks like the library doesn't consider the content of the templates. It is just checking the template data for specific characters]( sendgrid-nodejs/packages/helpers/classes/mail.js Lines 313 to 317 in 6a7fb30
I mean, it's useful, but perhaps should only be displayed once per process execution: https://nodejs.org/docs/latest-v16.x/api/process.html#avoiding-duplicate-warnings |
Issue Summary
Content with characters ', " or & may need to be escaped with three brackets
is logged even if I have {{{ 3 brackets in the templatesThe bug has been introduced here: #790
I'm trying to keep my logs clean so that i can grep them and look at them, and this seems to be quite a thing which pops out unnecessarily. I also use my own debug.js-based logger, so a wild console.log is something that straight away goes against my logging policies. I appreciate the warning, but after I fixed the handlebars template it is still complaining to me.
Steps to Reproduce
Technical details:
The text was updated successfully, but these errors were encountered: