Seed the Likes screen from cache when opening it from Post Stats - #25878
Draft
crazytonyli wants to merge 6 commits into
Draft
Seed the Likes screen from cache when opening it from Post Stats#25878crazytonyli wants to merge 6 commits into
crazytonyli wants to merge 6 commits into
Conversation
These files were not stable under the repo's .swift-format config. Reflow them on their own so the following functional commits stay reviewable. No behavior change.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33651 | |
| Version | PR #25878 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | c7d53ac | |
| Installation URL | 5t1dsun3minb8 |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33651 | |
| Version | PR #25878 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | c7d53ac | |
| Installation URL | 1kaqlars9hcjg |
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
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.


Note
I recommend reviewing this PR commit by commit. The first commit is a swift-format-only reflow of the touched files (no behavior change), separated out so the functional commits stay readable.
Description
Fixes https://linear.app/a8c/issue/CMM-2218
The Post Stats screen fetches a post's likers for its avatar strip but keeps them only in SwiftUI state. The Likes screen it navigates to reads the shared
LikeUserCore Data cache first, but nothing Post Stats fetched ever enters that cache, so a first visit starts empty and refetches the same endpoint.LikeUsercache, so the Likes list seeds itself instantly instead of starting empty.JetpackStatscan't depend on Core Data, so it exposes a store-onlyPostLikesStoreport (with aPostLikeSeedvalue type) and the app injects aStatsPostLikesStoreadapter backed by a newLikeUserHelper.upsertthat merges rows without purging. The Likes screen itself is unchanged; its existing cache-first read picks up the seeds.PostService.getLikesFor, so the list can't show a stale liker under a "0 likes" title. The seed path relies on the same behavior: a confirmedtotalCount == 0from Post Stats clears the post's cache (and that clear is awaited before the zero total is exposed, so a fast tap-through can't snapshot stale rows).One thing to look at:
deleteExistingUsersFornow uses a plain predicate when nothing is kept, because Core Data's SQLite store does not reliably evaluateNOT (self IN <empty array>).Testing instructions
@usernamesubtitles, no empty state.