Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document's editor : performance problem when adding/deleting a field #2882

Closed
2 of 4 tasks
JoelleDosimont opened this issue May 5, 2022 · 2 comments
Closed
2 of 4 tasks
Labels
bug Breaks something but is not blocking f: editor Concerns editor based on JSON schema AND custom editor p-High High priority (to be solved in the 2-3 next months) performance
Milestone

Comments

@JoelleDosimont
Copy link
Contributor

JoelleDosimont commented May 5, 2022

Bug description:

In some records, the addition of fields takes too many seconds. It's the same when you delete them. It happens when adding a field that already exist in the record (duplicate of an existing field).
Ex. : try to add import the ISBN 0844741698 from Library of Congress and try to add an identifiers (with Firefox, my test takes approx. 15 seconds).

Expected behavior:

The addition/deletion of a field should be as quick as possible.

Steps to Reproduce:

  1. Import the following ISBN 0844741698 from Library of Congress
  2. Add an identifier
  3. See that it's really slow

Context

Server:

Version:

v1.10.0

Browser:

Firefox: version 99.0.1

@JoelleDosimont JoelleDosimont added f: editor Concerns editor based on JSON schema AND custom editor bug Breaks something but is not blocking p-High High priority (to be solved in the 2-3 next months) labels May 5, 2022
@zannkukai
Copy link
Contributor

The cause seems the asynchronous validation of the form.
Each time a field is added/deleted, the complete form is validate --> all fields are validated.
If some validators are linked to HTTP checks (asyncValidator) this will cause some performance issue.

@jma
Copy link
Contributor

jma commented May 12, 2022

This is linked to the number of initial value for the arrays. Here is a pure ngx-formly example:
https://stackblitz.com/edit/angular-9znuyr?file=src%2Fapp%2Fapp.component.ts,src%2Fassets%2Fjson-schema%2Farrays.json,src%2Fapp%2Farray.type.ts.

Commenting the line 45 make the editor quite fast. I have ask the formly authors on the following gitter room:
https://gitter.im/formly-js/ng2-formly

@PascalRepond PascalRepond added this to the Sprint 56 milestone Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks something but is not blocking f: editor Concerns editor based on JSON schema AND custom editor p-High High priority (to be solved in the 2-3 next months) performance
Projects
None yet
Development

No branches or pull requests

5 participants