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: race condition tracking current ui #42

Merged
merged 3 commits into from
Jun 10, 2024
Merged

Conversation

GeekyEggo
Copy link
Member

This PR addresses a race condition, when tracking the current UI, that can occur when open/closing the property inspector in quick succession, causing the propertyInspectorDidAppear and propertyInspectorDidDisappear to run out of sync.

@GeekyEggo GeekyEggo requested a review from Elgato-AStory June 7, 2024 11:49
Copy link
Collaborator

@Elgato-AStory Elgato-AStory left a comment

Choose a reason for hiding this comment

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

In order to properly resolve the race condition, I think a stack or count is absolutely required. This is most noticeable if you select an already-selected action. The new PI will fire the DidAppear before the DidDisappear will fire, and since it's the same action, all of the state info about it will also be the same, and we'll end up in a scenario where the PI is open but the plugin will think it's closed.

As long as we're just clearing a variable, a simple counter should work.

@GeekyEggo
Copy link
Member Author

Good suggestion; I've added a debounce counter to offset appear / disappear being out of sync for the same property inspector.

@GeekyEggo GeekyEggo merged commit ddb0bd2 into main Jun 10, 2024
4 checks passed
@GeekyEggo GeekyEggo deleted the ui-race-condition branch June 10, 2024 23:00
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.

2 participants