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

Proposed fix for #2072 - EventGroup count variable should allowed to be zero #2125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cornflakes
Copy link
Contributor

@cornflakes cornflakes commented Jun 6, 2024

This would in turn fix:
#2072

This pull request addresses a bug introduced in commit e2cdf35 by @ItsChaceD on January 22nd, 2024.

The issue arises because the URL is opened from an activity instead of the plugin itself. This causes the unbindService method (called from handleOnPause in the plugin) to be invoked before the open method (called from the activity callback). This results in group.enter() being called before group.reset(). Consequently, when group.leave() is triggered from the TAB_HIDDEN navigation event, the browserEventListener.onBrowserEvent(BROWSER_FINISHED) event fires incorrectly when the app goes into the background.

This pull request fixes the bug by changing the count threshold from count <= 0 to count < 0, preventing the unintended firing of the BROWSER_FINISHED event.

While the order of calls remains unchanged, modifying the count threshold achieves the same outcome of ensuring group.reset() happens before group.leave().

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.

1 participant