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

Almost all components that use imx-data-table or imx-data-source-toolbar call their GET endpoint twice #214

Open
jd-igf opened this issue Dec 11, 2024 · 2 comments

Comments

@jd-igf
Copy link

jd-igf commented Dec 11, 2024

Almost all components that use imx-data-table or imx-data-source-toolbar call their GET endpoint twice.

image

Cause explained using the example of identities.component:
In the OnInit of the components, navigate is called. This triggers the GET endpoint. Then, the DataSourceToolbarComponent.updateNavigateStateWithFilters emits navigationStateChanged again, causing navigate to be called once more and thus the GET endpoint is triggered again.

Among other things, the dataSourceHasChanged check in DataSourceToolbarComponent.ngOnChanges doesn’t seem to fit. I suspect it should be something like this:

this.dataSourceHasChanged = !(isEqual(changes['settings'].currentValue?.entitySchema
, changes['settings'].previousValue?.entitySchema
));

However, that does not seem to be the root cause.

@rogerholtenok
Copy link

rogerholtenok commented Dec 11, 2024

We ended up adding a dirty workaround in navigate where it skips calling getAllPersonAdmin/getReportsOfManager and instead just passes an empty data object to this.dstSettings.dataSource the first time it's called after the component is created.

Having a fix for DataSourceToolbarComponent itself that would fix it for all views would be preferrable.

@Mathnstein
Copy link
Collaborator

This is a known issue and is being worked on in an internal ticket 469349. Its being tested extensively, but will be fixed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants