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

App doesn't open on every alternate tap on the icon #4323

Closed
KolliAnitha opened this issue Apr 27, 2022 · 6 comments · Fixed by #4418
Closed

App doesn't open on every alternate tap on the icon #4323

KolliAnitha opened this issue Apr 27, 2022 · 6 comments · Fixed by #4418
Assignees
Labels
Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@KolliAnitha
Copy link

KolliAnitha commented Apr 27, 2022

Describe the bug
App doesn't open on every alternate tap on the icon

To Reproduce
Steps to reproduce the behavior:

  1. Go to Home page
  2. Tap on Oppia
  3. Page blinks and app doesnt open
  4. Tap on Oppia icon again
  5. App opens properly

Expected behavior
App should open when the user tries to open it

Actual Result:
App doesn't open and page blinks on every 1st, 3rd and 5th tap on the Oppia icon but opens on 2nd, 4th and 6th tap

22-04-27-17-05-24.mp4

Environment
Device name: One plus Nord2 5G
Android version : Android 11
App version : 0.7-alpha-d1b2827517

@BenHenning
Copy link
Member

Interesting. This looks like a crash; further investigation is needed to see if it can be reproed locally or if it's specific to @KolliAnitha's device.

@BenHenning BenHenning added this to the Beta MR1 milestone Apr 29, 2022
@BenHenning
Copy link
Member

Adding this tentatively to beta MR1 & assigning it to myself as it may be indicating a much worse issue that we'll want to be aware of.

@BenHenning BenHenning self-assigned this Apr 29, 2022
@Broppia Broppia added issue_type_bug Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). labels Jun 2, 2022
@BenHenning
Copy link
Member

@KolliAnitha can you try this on a device other than the Nord2? I'm not able to repro on my Pixel 4 or Nexus 5X (a fast and slow device, respectively), though I did see this in a video from one of our user study coordinators. It'd be nice to try and figure out the subset of affected devices so that I can successfully repro it.

Also, if you can after reproing the issue create a bug report & send it to me? I suggest not uploading it to GitHub or making it open access since bug reports will contain info about your system and installed apps. Please let me know if you have any concerns.

@BenHenning
Copy link
Member

I haven't yet received system logs to analyze, but in developing a separate issue I encountered this issue when I intentionally kept the splash open:

    Process: org.oppia.android, PID: 21588
    java.lang.IllegalStateException: Expected to initialize the locale for the first time. If this is in a test, did you use InitializeDefaultLocaleRule?
        at org.oppia.android.app.translation.AppLanguageLocaleHandler.initializeLocale(AppLanguageLocaleHandler.kt:41)
        at org.oppia.android.app.splash.SplashActivityPresenter$subscribeToOnboardingFlow$1.onChanged(SplashActivityPresenter_updated.kt:73)
        at org.oppia.android.app.splash.SplashActivityPresenter$subscribeToOnboardingFlow$1.onChanged(SplashActivityPresenter_updated.kt:64)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
        at androidx.lifecycle.Transformations$1.onChanged(Transformations.java:76)
        at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.setValue(DataProviders.kt:399)
        at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.setValue(DataProviders.kt:348)
        at androidx.lifecycle.LiveData$1.run(LiveData.java:91)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

This is a known crash from when localization was introduced. I wonder if the situation here is that the splash screen is taking a bit to advance so tapping a second time is triggering the above crash. I'll need to see system logs to confirm, but this seems like a good guess.

@BenHenning
Copy link
Member

I noticed the crash in my previous comment can also reproed by using the system back button from the profile screen & reopening the app. Still not clear if this is the same issue observed in the opening comment.

BenHenning added a commit that referenced this issue Sep 7, 2022
…able to reset the admin pin (#4418)

## Explanation
Fixes #4366
Fixes #3611
Fixes #4323

This PR introduces a data reset flow for cases when the user fails to remember their administrator pin. Since there's no remote profile support currently, the only option is to clear all profiles on the device. This is done using a two-step dialog since the action is permanent (at least for now--in the future we could consider making a local backup that could be restored, but that could become pretty complicated).

While this isn't a great solution, it's better than not having an option at all since users can currently get permanently stuck (see #3611). While this doesn't directly fix #3611, it mitigates it by providing a proper in-app means of resetting app data.

#4323 seems unrelated, but resetting the app required routing back to SplashActivity which means this PR needed to introduce a robustness mechanism to not set the app locale unless it wasn't already initialized (which bypasses the bug mentioned by that issue).

Mechanically, the deletion process involves:
- Deleting all profiles on the device
- Updating the in-memory cache (which causes a few UI glitches)
- "Restarting" the app by ending the activity and routing back to SplashActivity

This replaces the existing "forgot PIN" flow for admins, and it technically does not reset non-profile data (such as the device installation ID, onboarding status, analytics/crash events, and some device-wide preferences).

## Essential Checklist
- [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
- [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation.
- [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

## For UI-specific PRs only
This PR is using the app's existing alert dialog theme, so it's not particularly interesting to show landscape/tablet screenshots as the UI isn't fundamentally different. The same is the case for special internationalization or accessibility concerns.

In terms of a demonstration of the new flow, see the following video:

https://user-images.githubusercontent.com/12983742/186572278-d0238e62-d013-419a-9c49-afe97cd10a5d.mp4

#4567 is tracking introducing tests, and the PR addressing it for these changes will include demonstrations of changed Espresso tests.

Commits:

* Add app data reset flow for resetting admin pin.

* Fix broken test.

* Update text & fix data reset issue.
@KolliAnitha
Copy link
Author

App opens properly on every tap on the icon in the beta version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). Z-ibt Temporary label for Ben to keep track of issues he's triaged.
4 participants