-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reader: Fix tag stream wiping saved posts on pull-to-refresh #23331
Merged
dvdchr
merged 4 commits into
release/25.1
from
fix/reader-tag-stream-data-loss-on-refresh
Jun 10, 2024
Merged
Reader: Fix tag stream wiping saved posts on pull-to-refresh #23331
dvdchr
merged 4 commits into
release/25.1
from
fix/reader-tag-stream-data-loss-on-refresh
Jun 10, 2024
Conversation
This file contains 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
When the guard condition is not fulfilled, the success block is called. A second success block is then called in the `completion` closure.
14 tasks
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr23331-9e57051 | |
Version | 25.0 | |
Bundle ID | com.jetpack.alpha | |
Commit | 9e57051 | |
App Center Build | jetpack-installable-builds #9168 |
|
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr23331-9e57051 | |
Version | 25.0 | |
Bundle ID | org.wordpress.alpha | |
Commit | 9e57051 | |
App Center Build | WPiOS - One-Offs #10119 |
wargcm
approved these changes
Jun 10, 2024
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.
LGTM!
try mainContext.save() | ||
|
||
// When | ||
try await withCheckedThrowingContinuation { continuation in |
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.
Nice 馃挴, I like this over using an expectation.
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.
Cherry-picked from #23317
When performing a pull-to-refresh on the tag stream, the service wipes out all posts associated with the tag, and this could also delete saved posts (i.e., data loss).
Root cause:
ReaderPostStreamService
is used to fetch data for tag streams. When fetching data for the first page, the service wipes all data related to the tag, but there's no check in place for posts that are in use or saved.fbf98ca solves this by skipping posts that are in use (
inUse == true
) or saved (isSavedForLater == true
) when deleting posts associated to the tag. The fetch operation merges the new remote object with existing objects based on theglobalID
property (seeReaderPost.createOrReplace
). SinceinUse
andisSavedForLater
is purely a client-side property, it won't be overridden by the values from remote.To test
Run the unit tests and ensure they pass 馃煝 . In addition, here are the manual testing steps for each scenario:
Regression Notes
Potential unintended areas of impact
Should be none.
What I did to test those areas of impact (or what existing automated tests I relied on)
Manually tested the changes
What automated tests I added (or what prevented me from doing so)
Added unit tests to cover the specific scenarios covered by this PR.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: