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

Newsletter settings: Fix timezone and Atomic save bugs #98828

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from

Conversation

allilevine
Copy link
Member

@allilevine allilevine commented Jan 23, 2025

Related to https://github.com/Automattic/loop/issues/353#issuecomment-2608286704

Proposed Changes

  • Fix Timezone console error.
Screen Shot 2025-01-24 at 9 22 59 AM
  • Fix When saving the welcome message field on Atomic, it throws errors 50% of the time.
Screen Shot 2025-01-24 at 9 26 22 AM
  • Update test for saving fix.

Why are these changes being made?

  • To fix newsletter settings bugs.

Testing Instructions

  • Go to /settings/newsletter
  • Check that there are no timezone errors in the console.
  • For an Atomic site, change the welcome message. Change it multiple times. Check that you don't see any error notices.
  • Repeat with Simple and Jetpack sites to regression test.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@allilevine allilevine self-assigned this Jan 23, 2025
@matticbot
Copy link
Contributor

matticbot commented Jan 23, 2025

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/subscription_options-not-populating on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Jan 23, 2025

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~3231 bytes added 📈 [gzipped])

name                             parsed_size           gzip_size
settings-newsletter                   +706 B  (+0.1%)     +220 B  (+0.1%)
write-flow                            +327 B  (+0.0%)     +111 B  (+0.0%)
themes                                +327 B  (+0.0%)     +137 B  (+0.0%)
theme                                 +327 B  (+0.0%)     +137 B  (+0.1%)
staging-site                          +327 B  (+0.0%)     +137 B  (+0.0%)
sites-dashboard                       +327 B  (+0.0%)     +134 B  (+0.0%)
site-tools                            +327 B  (+0.0%)     +137 B  (+0.0%)
site-setup-wg                         +327 B  (+0.1%)     +110 B  (+0.1%)
site-setup-flow                       +327 B  (+0.1%)     +110 B  (+0.1%)
site-settings                         +327 B  (+0.0%)     +137 B  (+0.0%)
site-performance                      +327 B  (+0.0%)     +120 B  (+0.0%)
site-overview                         +327 B  (+0.0%)     +104 B  (+0.0%)
site-monitoring                       +327 B  (+0.0%)     +154 B  (+0.0%)
site-marketing                        +327 B  (+0.0%)     +113 B  (+0.0%)
site-logs                             +327 B  (+0.0%)     +148 B  (+0.0%)
settings-writing                      +327 B  (+0.1%)     +131 B  (+0.1%)
settings-security                     +327 B  (+0.1%)     +120 B  (+0.1%)
settings-reading                      +327 B  (+0.1%)     +107 B  (+0.1%)
settings-podcast                      +327 B  (+0.1%)     +131 B  (+0.1%)
settings-performance                  +327 B  (+0.1%)     +137 B  (+0.1%)
settings-discussion                   +327 B  (+0.1%)     +106 B  (+0.1%)
settings                              +327 B  (+0.0%)     +134 B  (+0.0%)
scan                                  +327 B  (+0.0%)     +131 B  (+0.1%)
readymade-template-flow               +327 B  (+0.2%)     +113 B  (+0.2%)
plugins                               +327 B  (+0.0%)     +137 B  (+0.0%)
people                                +327 B  (+0.0%)     +134 B  (+0.1%)
marketplace                           +327 B  (+0.0%)     +117 B  (+0.0%)
marketing                             +327 B  (+0.0%)     +113 B  (+0.0%)
link-in-bio-tld-flow                  +327 B  (+0.0%)     +111 B  (+0.0%)
jetpack-search                        +327 B  (+0.1%)     +120 B  (+0.1%)
jetpack-cloud-settings                +327 B  (+0.0%)     +112 B  (+0.1%)
jetpack-cloud-plugin-management       +327 B  (+0.0%)     +137 B  (+0.0%)
hosting-features                      +327 B  (+0.0%)     +137 B  (+0.0%)
hosting                               +327 B  (+0.0%)     +137 B  (+0.0%)
home                                  +327 B  (+0.0%)     +121 B  (+0.0%)
github-deployments                    +327 B  (+0.0%)     +115 B  (+0.0%)
customize                             +327 B  (+0.1%)     +121 B  (+0.1%)
comments                              +327 B  (+0.0%)     +119 B  (+0.1%)
checkout                              +327 B  (+0.0%)     +106 B  (+0.0%)
build-flow                            +327 B  (+0.0%)     +111 B  (+0.0%)
backup                                +327 B  (+0.0%)     +131 B  (+0.0%)
assembler-first-flow                  +327 B  (+0.2%)     +111 B  (+0.2%)
activity                              +327 B  (+0.0%)     +127 B  (+0.1%)
a8c-for-agencies-sites                +327 B  (+0.0%)     +131 B  (+0.0%)
a8c-for-agencies-plugins              +327 B  (+0.0%)     +137 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~1072 bytes added 📈 [gzipped])

name                                                                 parsed_size           gzip_size
async-load-signup-steps-woocommerce-install-step-store-address            +327 B  (+0.3%)     +133 B  (+0.4%)
async-load-signup-steps-woocommerce-install-step-business-info            +327 B  (+0.3%)     +145 B  (+0.4%)
async-load-signup-steps-woocommerce-install-hooks-use-site-settings       +327 B  (+4.8%)     +143 B  (+5.9%)
async-load-signup-steps-theme-selection                                   +327 B  (+0.1%)     +123 B  (+0.1%)
async-load-signup-steps-clone-point                                       +327 B  (+0.1%)     +135 B  (+0.2%)
async-load-design-blocks                                                  +327 B  (+0.0%)     +137 B  (+0.0%)
async-load-calypso-components-web-preview-component                       +327 B  (+0.1%)     +111 B  (+0.1%)
async-load-calypso-blocks-calendar-popover                                +327 B  (+0.1%)     +145 B  (+0.3%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

* @returns {Object} The formatted settings object
*/
function formatSubscriptionOptions( settings, siteId, state ) {
if ( ! settings?.subscription_options || ! isJetpackSite( state, siteId ) ) {
Copy link
Member Author

@allilevine allilevine Jan 23, 2025

Choose a reason for hiding this comment

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

The Jetpack endpoint is expecting an array, so I'm formatting the options for Jetpack sites here.

@allilevine allilevine marked this pull request as ready for review January 23, 2025 22:23
@allilevine allilevine changed the title Newsletter settings: Overwrite null Jetpack values for subscription_options Newsletter settings: Fix timezone and Atomic save bugs Jan 23, 2025
@allilevine allilevine force-pushed the fix/subscription_options-not-populating branch from 7ce4726 to 867c076 Compare January 23, 2025 23:00
@allilevine allilevine force-pushed the fix/subscription_options-not-populating branch from 867c076 to 00aacca Compare January 24, 2025 14:30
@allilevine allilevine requested a review from a team January 24, 2025 15:55
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants