Describe the bug
I switched from ncw-file-relation widget to the latest relation widget that has been recently extended to support folder to file collections relationship. Before the switch the performances were acceptable even with big JSON files. The new relation widget, instead, stays in waiting state forever.
To Reproduce
data/cities.json), representing all the italian municipalities (almost 8,000) with an id and a name keys.collections
- label: lookups
name: lookups
files:
- label: cities
name: cities
file: data/cities.json
fields:
- label: cities
label_singular: city
name: cities
widget: list
fields:
- label: Name
name: name
widget: string
- label: id
name: id
widget: hidden
- label: Folder Collection
name: folder_collection
folder: content/folder_collection
create: true
identifier_field: id
slug: '{{city}}'
summary: '{{city}}'
editor:
preview: false
fields:
- label: id
name: id
widget: ncw-id
- label: City
name: city
widget: relation
collection: lookups
file: cities
searchFields: ['cities.*.name']
displayFields: ['cities.*.name']
valueField: cities.*.name
Expected behavior
The same folder to file relationship, mutatis mutandis, implemented by using ncw-file-relation widget works like a charm
Applicable Versions:
CMS configuration
See above
Additional context
I suspect the relation widget has the same performance issue with folder to folder collections relationship, because I experience a very slow response time with not such a large number of entries in the referenced folder collection.
@d4rekanguok (I added you here because you are the author of the ncw-file-relation widget and you collaborated a lot in adsorbing its features in the latest relation widget.
Thanks for the sample file @magomimmo, I'll give it a try and see if I can find the issue.
Hi @d4rekanguok I think this is the same issue as #3752 regarding file-to-file relationship case as well.
Hi @d4rekanguok did you have the opportunity to take a look at this issue. The perfomance issue of the relation widget is pervasive no matter if you create a folder to folder relation, a folder to file relation or even a file to file relation.
Also experiencing very slow performance with relation widget.
collection "assessments" is a folder of ~800 items
- { label: "Available Standards", name: "standards", required: false, widget: "relation", multiple: true, collection: "assessments",
searchFields: ["title"], valueField: "title", displayFields: ["title","description"] }
There are several issues with the relation widget at the moment related to performance.
query API saves all results in the redux store (we could only save the limit https://www.netlifycms.org/docs/widgets/#relation):