-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Fix a possible infinite loading in 3rd party integration #60196
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
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +2.86 kB (+0.05%) Total Size: 5.92 MB
|
📝 WalkthroughWalkthroughThis update addresses issues in the email editor, including fixing infinite template loading, refining the logic for displaying the publish button, and adding middleware to strip post status on save when configured. It also introduces a new export for the store name and adjusts how template queries are constructed in selectors. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant EmailEditor
participant Store
participant Middleware
User->>EmailEditor: Edit email template
EmailEditor->>Store: Fetch templates with query (context, per_page, _woocommerce_email_editor)
Store-->>EmailEditor: Return templates (no infinite loading)
User->>EmailEditor: Save post
EmailEditor->>Middleware: On save, check strip_post_status_on_save
alt Config enabled
Middleware->>EmailEditor: Strip post status from save data
else Config disabled
Middleware->>EmailEditor: Save data unchanged
end
User->>EmailEditor: Attempt to publish
EmailEditor->>EmailEditor: Determine if publish button is shown (based on new logic)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. 📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
Loading templates without the post_type parameter caused failing initialization in the MailPoet plugin.
bd784cb
to
7efbc10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
packages/js/email-editor/src/middleware/save-post-status.ts (1)
25-88
: Add TypeScript types for better type safety.The middleware lacks proper TypeScript types, which makes it harder to catch potential issues.
Add proper types at the top of the file:
interface RegistryDispatch { [storeName: string]: { [actionName: string]: ( ...args: any[] ) => Promise<any>; }; } interface SaveEntityRecordArgs { kind: string; name: string; recordOrId: Record<string, any> | string | number; options?: Record<string, any>; }Then use these types in the middleware implementation for better type safety.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
packages/js/email-editor/changelog/fix-email-editor-template-loading
(1 hunks)packages/js/email-editor/src/editor.tsx
(2 hunks)packages/js/email-editor/src/global.d.ts
(1 hunks)packages/js/email-editor/src/hacks/publish-save.tsx
(1 hunks)packages/js/email-editor/src/middleware/save-post-status.ts
(1 hunks)packages/js/email-editor/src/store/initial-state.ts
(1 hunks)packages/js/email-editor/src/store/selectors.ts
(2 hunks)packages/js/email-editor/src/store/types.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- packages/js/email-editor/src/store/types.ts
- packages/js/email-editor/src/global.d.ts
- packages/js/email-editor/src/editor.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/js/email-editor/changelog/fix-email-editor-template-loading
- packages/js/email-editor/src/store/selectors.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{php,js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/code-quality.mdc)
**/*.{php,js,jsx,ts,tsx}
: Guard against unexpected inputs
Sanitize and validate any potentially dangerous inputs
Ensure code is backwards compatible
Write code that is readable and intuitive
Ensure code has unit or E2E tests where applicable
Files:
packages/js/email-editor/src/store/initial-state.ts
packages/js/email-editor/src/middleware/save-post-status.ts
packages/js/email-editor/src/hacks/publish-save.tsx
**/*.{php,js,ts,jsx,tsx}
⚙️ CodeRabbit Configuration File
**/*.{php,js,ts,jsx,tsx}
: Don't trust that extension developers will follow the best practices, make sure the code:
- Guards against unexpected inputs.
- Sanitizes and validates any potentially dangerous inputs.
- Is backwards compatible.
- Is readable and intuitive.
- Has unit or E2E tests where applicable.
Files:
packages/js/email-editor/src/store/initial-state.ts
packages/js/email-editor/src/middleware/save-post-status.ts
packages/js/email-editor/src/hacks/publish-save.tsx
🧠 Learnings (10)
📚 Learning: in woocommerce email editor store initialization (packages/js/email-editor/src/store/initial-state.t...
Learnt from: triple0t
PR: woocommerce/woocommerce#59186
File: packages/js/email-editor/src/store/initial-state.ts:9-10
Timestamp: 2025-06-26T12:13:32.062Z
Learning: In WooCommerce email editor store initialization (packages/js/email-editor/src/store/initial-state.ts), the current_post_id and current_post_type from window.WooCommerceEmailEditor are required parameters that should cause explicit errors if missing, rather than using fallback values or optional chaining. The design preference is to fail fast when critical initialization data is unavailable.
Applied to files:
packages/js/email-editor/src/store/initial-state.ts
packages/js/email-editor/src/middleware/save-post-status.ts
packages/js/email-editor/src/hacks/publish-save.tsx
📚 Learning: in woocommerce email editor (packages/js/email-editor/src/hacks/publish-save.tsx), the currentpost o...
Learnt from: lysyjan
PR: woocommerce/woocommerce#59931
File: packages/js/email-editor/src/hacks/publish-save.tsx:0-0
Timestamp: 2025-07-23T14:53:29.447Z
Learning: In WooCommerce email editor (packages/js/email-editor/src/hacks/publish-save.tsx), the currentPost obtained from select(editorStore).getCurrentPost() is guaranteed to always be a post object, so null safety checks are not required when accessing its properties like status.
Applied to files:
packages/js/email-editor/src/store/initial-state.ts
packages/js/email-editor/src/middleware/save-post-status.ts
packages/js/email-editor/src/hacks/publish-save.tsx
📚 Learning: the displaystyleswitcher component in plugins/woocommerce/client/blocks/assets/js/blocks/product-fil...
Learnt from: dinhtungdu
PR: woocommerce/woocommerce#59900
File: plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/inspector.tsx:0-0
Timestamp: 2025-07-24T05:37:00.907Z
Learning: The DisplayStyleSwitcher component in plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/components/display-style-switcher/index.tsx has been updated so that its onChange prop accepts only a string type (not string | number | undefined), eliminating the need for type assertions when using this component.
Applied to files:
packages/js/email-editor/src/store/initial-state.ts
packages/js/email-editor/src/hacks/publish-save.tsx
📚 Learning: in plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-addres...
Learnt from: ralucaStan
PR: woocommerce/woocommerce#58782
File: plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/customer-address.tsx:76-90
Timestamp: 2025-06-13T13:37:35.793Z
Learning: In plugins/woocommerce/client/blocks/assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/customer-address.tsx, the `shouldAnimate` flag is expected to be `false` only on initial render and may remain `true` after the first edit; it does not need to be reset.
Applied to files:
packages/js/email-editor/src/store/initial-state.ts
packages/js/email-editor/src/hacks/publish-save.tsx
📚 Learning: in woocommerce blocks typescript code, avoid type assertions (`as`) when accessing properties from u...
Learnt from: gigitux
PR: woocommerce/woocommerce#59659
File: plugins/woocommerce/client/blocks/assets/js/blocks/add-to-cart-with-options/frontend.ts:136-147
Timestamp: 2025-07-22T09:30:43.528Z
Learning: In WooCommerce blocks TypeScript code, avoid type assertions (`as`) when accessing properties from unified stores. Instead, create proper union types that combine all the different store component types using `Partial<>` wrappers, and export the unified type to help third-party extenders. For example: `type UnifiedStore = BaseStore & Partial<StoreA> & Partial<StoreB>`.
Applied to files:
packages/js/email-editor/src/store/initial-state.ts
📚 Learning: in woocommerce mini cart implementation, the cart state is server-populated before javascript initia...
Learnt from: samueljseay
PR: woocommerce/woocommerce#58716
File: plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/iapi-frontend.ts:78-96
Timestamp: 2025-06-18T06:05:25.472Z
Learning: In WooCommerce mini cart implementation, the cart state is server-populated before JavaScript initialization, so wooStoreState.cart and wooStoreState.cart.totals will be available on first render without requiring null-safe guards.
Applied to files:
packages/js/email-editor/src/store/initial-state.ts
📚 Learning: in woocommerce payments onboarding components (like plugins/woocommerce/client/admin/client/settings...
Learnt from: vladolaru
PR: woocommerce/woocommerce#59160
File: plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/index.tsx:0-0
Timestamp: 2025-06-26T14:56:54.917Z
Learning: In WooCommerce payments onboarding components (like plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/index.tsx), when updating local React state based on API calls, the local state should only be updated after the API call succeeds to prevent inconsistent state if the save operation fails. The pattern is to move setPaymentMethodsState calls inside the .then() callback of the API promise.
Applied to files:
packages/js/email-editor/src/store/initial-state.ts
📚 Learning: for woocommerce mini-cart blocks in plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/, t...
Learnt from: samueljseay
PR: woocommerce/woocommerce#59051
File: plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/mini-cart-footer-block/index.tsx:66-70
Timestamp: 2025-06-23T05:47:52.696Z
Learning: For WooCommerce mini-cart blocks in plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/, the standardized conditional pattern for experimental features should be `if ( isExperimentalMiniCartEnabled() ) { blockSettings.save = () => <InnerBlocks.Content />; }` - defaulting to the traditional Save component and only overriding when the experimental feature is enabled.
Applied to files:
packages/js/email-editor/src/store/initial-state.ts
packages/js/email-editor/src/hacks/publish-save.tsx
📚 Learning: the wordpress editor store's getcurrentpost() method can return null or undefined in several edge ca...
Learnt from: lysyjan
PR: woocommerce/woocommerce#59931
File: packages/js/email-editor/src/hacks/publish-save.tsx:43-53
Timestamp: 2025-07-23T14:53:30.525Z
Learning: The WordPress editor store's getCurrentPost() method can return null or undefined in several edge cases: during initial load before post data is fetched, when there's no post context, for new unsaved posts, and during API errors. The official WordPress documentation specifically recommends checking for nullish values before accessing properties to avoid runtime errors. Robust null/undefined handling is required for plugins using this selector.
Applied to files:
packages/js/email-editor/src/store/initial-state.ts
packages/js/email-editor/src/hacks/publish-save.tsx
📚 Learning: in woocommerce block edit components (like plugins/woocommerce/client/blocks/assets/js/blocks/next-p...
Learnt from: kmanijak
PR: woocommerce/woocommerce#60154
File: plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx:80-80
Timestamp: 2025-08-04T11:58:34.139Z
Learning: In WooCommerce block Edit components (like plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx), buttons are preview/display elements for the block editor interface and are not meant to be interactive, so accessibility attributes like ARIA labels are not necessary for these non-functional preview buttons.
Applied to files:
packages/js/email-editor/src/hacks/publish-save.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Core e2e tests 4/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Metrics - @woocommerce/plugin-woocommerce [performance]
- GitHub Check: Core e2e tests 6/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 5/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 2/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 3/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: JavaScript - @woocommerce/admin-library [unit]
- GitHub Check: Core e2e tests 1/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Check Asset Sizes
- GitHub Check: build
🔇 Additional comments (3)
packages/js/email-editor/src/store/initial-state.ts (1)
33-34
: LGTM - Optional chaining is appropriate for feature flags.The use of optional chaining for
strip_post_status_on_save
is appropriate since this appears to be a feature flag with a reasonable default behavior (undefined/false means don't strip post status), unlike core required parameters that should fail fast.packages/js/email-editor/src/hacks/publish-save.tsx (2)
43-55
: Improved logic simplification.The refactor to use
isEditingTemplate
based on post type instead of checking the current post object is a good improvement. This approach is more direct and avoids potential null/undefined issues withgetCurrentPost()
.
57-68
: Clear and well-documented condition logic.The updated comments clearly explain when the original publish button should and shouldn't be displayed. The simplified condition logic is much more readable than the previous implementation.
This can cause an issue in MailPoet when click on save publishes the email post.
Adjust conditions to ensure proper handling of template edits, post entity changes, and draft states.
7efbc10
to
6dc9d71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/js/email-editor/src/middleware/strip-post-status-on-save.ts (1)
14-14
: Use WeakMap to prevent memory leaksThe global
originalActions
object could potentially cause memory leaks if stores are dynamically created and destroyed. Consider using a WeakMap instead.-const originalActions = {}; +const originalActions = new WeakMap();Note: You'll need to update the corresponding access patterns throughout the file to use WeakMap methods.
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
packages/js/email-editor/changelog/add-middleware-to-strip-post-status-on-save
(1 hunks)packages/js/email-editor/src/editor.tsx
(2 hunks)packages/js/email-editor/src/global.d.ts
(1 hunks)packages/js/email-editor/src/hacks/publish-save.tsx
(1 hunks)packages/js/email-editor/src/middleware/strip-post-status-on-save.ts
(1 hunks)packages/js/email-editor/src/store/initial-state.ts
(1 hunks)packages/js/email-editor/src/store/selectors.ts
(2 hunks)packages/js/email-editor/src/store/types.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
- packages/js/email-editor/src/editor.tsx
- packages/js/email-editor/src/global.d.ts
- packages/js/email-editor/src/store/selectors.ts
- packages/js/email-editor/src/store/types.ts
- packages/js/email-editor/src/store/initial-state.ts
- packages/js/email-editor/src/hacks/publish-save.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{php,js,jsx,ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/code-quality.mdc)
**/*.{php,js,jsx,ts,tsx}
: Guard against unexpected inputs
Sanitize and validate any potentially dangerous inputs
Ensure code is backwards compatible
Write code that is readable and intuitive
Ensure code has unit or E2E tests where applicable
Files:
packages/js/email-editor/src/middleware/strip-post-status-on-save.ts
**/*.{php,js,ts,jsx,tsx}
⚙️ CodeRabbit Configuration File
**/*.{php,js,ts,jsx,tsx}
: Don't trust that extension developers will follow the best practices, make sure the code:
- Guards against unexpected inputs.
- Sanitizes and validates any potentially dangerous inputs.
- Is backwards compatible.
- Is readable and intuitive.
- Has unit or E2E tests where applicable.
Files:
packages/js/email-editor/src/middleware/strip-post-status-on-save.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: NeosinneR
PR: woocommerce/woocommerce#0
File: :0-0
Timestamp: 2025-06-26T14:25:08.421Z
Learning: In WooCommerce transactional emails, product images have historically had display issues due to lazy loading attributes being applied, which email clients cannot process since they don't execute JavaScript. This issue existed in both old and new email templates, but became more visible with the new email template system. The fix involves preventing lazy loading on attachment images specifically during email generation by adding skip classes and data attributes.
Learnt from: triple0t
PR: woocommerce/woocommerce#59186
File: packages/js/email-editor/src/store/initial-state.ts:9-10
Timestamp: 2025-06-26T12:13:32.062Z
Learning: In WooCommerce email editor store initialization (packages/js/email-editor/src/store/initial-state.ts), the current_post_id and current_post_type from window.WooCommerceEmailEditor are required parameters that should cause explicit errors if missing, rather than using fallback values or optional chaining. The design preference is to fail fast when critical initialization data is unavailable.
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#59675
File: .github/workflows/release-bump-as-requirement.yml:48-65
Timestamp: 2025-07-15T15:39:21.856Z
Learning: In WooCommerce core repository, changelog entries for all PRs live in `plugins/woocommerce/changelog/` directory and are processed during releases, not at the repository root level.
Learnt from: ralucaStan
PR: woocommerce/woocommerce#58782
File: plugins/woocommerce/client/blocks/assets/js/base/utils/render-frontend.tsx:0-0
Timestamp: 2025-06-16T16:12:12.148Z
Learning: For WooCommerce checkout blocks, lazy loading was removed in favor of direct imports to prevent sequential "popping" effects during component loading. This approach prioritizes user experience over code splitting, with minimal bundle size impact and improved performance (1.7s to 1.1s speed score improvement). The checkout flow benefits from having all components load together rather than incrementally.
Learnt from: lysyjan
PR: woocommerce/woocommerce#59931
File: packages/js/email-editor/src/hacks/publish-save.tsx:0-0
Timestamp: 2025-07-23T14:53:29.447Z
Learning: In WooCommerce email editor (packages/js/email-editor/src/hacks/publish-save.tsx), the currentPost obtained from select(editorStore).getCurrentPost() is guaranteed to always be a post object, so null safety checks are not required when accessing its properties like status.
Learnt from: dinhtungdu
PR: woocommerce/woocommerce#59900
File: plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/inspector.tsx:0-0
Timestamp: 2025-07-24T05:37:00.907Z
Learning: The DisplayStyleSwitcher component in plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/components/display-style-switcher/index.tsx has been updated so that its onChange prop accepts only a string type (not string | number | undefined), eliminating the need for type assertions when using this component.
📚 Learning: in woocommerce email editor (packages/js/email-editor/src/hacks/publish-save.tsx), the currentpost o...
Learnt from: lysyjan
PR: woocommerce/woocommerce#59931
File: packages/js/email-editor/src/hacks/publish-save.tsx:0-0
Timestamp: 2025-07-23T14:53:29.447Z
Learning: In WooCommerce email editor (packages/js/email-editor/src/hacks/publish-save.tsx), the currentPost obtained from select(editorStore).getCurrentPost() is guaranteed to always be a post object, so null safety checks are not required when accessing its properties like status.
Applied to files:
packages/js/email-editor/src/middleware/strip-post-status-on-save.ts
packages/js/email-editor/changelog/add-middleware-to-strip-post-status-on-save
📚 Learning: in woocommerce email editor store initialization (packages/js/email-editor/src/store/initial-state.t...
Learnt from: triple0t
PR: woocommerce/woocommerce#59186
File: packages/js/email-editor/src/store/initial-state.ts:9-10
Timestamp: 2025-06-26T12:13:32.062Z
Learning: In WooCommerce email editor store initialization (packages/js/email-editor/src/store/initial-state.ts), the current_post_id and current_post_type from window.WooCommerceEmailEditor are required parameters that should cause explicit errors if missing, rather than using fallback values or optional chaining. The design preference is to fail fast when critical initialization data is unavailable.
Applied to files:
packages/js/email-editor/src/middleware/strip-post-status-on-save.ts
🔇 Additional comments (3)
packages/js/email-editor/src/middleware/strip-post-status-on-save.ts (2)
115-127
: Validate concurrent save handling in strip-post-status middlewareWe ran an AST search and found dozens of
saveEntityRecord
calls across the repo, meaning multiple save flows can be in flight simultaneously. Since this middleware dispatches an optimistic status update before actually calling the API, concurrent saves for the same post could overwrite each other’s status.Please verify:
- Whether concurrent save flows for a single post are possible in your application.
- If the current optimistic update is acceptable, or if you should add a queuing/locking mechanism or at least inline documentation to call out the potential race.
Location to review:
- packages/js/email-editor/src/middleware/strip-post-status-on-save.ts (lines 115–127)
89-97
: Add validation for additional recordOrId propertiesWhile you validate that
recordOrId.id
is a number, the function should also handle cases whererecordOrId
might be just an ID number (not an object), which is a valid input forsaveEntityRecord
.-// Ensure recordOrId is object with numeric id -if ( - typeof recordOrId !== 'object' || - recordOrId === null || - typeof recordOrId.id !== 'number' -) { - return await originalActions[ storeName ][ - actionName - ]( ...args ); -} +// Handle both object and number forms of recordOrId +if ( typeof recordOrId === 'number' ) { + // If it's just an ID, we can't strip status anyway + return await originalActions[ storeName ][ + actionName + ]( ...args ); +} + +// Ensure recordOrId is object with numeric id +if ( + typeof recordOrId !== 'object' || + recordOrId === null || + typeof recordOrId.id !== 'number' +) { + return await originalActions[ storeName ][ + actionName + ]( ...args ); +}Likely an incorrect or invalid review comment.
packages/js/email-editor/changelog/add-middleware-to-strip-post-status-on-save (1)
1-4
: LGTM!The changelog entry follows the correct format and clearly describes the middleware addition.
packages/js/email-editor/src/middleware/strip-post-status-on-save.ts
Outdated
Show resolved
Hide resolved
packages/js/email-editor/src/middleware/strip-post-status-on-save.ts
Outdated
Show resolved
Hide resolved
Testing GuidelinesHi @triple0t , Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lysyjan, Thanks for the PR.
I'm trying to understand this PR a little more.
Can you explain why we are stripping the post status on the editor core and not in the integrations themselves (e.g, MailPoet)?
What side effect would this change have?
Is there an alternative considered?
That's a good point. I was so focused on the problem that I didn't consider this option, but it looks like the best solution. @triple0t I am going to move the middleware into MailPoet. Do you agree with this approach? This step should reduce the size of this PR to two tiny fixes. We can add this layer later when other integrators need similar behavior. |
@lysyjan, yes, I'm okay with that. |
@triple0t I moved the mindleware into MailPoet plugin, so this PR contains only tiny fixes and adding the export storeName that is used in MailPoet. |
Submission Review Guidelines:
Changes proposed in this Pull Request:
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Testing that has already taken place:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment