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 #3327: Create app layer mechanism for saving checkpoints. #3402

Merged
merged 126 commits into from
Jul 16, 2021

Conversation

MaskedCarrot
Copy link
Contributor

@MaskedCarrot MaskedCarrot commented Jul 3, 2021

Explanation

Fixes #3327

This PR is stacked on top of PR #3403

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

Testing the changes made in this PR

  1. Checkpointing is disabled by default until a mechanism to resume checkpoints is also implemented. However it can be enabled by changing the value of the variable isCheckpointingEnabled and shouldSavePartialProgresss to true in TopicLessonsFragment.

  2. Since size limit imposed on checkpoint database is set to 2MB, therefore the ProgressDatabaseFull dialog won’t be visible until checkpoint database exceeds 2MB in size So to view the ProgressDatabaseFull dialog box, enable checkpointing and then set the size limit to 0 in ExplorationStorageModule.

Tests

Test Espresso test result
ExplorationActivityTest Screenshot from 2021-07-06 10-23-43

Dialog boxes after this PR

This PR introduces the following three dialog boxes:

  1. StopExplorationDialog: Visible to the user when the exit an exploration that is saved and size of checkpoint database has not exceeded.
  2. UnsavedProgressDialog: Visible to the user when the progress is not saved ( this can happen if checkpointing fails or the lesson was previously completed). This dialog box is also visible to the user when they exit a practice session.
  3. ProgressDatabaseFullDialog: Visible to the user when the progress is saved but the checkpoint database has exceeded the size limit.

@MaskedCarrot MaskedCarrot changed the base branch from add-controller-for-checkpointing to add-module-to-tests July 3, 2021 05:30
Copy link
Contributor Author

@MaskedCarrot MaskedCarrot left a comment

Choose a reason for hiding this comment

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

These are the methods whose names can be a bit misleading in questionPlayerActivity

Comment on lines 126 to 135

override fun deleteCurrentProgressAndStopSession() {
// No progress is saved in training sessions.
questionPlayerActivityPresenter.stopTrainingSession()
}

override fun deleteOldestProgressAndStopSession() {
// This function is not needed because their is no progress that is being saved in training
// sessions.
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These names can be a bit misleading.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

So I think my concern here is that the training session experience shouldn't even show the flow that results in progress being deleted (i.e. I'd expect the old dialog to show up & neither of these methods to get called).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The user still sees the old dialog box with every thing is exactly the same as it was from the user's viewpoint.
But the code for this has changed since from explorations progress also has to be deleted.

Since all the existing dialog boxes have progress associated with them (saved, unsaved and databaseFull), so should I file a new issue that after milestone 1 the training session should have a new dialog box?

Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @MaskedCarrot. I had a few concerns left, but otherwise the PR LGTM.

Comment on lines 126 to 135

override fun deleteCurrentProgressAndStopSession() {
// No progress is saved in training sessions.
questionPlayerActivityPresenter.stopTrainingSession()
}

override fun deleteOldestProgressAndStopSession() {
// This function is not needed because their is no progress that is being saved in training
// sessions.
}
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

So I think my concern here is that the training session experience shouldn't even show the flow that results in progress being deleted (i.e. I'd expect the old dialog to show up & neither of these methods to get called).

app/src/main/res/values/strings.xml Show resolved Hide resolved
scripts/assets/test_file_exemptions.textproto Show resolved Hide resolved
@aggarwalpulkit596 aggarwalpulkit596 deleted the branch oppia:develop July 16, 2021 04:48
@MaskedCarrot MaskedCarrot reopened this Jul 16, 2021
@MaskedCarrot MaskedCarrot changed the base branch from saving-checkpoints-alternate to develop July 16, 2021 04:52
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @MaskedCarrot! LGTM for reviewed files.

app/src/main/res/values/strings.xml Show resolved Hide resolved
scripts/assets/test_file_exemptions.textproto Show resolved Hide resolved
@BenHenning
Copy link
Sponsor Member

Given that past tests have passed, I'm fine with enabling auto-merge here since Gradle tests should be sufficient for the latest changes.

@BenHenning BenHenning enabled auto-merge (squash) July 16, 2021 09:32
@oppiabot
Copy link

oppiabot bot commented Jul 16, 2021

Unassigning @BenHenning since they have already approved the PR.

@oppiabot oppiabot bot added the PR: LGTM label Jul 16, 2021
@oppiabot
Copy link

oppiabot bot commented Jul 16, 2021

Hi @MaskedCarrot, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

@BenHenning BenHenning merged commit b5697a0 into oppia:develop Jul 16, 2021
@MaskedCarrot MaskedCarrot deleted the app-layer-mech-for-checkpointing branch July 16, 2021 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create app layer mechanism to save exploration checkpoints.
6 participants