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

Candidate search: Cannot read properties of undefined #163

Closed
adnjerem opened this issue Jul 18, 2024 · 4 comments
Closed

Candidate search: Cannot read properties of undefined #163

adnjerem opened this issue Jul 18, 2024 · 4 comments

Comments

@adnjerem
Copy link

There is an issue with the search function of the CDR editor, where sometimes an error gets displayed in the top bar, for example:

TypeError: Cannot read properties of undefined (reading 'TotalCount')

TypeError: Cannot read properties of undefined (reading 'Hierarchy')

We found the error in a custom portal where we use the CDR editor, but it can also be reproduced in the IT-Shop.

There is a timing component to the issue, so it doesn't happen all the time. To reproduce it, start typing in a field (in the screen shot below: "h"), then make a short pause such that the browser sends a search request to the backend, then immediately resume typing before the response arrives (in the screenshot below: "ans"). This cancels the first request and triggers a new one, and the error appears.

image

Other information

  • Product name: One Identity Manager
  • Product version: 9.2 v92-226554
@adnjerem
Copy link
Author

I found the following snippet in qbm/.../cdr/edit-fk/edit-fk.components.ts in the updateCandidates function:

const candidateCollection = await this.selectedTable.Get(this.parameters);
this.candidatesTotalCount = candidateCollection?.TotalCount;
 
this.isHierarchical = candidateCollection.Hierarchy != null;

It could explain the error message in our custom portal, where the error indicates reading Hierarchy, but not the one from the IT-Shop where it reads TotalCount and the code correctly uses the null-safe navigation operator.

@asattler
Copy link

I can confirm this (bad) behavior with cancelling search requests by resuming input in search-input-field (9.2.0 with codebase from commit #146 ).
Would be great to have a fix for that!

@Mathnstein
Copy link
Collaborator

Great catch - creating a bug for tracking

@Mathnstein
Copy link
Collaborator

Created an internal ticket: 462445

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