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

Race condition with activityStart/activityStop can leave dialog on screen [Android] #160

Open
3 tasks done
goffioul opened this issue May 10, 2022 · 0 comments
Open
3 tasks done

Comments

@goffioul
Copy link

Bug Report

Problem

There is a potential race condition problem in activityStart/activityStop, because the former shows the spinner dialog in the UI thread, while the latter hides the spinner dialog in the JS thread. So it is possible for activityStop to try to hide the spinner dialog, while it hasn't event been shown yet, if activityStop is executed immediately (or shortly) after activityStart.

For instance, using the following code (e.g. in Chrome remote debugging console):

navigator.notification.activityStart('', 'Wait...'); navigator.notification.activityStop()

What is expected to happen?

activityStop should always discard a spinner dialog initiated by activityStart.

What does actually happen?

activityStop has no effect, because the spinner dialog hasn't been created yet by activityStart (due to execution in UI thread).

Environment, Platform, Device

Android

Version information

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
goffioul added a commit to goffioul/cordova-plugin-dialogs that referenced this issue May 10, 2022
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

No branches or pull requests

1 participant