Closed e-t-l closed 4 months ago
Thank you for the detailed report. Unfortunately, I was not able to reproduce the issue. I'll try different scenarios to see if I can reproduce it. If you could isolate the issue further, that would really help.
There shouldn't be any differences when syncing templates with or without syntax errors. The sync itself (or the dashboard for that matter) does not parse or care about the Handlebars syntax. The way it works is:
dashboard > extension
sync events are batched, so it will take at least 1 second for the event to trigger. T1 (save the template to the database) + T2 (trigger sync, min 1s) + T3 (fetch the templates from the database)
.T1 + T2
), the extension will not fetch the new version of the template.I'm guessing your issue is probably related to this sync time (e.g., updated a template, closed the dashboard tab immediately).
About capitalizeAll
: it should work in #if
blocks just as well. I've just tested {{#if to.first_name}}{{capitalizeAll to.first_name}}{{/if}}
and it seems to be ok.
Hmm I left the dashboard tab open and waited more than several seconds after saving the template to re-syncing templates in the extension, so I don't think it's that...
Today it has now successfully synced all the template changes from yesterday, so the issue is gone for now. Also, I noticed a different template had {{#if to.first_name}}{{capitalizeAll to.first_name}}{{/if}}
working properly, so I deleted the identical line in the template that was throwing the error and replaced it with the one I copied from the good template. Even though both lines looked truly identical and I couldn't spot any typos, it now parses correctly. No idea what's going on there. I'll close this issue for now and reopen it if I can replicate the problem more reliably or figure out anything further about it.
Description
Steps to reproduce:
*I have a suspicion, although unlikely to be correct, that there is some issue with syncing the templates that occurs only when the handlebarjs syntax in the template is not valid. This may just be because the scenario where I am frequently editing and updating templates is when I'm trying to fix syntax errors, so when the bug occurs for me, it frequently leaves me stuck with a version of my template that produces a syntax error.
... For the record, the template that I originally tried was:
Hi {{#if to.0.first_name}}{{capitalizeAll to.0.first_name}}{{#if to.1.first_name}}
but that produced the syntax error:When I updated the template to just
Hi {{#if to.0.first_name}}{{to.0.first_name}}{{#if to.1.first_name}}
and saved it, that's when I encountered the bug. Even after refreshing and force-syncing my templates multiple times, it still produces the above error message whenever I try to insert that template.P.S. Do you know why
capitalizeAll
doesn't seem to work when used within an#if
block? It works fine outside of one.