lowcoder-org / lowcoder

🔥 🔥 🔥 The Open Source Retool, Tooljet and Appsmith Alternative
https://www.lowcoder.cloud/
GNU Affero General Public License v3.0
660 stars 149 forks source link

[Bug]: timeline component caches erroneous entries when "Newest Events First" toggle is on #902

Open James4L opened 1 month ago

James4L commented 1 month ago

Is there an existing issue for this?

Current Behavior

There's a strange caching issue with the timeline component. Basically the component display isn't completely refreshed when the source data changes. The last element seems to be cached. My usual tricks around this by having the component reading a state value and setting the state to NULL between reloads does not even clear the contents of the timeline component. Screenshots showing the issue. obj_timeLineData.value contains 0 items. Timeline component has the data source from that object. Yet timeline shows cached entries. The more the source data changes the more out of wack the cached contents get. This problem only occurs when the "Newest Events First" slider is toggled on. When it is off, the timeline display refreshes between data changes as you would expect.

You can see below the component is still showing entries even when the source object has none: image image image

Setting "Newest Events First" to False, the component behaves as you would expect.

Expected Behavior

The timeline component should completely refresh its display when the source changes, regardless of the toggle.

Steps to reproduce

Source data object: A temporary state object which is populated from a JS function to build an array of data (not sure if this part of the problem because the usual triggers around data query refresh aren't executed)

Toggle the "Newest Events First" slider on. Change the source data. The most recent event from the previous data remains in the component display along with the new data.

Environment

Lowcoder cloud

Additional Information

No response

raheeliftikhar5 commented 3 weeks ago

@James4L which version of Lowcoder you are using? I have followed the steps and unable to reproduce in Lowcoder 2.4.0