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

Fix for "Invariant Violation: Expected targetIds to be registered." #3432

Merged
merged 4 commits into from
Apr 19, 2022

Conversation

marikobi
Copy link
Contributor

We keep seeing this error during drag and drop, and I believe it's happening because we give the list of targetIds to the async hover function and expect that list to be correct when we actually execute it : see #3313 (review)

Moving the invariant check after removing non-matching Ids should fix it since if the targetId doesn't exist any more it'll be removed from the targetIds list.

Tested locally by patching this change on V14.0.3 and this fix seems to be working.

Fixes #763, #3403

@marikobi marikobi changed the title move invariant check Fix for "Invariant Violation: Expected targetIds to be registered." Apr 13, 2022
Copy link
Member

@darthtrevino darthtrevino left a comment

Choose a reason for hiding this comment

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

This looks good to me; thanks for the PR!

@darthtrevino darthtrevino merged commit 386c3a7 into react-dnd:main Apr 19, 2022
@marikobi
Copy link
Contributor Author

hi @darthtrevino, thanks for approving this fix. Since it seems like other people are hitting the same issue, would you consider releasing the version 14 with this patch?

@marikobi marikobi deleted the mari-fix-invariant branch April 26, 2022 17:16
@darthtrevino
Copy link
Member

@marikobi I don't usually maintain old major releases of this library (just for my own sanity's sake) - is there anything preventing you from using v16?

@marikobi
Copy link
Contributor Author

@marikobi I don't usually maintain old major releases of this library (just for my own sanity's sake) - is there anything preventing you from using v16?

We are using Decorators API in our codebase so would need to first migrate to using hooks before we start using versions above 14

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.

Invariant Violation: Expected targetIds to be registered.
2 participants