Share feedback, ideas and get community help

Updated 5 months ago

Bug with using inline evaluation of javascript in text string

At a glance

A community member found a bug where using an inline format to display a number one higher than the current number caused the value of the current number to display too early in the text. They provided a sample bot to demonstrate the issue and explained their understanding of the problem - that the platform adjusts the index by 4 to account for the opening and closing curly brackets, but does not properly handle the extra symbols used in the inline function, causing a 6-character offset in the display of the current number value.

Another community member acknowledged the issue, indicated they were checking it, and later confirmed the problem was fixed and the update would be available in 10 minutes. The original poster expressed their gratitude for the fix.

Useful resources
Ok, so I found a weird bug.

I wanted to display a number that was one higher than the current number (as an option for the minimum amount a user can enter to increase the number)

Intead of precalculating that number and storing in another variable before the text, I used the inline format of {{={{MyVar}}+1=}}.

Later in the text I display {{MyVar}}

Well, it displays the value for {{MyVar}} about 6 characters too early. So for example:

"This is the increased value {{={{MyVar}}+1=}} and then here is the starting value {{MyVar}}."

Let's say the value was 12 this would display as:

"This is the increased value 13 and then here is the 12value {{MyVar}}."

I made a bot to show how it was behaving in the code I was creating and then decided to also just put in this simple example since I think I know what is happening- (sample bot URL in first comment).

I think typebot will adjust the index by 4 to account for the opening and closing {{CurlyBrackets}} on any variable. BUT when there are EXTRA symbols when an inline function is used, typebot is not set up to account for those and so the {{=Inline curly brackets and equals signs=}} throw off the display on the final string of any variables that come after the inline code by 6 because they were removed but the index wasn't adjusted for those with regards to inserting the variables...

Hope I explained that correctly. I was trying to figure out what was going on as I slept and in the shower this morning and I think this is it.

Check it @Baptiste and let me know when it is fixed should be a quick one.
g
B
5 comments
Thanks for the reproduction, I'm checking what's wrong
Alright, fixed!
Available in 10 min
Add a reply
Sign up and join the conversation on Discord