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
react: In a few scenarios, the entity list page can invoke up to 4 calls to the backend API #11222
Comments
adding a bounty as it's a bug |
@vishal423 & @pascalgrimaud I work on this |
@Falydoor ok but can you tell me your config ? |
The one from the sample app https://raw.githubusercontent.com/jhipster/jhipster-sample-app-react/master/.yo-rc.json |
As I was trying to fix the sort of users, I ended up refactoring and consequently fix the 2 api calls on users as well. |
@ctamisier your PR seems 👍 |
@vishal423 & @pascalgrimaud I think my PR #11224 is ok |
@pascalgrimaud & @jdubois I claim my money 😄 https://opencollective.com/generator-jhipster/expenses/13796 |
@pascalgrimaud, I have noticed another flow on same page (list view) making more than one backend call. Should we reopen this ticket? |
I would prefer to open a new ticket and link to this one, as there were a bounty on this ticket. So it won't confuse people and we could add a new bounty if it deserves. |
done. I think new issues could be due to changes made as part of this ticket. To limit further issues, it would be good to review generated code especially the |
Overview of the issue
In a few scenarios, the react entity list page (like with elastic search) contains 4
useEffects
hooks definitions to invoke four back-end APIs (three calls to the same API and one to search endpoint).API calls being made on the list page:
Motivation for or Use Case
500 error message
alert. It is due to the implicit search call being made and that fails as the index hasn't yet been created for the entity. If you create a new record for the entity, then, this error goes away.Reproduce the error
.yo-rc.json
and the entities.EntityWithPaginationAndDTO
). Check Network tab to see 4 calls to backend.Related issues
#10824
Suggest a Fix
JHipster Version(s)
v6.6.0
JHipster configuration
.yo-rc.json file
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Browsers and Operating System
openjdk version "1.8.0_232"
OpenJDK Runtime Environment Corretto-8.232.09.1 (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM Corretto-8.232.09.1 (build 25.232-b09, mixed mode)
git version 2.24.1
node: v12.13.1
npm: 6.12.1
yarn: 1.21.1
Docker version 19.03.5, build 633a0ea838
docker-compose version 1.25.0, build 0a186604
The text was updated successfully, but these errors were encountered: