Conversation
This fixes a bug where loadSavedOperations would duplicate operations in OperationRepo.queue. This is because it is possible for operations to be added before it is started and these are also persisted to disk. Improved OperationRepoTests by making mockOperationModelStore modify a in memory list. This was required to write a test to ensure loadSavedOperations wasn't duplicating operations.
86e1cf6 to
6e9b690
Compare
jinliu9508
approved these changes
May 7, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
One Line Summary
Fixes a bug with the unreleased PR #2068, where
OperationRepo.queuewould have duplicated operations on the first clean start.Details
This fixes a bug where loadSavedOperations would duplicate operations in OperationRepo.queue. This is because it is possible for operations to be added before it is started and these are also persisted to disk.
Motivation
The duplicate operations would cause the OperationRepo to stop processing requests, which causes all User and Subscription creates and updates to stop working.
Scope
Only affects the operation repo enqueue logic.
Testing
Unit testing
Added a new Unit test for loadSavedOperations, ensuring it doesn't duplicate requests. Also OperationRepoTest's mockOperationModelStore now simulates a store, with an in memory implementation.
Manual testing
Test on Android 14 with a clean install, ensure the logcat error is no long there. Also that we are now able to get a OneSignal id in orignal scenario.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is