appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.64k stars 3.74k forks source link

[Bug]: Evaluations not taking place when the JS Function is freshly created and bound to a widget #33800

Open kamakshibhat-appsmith opened 5 months ago

kamakshibhat-appsmith commented 5 months ago

Is there an existing issue for this?

Description

Evaluations not taking place when the JS Function is freshly created and bound to a widget .

### Adding medium priority, since the issue goes away on refresh

Steps To Reproduce

https://www.loom.com/share/21c9578fb3e64144a81ca684bd9ba37b

  1. Create JS function
  2. Bound it to a data-field widget say text
  3. Run the function
  4. Change the return value and run it again
  5. Updated evaluations are not happening and text widget still shows the older return value

### Adding medium priority, since the issue goes away on refresh

Public Sample App

No response

Environment

Production

Severity

Medium (Frustrating UX)

Issue video log

No response

Version

Cloud/Selfhosted (also reproducible on v1.11)

Nikhil-Nandagopal commented 5 months ago

@kamakshibhat-appsmith this is a critical issue right because this used to work before and now all apps with this will be broken. @vsvamsi1 @rajatagrawal did any recent evaluation changes impact this?

kamakshibhat-appsmith commented 5 months ago

We checked on v1.11 as well and issue seems to be there as well. Not completely sure when this got introduced . Also, this won't be categorized as critical, since it doesn't seem to have impact on Deploy mode. Also, the issue goes away on refresh. This only happens the first time when JS object is created and used in a widget

vsvamsi1 commented 5 months ago

It seems to be an existing issue and not from our evaluations optimisations which were made during Feb 2024. After investigating the issue i noticed that the evaluation order appears to be incorrect, the JS action is not linked to the text widget's binding. My hunch is that when dropping a new widget the dependencyMap is not updated correctly. My suggestion would be to look at subTreeSortOrder within setupTree and see why the evaluationOrder over here does not link with the text widget's binding.

rajatagrawal commented 5 months ago

The issue can be reproduced in v1.11 which is before evaluations performance began

rajatagrawal commented 5 months ago

Slack thread : https://theappsmith.slack.com/archives/C02K0SZQ7V3/p1716975732626249

rishabhrathod01 commented 1 month ago

@kamakshibhat-appsmith Could you please confirm if this is still reproducible? cc: @vsvamsi1

kamakshibhat-appsmith commented 1 month ago

@rishabhrathod01 yes it is still reproducible

Screenshot 2024-10-08 at 1 08 22 PM