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

Receivers are non-deterministic #175

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

Conversation

ofersadgat
Copy link

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.

@lafiosca lafiosca added bug Something isn't working enhancement New feature or request research For issues which require additional research work gestures Related to gesture handling labels Sep 17, 2024
@lafiosca
Copy link
Contributor

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.

@lafiosca lafiosca self-assigned this Sep 17, 2024
Copy link

@LunatiqueCoder LunatiqueCoder left a 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?

@ofersadgat
Copy link
Author

@LunatiqueCoder sorry about that, I'll fix it when the rest of the MR gets reviewed.

@LunatiqueCoder
Copy link

do you have a reproduction example to test the changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request gestures Related to gesture handling research For issues which require additional research work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants