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

WIP: Fix null exception in directory item selector #549

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jamal-khey
Copy link
Contributor

This pull request fixes an issue where the directory item selector's updatedTree function could throw a null exception.

this issu happen in modification by formula , when selecting a filter and then moving it to another directory. when the user re-click on the chip of the filter , the derictory can not be selected

@jamal-khey jamal-khey self-assigned this Aug 8, 2024
@AAJELLAL AAJELLAL self-requested a review August 21, 2024 13:57
Copy link
Contributor

@AAJELLAL AAJELLAL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have seen together, there are cases where behavior is strange. It's best to ask the PO about the reproduction scenario and the various test cases.

@@ -77,7 +77,7 @@ function updatedTree(prevRoots: any[], prevMap: any, nodeId: UUID | null, childr
return pn;
}
if (pn.parentUuid !== nodeId) {
console.warn(`reparent ${pn.parentUuid} -> ${nodeId}`);
console.warn(`reparent ${pn?.parentUuid} -> ${nodeId}`);
Copy link
Contributor

@capyq capyq Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understant how it fix null exception.

if your optional chainning is the fix, that mean that "pn" is undefined.
and line 79 if "pn" is undefined you will get the same null exception.

line 68 if "pn" is undefined we return a value, so line 80 pn couldn't be undefined.

Copy link
Contributor Author

@jamal-khey jamal-khey Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize for the confusion. The title of the pull request was a mistake, and the bug is not resolved yet. I will investigate further to address the root cause of the issue.
in fact i think the issue is related to a data migration . it's not reproducible

@jamal-khey jamal-khey changed the title Fix null exception in directory item selector WIP: Fix null exception in directory item selector Aug 23, 2024
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

Successfully merging this pull request may close these issues.

3 participants