leekelleher / umbraco-contentment

Contentment for Umbraco - a state of happiness and satisfaction
https://marketplace.umbraco.com/package/umbraco.community.contentment
Mozilla Public License 2.0
155 stars 70 forks source link

Data List - Caching issue if number of Data Sources and List Editors are equal #213

Closed rasmusjp closed 2 years ago

rasmusjp commented 2 years ago

Which Contentment version are you using?

2.2.2

Which Umbraco version are you using? For example: 8.14.1 - don't just write v8

8.18.1

Bug summary

When having the same number of Data Sources and List Editors when you select one in the dialog the dialig always shows a list of the first one opened. So if you first try to select a Data Source and the a List Editor the List Editor dialog shows the Data Sources

https://user-images.githubusercontent.com/379886/160783505-ab6906b4-d91d-436d-bd20-e4b0f97eb45a.mov

It looks like the issue is in the lkGroupBy filter becauce the call to _.memoize does not contain a hash function and the arrays passed in are of the same size it just returns the first value it has cached

Steps to reproduce

Have the same number of Data Sources and List Editors enabled and then add a Data Source and the a List Editor

Expected result / actual result

The dialog showing the correct data

Do you have Umbraco ModelsBuilder enabled?

What browsers are you seeing the problem on?

No response

leekelleher commented 2 years ago

@rasmusjp Thanks for reporting this, it was a new one on me! 🤯

I've fixed this in 5be0aca7723054c08d828595aed95c86ff4b34e7, adds a cache key based on the property alias and grouping field name.

I don't have an ETA on a patch release just yet, I'm bundling together some other fixes/tweaks, so should be soon.