Skip to content

Conversation

@grzegorz-cp
Copy link
Contributor

@grzegorz-cp grzegorz-cp commented Dec 23, 2025

Fixes MYJP-268

Proposed changes:

  • The maybe_show_red_bubble() function runs on every WordPress admin page load and triggers external API calls to WordPress.com (that might timeout and delay page rendering) when the cache expires. The solution defers these API calls to an asynchronous REST request that runs after the page has loaded. My Jetpack page maintains existing logic to preserve React and window object implementation.

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?

Testing instructions:

  • Checkout locally
  • Go to My Jetpack
  • Clear the red bubble cache
    jetpack docker wp option delete _transient_my-jetpack-red-bubble-transient
    jetpack docker wp option delete _transient_timeout_my-jetpack-red-bubble-transient
  • Refresh the page and verify that a call to red-bubble-notifications endpoint was made, but HTML doesn't have async-notification-bubble.js script appended.
  • Go to any WordPress admin page (e.g., Posts)
    • Page loads immediately (no blocking)
    • You should NOT see a POST request to red-bubble-notifications (cache should be used)
    • If alerts exist, the Jetpack menu badge appears/updates after the request completes
  • Clear the red bubble cache
    jetpack docker wp option delete _transient_my-jetpack-red-bubble-transient
    jetpack docker wp option delete _transient_timeout_my-jetpack-red-bubble-transient
  • Refresh the page
    • Page loads immediately (no blocking)
    • You should see a POST request to red-bubble-notifications (cache should be used)
    • HTML has async-notification-bubble.js script appended
    • If alerts exist, the Jetpack menu badge appears/updates after the request completes

@github-actions github-actions bot added [Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Status] In Progress labels Dec 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 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 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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: February 3, 2026
    • Code freeze: February 3, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Search plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Starter Plugin plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@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 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 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-268-bubble-async branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack SOCIAL-268-bubble-async

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

@grzegorz-cp grzegorz-cp self-assigned this Dec 23, 2025
@jp-launch-control
Copy link

jp-launch-control bot commented Dec 23, 2025

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/packages/my-jetpack/src/class-initializer.php 54/312 (17.31%) -1.00% 17 💔
projects/packages/my-jetpack/src/class-red-bubble-notifications.php 21/191 (10.99%) -0.06% 1 ❤️‍🩹

1 file is newly checked for coverage.

File Coverage
projects/packages/my-jetpack/_inc/utils/async-notification-bubble.ts 0/18 (0.00%) 💔

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@manzoorwanijk
Copy link
Member

manzoorwanijk commented Dec 23, 2025

There seems to be some mistake about the linked issue. SOCIAL-268 is a different issue. Is it MYJP-268 instead?

@grzegorz-cp grzegorz-cp changed the title SOCIAL-268 Update My Jetpack red bubble notifications MYJP-268 Update My Jetpack red bubble notifications Jan 4, 2026
@grzegorz-cp
Copy link
Contributor Author

There seems to be some mistake about the linked issue. SOCIAL-268 is a different issue. Is it MYJP-268 instead?

Yes, it's related to MYJP-268. Thank you noticing this.

@grzegorz-cp grzegorz-cp added I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jan 8, 2026
@grzegorz-cp grzegorz-cp requested a review from a team January 8, 2026 08:18
@grzegorz-cp grzegorz-cp marked this pull request as ready for review January 8, 2026 08:18
Copilot AI review requested due to automatic review settings January 8, 2026 08:18
Co-authored-by: Copilot <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings January 12, 2026 05:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Copilot AI review requested due to automatic review settings January 12, 2026 23:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

manzoorwanijk
manzoorwanijk previously approved these changes Jan 13, 2026
Copy link
Member

@manzoorwanijk manzoorwanijk left a comment

Choose a reason for hiding this comment

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

This looks good now. I have one minor suggestion though.

@manzoorwanijk
Copy link
Member

The test failure looks unrelated to this PR

[packages/jetpack-mu-wpcom] 1) Verbum_Block_Utils_Test::test_comment_text_block_sanitization_sanity_check
[packages/jetpack-mu-wpcom] Error: Call to undefined function wpcom_site_has_feature()

Co-authored-by: Manzoor Wani <[email protected]>
Copilot AI review requested due to automatic review settings January 13, 2026 21:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.

@grzegorz-cp grzegorz-cp merged commit a68a7d5 into trunk Jan 14, 2026
88 checks passed
@grzegorz-cp grzegorz-cp deleted the SOCIAL-268-bubble-async branch January 14, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants