ToolJet / ToolJet

Low-code platform for building business applications. Connect to databases, cloud storages, GraphQL, API endpoints, Airtable, Google sheets, OpenAI, etc and build apps using drag and drop application builder. Built using JavaScript/TypeScript. 🚀
https://tooljet.com
GNU Affero General Public License v3.0
28.9k stars 3.59k forks source link

Components in forms have stale data on event triggers #9339

Open gitars opened 5 months ago

gitars commented 5 months ago

Version Information

2.33.6-ee2.15.19

Environment

Docker on AWS ECS

What is the expected behaviour?

components.form1.data.myComponent should have the latest component data on update.

What is the current behaviour?

components.form1.data.myComponent has stale data.

How to reproduce the issue?

  1. Add a form and date picker to a form.
  2. Add a JS query that runs console.log(components.form1.data.datepicker1);
  3. Add event to the date picker. "On Select" -> Run Query -> The query from Step 2
  4. Edit the date picker. The stale value should come up.

Screenshots or Screencast

https://github.com/ToolJet/ToolJet/assets/4552296/4e2b3aa2-e96d-48f4-9a86-3b49e29e9bfc

Please provide any traces or logs that could help here.

n/a

Any possible solutions?

🤷

Can you identify the location in the driver source code where the problem exists?

It seems the event fires before the form component data updates. IDK, maybe something here: https://github.com/ToolJet/ToolJet/blob/develop/frontend/src/Editor/Components/Form/Form.jsx#L159-L173

If the bug is confirmed, would you be willing to submit a PR?

No

ShazanRizvi commented 5 months ago

Hi @gitars apologies for the inconvenience. The team is looking into the issue and will get back to you shortly. Thanks for your patience.

adityabarodiya commented 5 months ago

may i work on this issue?