-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix an issue with posts duplicated in Discover #25015
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
Conversation
96b02e4 to
535e60b
Compare
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 29937 | |
| Version | PR #25015 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | c7f83f9 | |
| Installation URL | 7strr9dld655g |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 29937 | |
| Version | PR #25015 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | c7f83f9 | |
| Installation URL | 3sa9lnea2pb2o |
| switch remoteCard.type { | ||
| case .post: | ||
| post = ReaderPost.createOrReplace(fromRemotePost: remoteCard.post, for: nil, context: context) | ||
| let post = ReaderPost.createOrReplace(fromRemotePost: remoteCard.post, for: nil, context: context) |
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.
You can update the ReaderPost.createOrReplace signature to declare a nonnull return type, and then the ReaderPost? in findExistingCard(with post: ReaderPost?, ...) can become non-optional ReaderPost.
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.
I'd rather keep the changes to the minimum. I'm not completely sure createOrReplace is non-optional. It looks like it is.
The containing function will still return optional for now due to:
guard remoteCard.type != .unknown else {
return nil
}
535e60b to
2ae7fac
Compare
2ae7fac to
c7527fc
Compare
Generated by 🚫 Danger |
c7527fc to
e73a359
Compare
e73a359 to
2c74823
Compare
2c74823 to
c7f83f9
Compare
|





Description
Fixes CMM-764: Reader: posts in Discover are duplicated
Testing instructions
I tested by duplicated a post in a mock response.
Before / After
