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

Uninstalling & reinstalling application does not reset administrator PIN #3611

Closed
rolandbellerud opened this issue Jul 29, 2021 · 2 comments · Fixed by #4418
Closed

Uninstalling & reinstalling application does not reset administrator PIN #3611

rolandbellerud opened this issue Jul 29, 2021 · 2 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

@rolandbellerud
Copy link

Describe the bug
If you forget your Administrator PIN number, the Oppia instructions are to uninstall the app and then reinstall it to reset it. Due to the data back up on Android, this does not work. When you uninstall the app and then reinstall it, the account is not reset, and you remain unable to log into the Administrator profile.

To Reproduce
Steps to reproduce the behavior:

  1. Set Administrator PIN
  2. Uninstall application
  3. Reinstall application
  4. Attempt to log in and see that the account/PIN have not been reset.

Expected behavior
Uninstalling and reinstalling the app should reset the data, so you can create a new Administrator PIN and log into the application

Screenshots
If applicable, add screenshots or videos to help explain your problem.

Device

  • Google Pixel 5
  • Alpha release

Additional context
Add any other context about the problem here.

@BenHenning
Copy link
Member

I think this is caused by https://stackoverflow.com/a/33176898. It's an interesting edge case that comes from us not fully understanding how Android backups work. We either need to disable Android backup support (not ideal since we don't have remote syncing for lesson progress), or provide an alternative flow for resetting the PIN (unclear since we don't have remote profile syncing support). This will require input from product to determine how we should proceed.

@BenHenning BenHenning added this to the Beta MR1 milestone Jun 11, 2022
@Broppia Broppia added issue_type_bug Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). labels Jul 7, 2022
@BenHenning BenHenning self-assigned this Jul 18, 2022
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

On uninstalling and reinstalling the app we see issue #4518. To reset admin PIN now on clicking Forgot PIN, Reset oppia button is seen which deletes data. On reopening the data user can set the pin.

@BenHenning BenHenning added the Z-ibt Temporary label for Ben to keep track of issues he's triaged. label Sep 15, 2022
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.
Projects
Status: In Implementation
4 participants