Syntax error in generated code made by Wappler expression builder - Bug Report #1650028861778

OS info

  • Operating System : Mac OSX 21.4.0
  • Wappler Version : 4.8.0

Problem description

Syntax error in generated code made by Wappler expression builder when editing an existing expression that contains nested ternary operator operations.

Steps to reproduce

  1. I’m a new Wappler user, started to learn a few days ago. I stepped into this bug while following Ben’s tutorial here, when creating/editing expressions: https://youtu.be/2Axao8cBAhg?list=PLUjqTJN3byC9fUoXFnoNGlYBCBZOJUPca&t=1452

  2. Create a NEW expression in status cell, dynamic attribude “inner text” value

  3. Select Data Details -> status field

  4. Start expression builder and create the operations following ben’s video, I’ll replicate here:

  5. Add operator == with value 0

  6. right-click on value 0 and add “ternary operation”, set ? value with Active and : value with Archived (following Ben’s video for reference)

  7. Confirm “select” two times to close the dialogs and confirm the expression

  8. Having “app connect” selected here we can confirm that the expression is functioning regularly, now the “Status” field retrieve it’s value correctly from the database as we instructed in the expression.

  9. Now, I again click on “app connect” bolt in the same “inner text” value as before and open the expression builder WITHOUT TOUCHING ANYTHING, and as you can see below the ternary operation changed position and it’s not nested after the first == operator’s VALUE 0 (as we did before), but now it’s represented after the OPERATOR, so it’s not nested anymore.

  10. I then proceed to click “select” two times to close BOTH dialogues to save and confirm the expression’s value. At this point, the value “status” it’s not retrieved anymore, showing that something in our expression broke up after just re-opening and re-saving and closing dialogues.

  11. Now, I seem to have found what’s wrong there since wappler didn’t throw any error. So, again open the app-connect bolt of the same “inner text” value and click “code”, as you can see here lies an error in the code!!

  12. Now, since I’m a newbie about syntax, I will not try to explain nothing about how to “manually” fix the code, but I can say that I tried different combination of creating expression with nested ternary operators and ALWAYS got this buggy behaviour where the only solution for me is to delete the expression, recreate it and NEVER open it again.

  13. This means that if I have to make an edit to that kind of expressions that contains nested ternaty operations, I’m now forced to delete and recreate it from scratch

Hopefully I’m making a mistake here and that’s not a bug.

Thanks for the help folks! :slight_smile:

For some reason you have a closing bracket too much at the end ) - so just remove it.

I do understand, but this bracket is added automatically by Wappler following a simple open/close of the expression.

In my earlier reply I just forgot to add that if I remove the closing bracket then confirm and close the dialogs, the expression doesn’t work as expected because the ternary operation was changed by wappler when editing the created expression as explained in the report above.
I think this is could be an issue as I can’t find any fix other than deleting and re-doing the expression from scratch and NOT editing it after confirming and saving the first time.

Thanks for the patience @Teodor I deeply appreciate all the work all Wappler Team makes for us newbies :slight_smile:

Fixed in Wappler 5.1

1 Like