Custom Client Side Formatter Getting Evaluated 4 Times

Wappler Version : 4.6.2
Operating System : W10
Server Model: NodeJS

Expected behavior

Any custom formatter, called on say click of a button, should evaluate the expression just once.

Actual behavior

The custom formatter is getting executed 4 times - consistently.

How to reproduce

Not sure if this can be reproduced.
I created a formatter and added console log in it. Called the formatter on button click, and no where else on the projecct.
Now, when I click the button, I can see 4 logs in console.
I have never seen this behaviour before, so maybe something has changed? Please help.

Have you seen this topic?

Please rename your local version of dmxAppConnect.js and test with the file there, to see if it fixes this.

Yes. I am aware of this, and was one of the first ones to see. As excited I am to try this out, haven’t found enough time yet. :sweat:

Well you can just quickly copy the file and test if it fixes this specific issue. Then you can revert back to the stable version …

Thanks for the motivation. Finally did the change. Speed improvements look amazing. And it solves an other issue that I am working on. But can’t deploy this to prod yet. :sweat_smile:

As for the custom formatter, its still getting called 4 times. So looks like some bug.

Yes, i also don't advise on doing this yet :slight_smile:

Maybe @patrick can take a look at your code here.

1 Like

How exactly are you using it, you call it in the dmx-on:click?

Yes. That’s correct.

@patrick Any progress on this?

I assume that is happens in both the latest stable version and the beta since on the behavior of events nothing is changed. The expressions on the events should only evaluate when the event is triggered, I wasn’t able to reproduce your problem. Perhaps you could send me the page where you have the problem in a private message.

This is going to be a tough one to share. Let me see what I can do.