Content
View differences
Updated by Oliver Günther about 9 years ago
With \#24618 being merged, the MyProject config takes a long time to load the `/api/v3/queries/form` request in a project with lots of custom fields enabled.
This is caused by three spots:
1\. Each instance of the SortByDecorator requests `Query.sortable_columns` which requests all custom fields.
<code>
app/models/query.rb:315:in \`all\_columns’
app/models/query.rb:323:in \`sortable\_columns’
lib/api/v3/queries/sort\_bys/sort\_by\_decorator.rb:45:in \`initialize’
</code>
2\. Each CustomFieldFilter of type list will subrequest the `custom_options. (`app/models/queries/work\_packages/filter/custom\_field\_filter.rb:39@)
3\. The CustomFieldInjector iterates over all `available_custom_fields`, subrequesting the translations in `CustomFieldInjector#inject_list_schema`.
I believe the third one to be fixed after \#\#24915 .
This is caused by three spots:
1\. Each instance of the SortByDecorator requests `Query.sortable_columns` which requests all custom fields.
<code>
app/models/query.rb:315:in \`all\_columns’
app/models/query.rb:323:in \`sortable\_columns’
lib/api/v3/queries/sort\_bys/sort\_by\_decorator.rb:45:in \`initialize’
</code>
2\. Each CustomFieldFilter of type list will subrequest the `custom_options. (`app/models/queries/work\_packages/filter/custom\_field\_filter.rb:39@)
3\. The CustomFieldInjector iterates over all `available_custom_fields`, subrequesting the translations in `CustomFieldInjector#inject_list_schema`.
I believe the third one to be fixed after \#\#24915 .