Skip to content
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

fix(content-distribution): use payload hash on partial updates #207

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Feb 3, 2025

When partial updates were implemented (#205) it didn't integrate with the payload hash strategy (#198), so every partial update is dispatched even if it's already the most recent distributed data.

This PR implements the payload hash check to partial updates.

It also adds the _pingme and _encloseme meta to the list of ignored meta keys. These 2 keys are WP internals to manage pings and enclosures via wp-cron and should not be part of the payload.

Testing

  1. On a distributed post, make a content change and save and confirm only 1 dispatch is logged in the hub
  2. Make a CAP author change and save and also confirm only 1 dispatch is logged
  3. Make a content change, a CAP author change, save, and confirm 2 dispatches are logged
  4. Without making any changes, hit Save, and confirm nothing gets dispatched

@miguelpeixe miguelpeixe self-assigned this Feb 3, 2025
@miguelpeixe miguelpeixe requested a review from a team as a code owner February 3, 2025 14:02
Copy link
Member

@naxoc naxoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests well and looks good!

For testing CAP save on it's own I had to save with wp.data.dispatch('core/editor').savePost() – I think there is a bug in the "Authors" side panel that doesn't let me save if all I change is authors. Totally unrelated to this though! Good to go 👍

@miguelpeixe
Copy link
Member Author

Thanks, @naxoc!

@miguelpeixe miguelpeixe merged commit 31b342d into trunk Feb 3, 2025
4 checks passed
Copy link

github-actions bot commented Feb 3, 2025

Hey @miguelpeixe, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

@miguelpeixe miguelpeixe deleted the fix/content-distribution-hash-partial branch February 3, 2025 16:44
matticbot pushed a commit that referenced this pull request Feb 7, 2025
# [2.6.0-alpha.1](v2.5.0...v2.6.0-alpha.1) (2025-02-07)

### Bug Fixes

* **content-distribution:** use payload hash on partial updates ([#207](#207)) ([31b342d](31b342d))
* **event-log:** data css overflow ([#206](#206)) ([f81adfe](f81adfe))

### Features

* **content-distribution:** migration tweaks ([#201](#201)) ([9c61fa8](9c61fa8))
* **content-distribution:** partial payload ([#205](#205)) ([b844d06](b844d06))
* **content-distribution:** remove "Quick Edit" from linked posts ([#200](#200)) ([6ad3a4a](6ad3a4a))
* **content-distribution:** Sync authors ([#194](#194)) ([3156d35](3156d35))
* increase pull frequency and amount ([#209](#209)) ([6791da1](6791da1))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.6.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Feb 17, 2025
# [2.6.0](v2.5.0...v2.6.0) (2025-02-17)

### Bug Fixes

* **content-distribution:** use payload hash on partial updates ([#207](#207)) ([31b342d](31b342d))
* **event-log:** data css overflow ([#206](#206)) ([f81adfe](f81adfe))

### Features

* **content-distribution:** migration tweaks ([#201](#201)) ([9c61fa8](9c61fa8))
* **content-distribution:** partial payload ([#205](#205)) ([b844d06](b844d06))
* **content-distribution:** remove "Quick Edit" from linked posts ([#200](#200)) ([6ad3a4a](6ad3a4a))
* **content-distribution:** Sync authors ([#194](#194)) ([3156d35](3156d35))
* increase pull frequency and amount ([#209](#209)) ([6791da1](6791da1))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants