-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Receivers are non-deterministic #175
base: main
Are you sure you want to change the base?
Conversation
This is a great find and I appreciate the work and PR. I have not been actively maintaining this library for a long time, and unfortunately there is no current maintainer. Additionally, I am in the process of winding down Nuclear Pasta and have been considering what I should do about this library. I will take a look and see if I can merge this and publish a new version, but I want to set expectations that it might take me a while to get to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the build folder should be commited?
@LunatiqueCoder sorry about that, I'll fix it when the rest of the MR gets reviewed. |
do you have a reproduction example to test the changes? |
findMonitorsAndReceiverInRegistry will look through the registry viewIds and return the last receiver which matches. the problem here is that this assumes that the order of receiver ids in the registry viewIds is bottom to top. this is not always the case when you have various receivers re-rendering for various reasons. this resulted in a non-deterministic receiver being called on drop instead of the top most one. in order to fix this, I added a resolution algorithm in the case that multiple receivers overlap the target point. the resolution algorithm solves the issue first by looking through the parent tree and removing all parents. while I believe this should be enough, for safety, I added an additional fallback measure which chooses the receiver with the smallest area as generally things on top should be smaller than things on bottom.