Skip to content

Conversation

@gmjuhasz
Copy link
Contributor

@gmjuhasz gmjuhasz commented Dec 16, 2025

Fixes SOCIAL-269

Proposed changes:

This PR adds global resharing state to the social store so both Schedule and Share buttons remain disabled while either operation is in progress. Previously, there was a brief moment (~1 second) when the buttons became active again between saving and sharing operations.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

No

Testing instructions:

  1. Open an already published post in the WordPress editor
  2. Open the Jetpack sidebar and click "Preview & share" to open the unified modal
  3. Click the "Share" button
  4. Expected: Both Schedule and Share buttons should remain disabled/busy until the share operation completes
  5. Repeat test by clicking Schedule instead and confirming a time
  6. Expected: Both buttons should remain disabled/busy until the schedule operation completes
CleanShot.2025-12-16.at.12.54.49.mp4

…n progress

Adds global resharing state to the social store so both Schedule and Share
buttons remain disabled while either operation is in progress.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the SOCIAL-269 branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack SOCIAL-269

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2025

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Dec 16, 2025
@gmjuhasz gmjuhasz requested a review from a team December 16, 2025 11:55
@gmjuhasz gmjuhasz self-assigned this Dec 16, 2025
@gmjuhasz gmjuhasz added the [Type] Bug When a feature is broken and / or not performing as intended label Dec 16, 2025
@jp-launch-control
Copy link

Code Coverage Summary

Coverage changed in 6 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/js-packages/publicize-components/src/hooks/use-share-post/index.js 0/41 (0.00%) 0.00% 3 ❤️‍🩹
projects/js-packages/publicize-components/src/components/schedule-button/index.tsx 26/32 (81.25%) -2.62% 1 ❤️‍🩹
projects/js-packages/publicize-components/src/social-store/actions/share-post.ts 0/4 (0.00%) 0.00% 1 ❤️‍🩹
projects/js-packages/publicize-components/src/social-store/reducer/share-post.ts 2/4 (50.00%) -16.67% 1 ❤️‍🩹
projects/js-packages/publicize-components/src/social-store/selectors/share-post.ts 0/2 (0.00%) 0.00% 1 ❤️‍🩹

Full summary · PHP report · JS report

...initialState,
isFetching: true,
} );
setIsResharing( true );
Copy link
Member

Choose a reason for hiding this comment

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

IMHO, this state should be set inside the sharePost callback in src/components/share-post/index.jsx just before calling savePost.

Also, I think we can move this resharing API call to the store action itself and clean up that logic as it's no longer sync after we made resharing async and that async logic is still there. We can clean up that debt.

I was already looking into it a bit. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed in DM, you took this over to do the mentioned bigger refactor, that not just fixes this issue, but cleans up logic a bit. For the future we could assign Linear tasks as early as thinking of solutions, so we can avoid duplicated efforts on the same issues

@gmjuhasz gmjuhasz closed this Dec 16, 2025
@gmjuhasz gmjuhasz deleted the SOCIAL-269 branch December 16, 2025 12:35
@github-actions github-actions bot removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Publicize Components RNA [Type] Bug When a feature is broken and / or not performing as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants