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.63k stars 3.74k forks source link

[Bug]-[600]:Data truncated without any functional change in code. Evaluations using data from previous run? #14699

Open SatishGandham opened 2 years ago

SatishGandham commented 2 years ago

Is there an existing issue for this?

Description

We have the following JS object.

export default {
    data:()=>{
    return  Countries.data.map(country=>{
        country.ccn3= country.ccn3+1
        return country
    })
    }
}

Data from above is bound to a table as {{jsObject.data()}}. Whenever you touch this field in property pane, the data is truncated. country.ccn3 changes as follows 233->2331->23311->233111 and so on.

Countries.Data is accurate, but worker is using the previous computation and keeps updating it.

I'm not sure if a user will ever run into it, but there could be a bug somewhere causing unnecessary side affects.

Steps To Reproduce

  1. Create a data source with this api https://restcountries.com/v3.1/all
  2. Crate a jsObject with function shared above.
  3. Bind {{jsObject.data()}} to table data.
  4. Touch the table data in property pane [add a space]

You will see country.ccn3 value change in each eval cycle.

Public Sample App

https://release.app.appsmith.com/app/data-cloning-issue/countries-table-62b15b0e3446e7397e69d83e

Version

Both, Latest.

rohan-arthur commented 2 years ago

Assuming this affects 10% of js editor users.

Stats

Stat Values
Reach      300
Effort (months)  0.5
rishabhrathod01 commented 2 years ago

This will be resolved with https://github.com/appsmithorg/appsmith/issues/3532 when we remove cloning of dataTree and add setters for the value that needs to update.