Skip to content

Conversation

@kean
Copy link
Contributor

@kean kean commented Nov 24, 2025

Description

Fixes CMM-764: Reader: posts in Discover are duplicated

Testing instructions

I tested by duplicated a post in a mock response.

Before / After
Screenshot 2025-11-24 at 5 32 38 PM Screenshot 2025-11-24 at 5 34 54 PM

@kean kean added this to the 26.6 milestone Nov 24, 2025
@kean kean added the Reader label Nov 24, 2025
@kean kean requested a review from crazytonyli November 24, 2025 23:00
@kean kean force-pushed the fix/cmm-764-posts-duplicated-in-discover branch from 96b02e4 to 535e60b Compare November 24, 2025 23:00
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 24, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number29937
VersionPR #25015
Bundle IDorg.wordpress.alpha
Commitc7f83f9
Installation URL7strr9dld655g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 24, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number29937
VersionPR #25015
Bundle IDcom.jetpack.alpha
Commitc7f83f9
Installation URL3sa9lnea2pb2o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

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)
Copy link
Contributor

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.

Copy link
Contributor Author

@kean kean Nov 25, 2025

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
        }

@kean kean force-pushed the fix/cmm-764-posts-duplicated-in-discover branch from 535e60b to 2ae7fac Compare November 25, 2025 20:30
@kean kean changed the base branch from trunk to release_notes/26.5 November 25, 2025 20:30
@kean kean modified the milestones: 26.6, 26.5 ❄️ Nov 25, 2025
@crazytonyli crazytonyli changed the base branch from release_notes/26.5 to release/26.5 November 25, 2025 21:27
@kean kean force-pushed the fix/cmm-764-posts-duplicated-in-discover branch from 2ae7fac to c7527fc Compare November 25, 2025 22:17
@kean kean enabled auto-merge (squash) November 25, 2025 22:18
@dangermattic
Copy link
Collaborator

dangermattic commented Nov 25, 2025

1 Warning
⚠️ This PR is assigned to the milestone 26.5 ❄️. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.
1 Message
📖 This PR contains changes to RELEASE-NOTES.txt.
Note that these changes won't affect the final version of the release notes as this version is in code freeze.
Please, get in touch with a release manager if you want to update the final release notes.

Generated by 🚫 Danger

@kean kean force-pushed the fix/cmm-764-posts-duplicated-in-discover branch from c7527fc to e73a359 Compare November 26, 2025 13:10
@kean kean force-pushed the fix/cmm-764-posts-duplicated-in-discover branch from e73a359 to 2c74823 Compare November 26, 2025 13:34
@kean kean force-pushed the fix/cmm-764-posts-duplicated-in-discover branch from 2c74823 to c7f83f9 Compare November 26, 2025 14:09
@sonarqubecloud
Copy link

@kean kean merged commit bbe2d13 into release/26.5 Nov 26, 2025
26 of 32 checks passed
@kean kean deleted the fix/cmm-764-posts-duplicated-in-discover branch November 26, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants