Altinn / app-frontend-react

Altinn application React frontend
BSD 3-Clause "New" or "Revised" License
18 stars 31 forks source link

Form becomes slow when having multiple elements in big repeating group, and dynamic code lists fail to load #2484

Open violaguttorm opened 1 month ago

violaguttorm commented 1 month ago

Description of the bug

When filling out a big repeating group, which can contain up to two inner repeating groups (separate), that has a lot of dynamically fetched code lists, the form starts to get noticably slower, and soon enough the dynamic code lists in new Group-elements will get stuck in an eternal "loading spin" animation. This is solved by refreshing the page, but it's not ideal and can be confusing for a user.

I checked the network tab in Chrome and it doesn't seem to be as simple as the code lists constantly loading in again and again, as the call to each seems to only happen once for each page no matter how many people you add.

The source code is in this app: https://altinn.studio/repos/brg/rrh-innrapportering URL in TT02: https://brg.apps.tt02.altinn.no/brg/rrh-innrapportering/

(This app is somewhat difficult to get running locally, but if necessary I can be contacted and I will tell you how to do it)

Steps To Reproduce

  1. Open the app.
  2. Login with foedselsnummer: 01812649198
  3. Select organization ALLSLAGS ORIENTAL TIGER AS (311780352)
  4. Select that the organization "Har reelle rettighetshavere".
  5. On the next page, add a lot of Reelle rettighetshavere (can be done either by foedselsnummer/last name combination, or by selecting "No" on the first question and manually filling out date of birth, name, and similar). Always choose the lowest interval on the question on how much control so you can add a lot of them.
  6. Observe that after a while (sometimes as low as 3, sometimes you need 10) that a lot of the choices (such as intervals) start spinning and never finishing.

Additional Information

No response

olemartinorg commented 1 month ago

I tested the form, and I was able to reproduce the issue pretty much immediately. I've been working on general performance improvements (leftovers after the larger performance-related rewrite we shipped in v4.8.0), and when I test the form with those changes (#2511) I don't see the same issues any longer. :raised_hands:

EirikOlavHaugenSSB commented 2 weeks ago

This was marked as completed, however i encountered the issue still in my form 15.10.24. Image https://altinn.studio/repos/ssb/ra0745-01