-
Notifications
You must be signed in to change notification settings - Fork 506
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 #3325: Add domain layer mechanism to save checkpoints. #3403
Conversation
val ephemeralState = result.getOrThrow() | ||
// only mark checkpoint if the current state is either of type PENDING_STATE or TERMINAL_STATE. | ||
if (ephemeralState.stateTypeCase != EphemeralState.StateTypeCase.COMPLETED_STATE) | ||
markExplorationCheckpoint() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function kicks off the saving process in the UI layer. The reason behind this function being in the UI layer is that if we move it to the domain layer, we will be able to start the saving process but we will not be able to return the dataProvider to the UI layer to observe the saving process.
To move this function to the domain layer, I have tried creating a new dataProvider in ExplorationProgressController and using functions combineWith and .transform on it so that I can return the save operation's dataProvider to the UI layer. (The main problem here is we that have to check that the exploration is not in Loading_STATE before we can create a checkpoint` )
But so far nothing seems to work.
One more problem with saving in the UI layer is that we will be re-saving the same checkpoint if the user goes to some previous state and then comes back to the pending state. This is because we are saving every time the exploration goes into VIEWING_STATE and the current state is not a COMPLETED_STATE.
Do you have any suggestions to solve this problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a new PR with an alternate approach to save checkpoints without using ap layer using background dispatchers
link to the PR with the new approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replying to #3408 since I think that approach will be easier to bring to a working state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aggarwalpulkit596 @BenHenning PTAL at the comment above.
Unassigning Rajat and Vinita because there is a new PR with a different approach which may be better than the current approach. |
Closing this PR because the alternate approach is better than the approach used in this PR. |
Explanation
Fixes part of #3325
This PR is stacked on top of PR #3400
Checklist