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

Refactoring: Code duplication EmailSender / ShipmentSender and so on #14885

Closed
amenk opened this issue Apr 27, 2018 · 11 comments
Closed

Refactoring: Code duplication EmailSender / ShipmentSender and so on #14885

amenk opened this issue Apr 27, 2018 · 11 comments
Assignees
Labels
Component: Sales Fixed in 2.4.x The issue has been fixed in 2.4-develop branch good first issue improvement Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: PR Created Indicates that Pull Request has been created to fix issue Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@amenk
Copy link
Contributor

amenk commented Apr 27, 2018

These classes do pretty much the same:
/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php

/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php

Should be refactored into one.
What is the reason we have two? Which one should be preferred?

Preconditions

Magento 2.4-develop

Steps to reproduce

  1. Observe two classes.

app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php
and
app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php

Expected result

Should have different behaviors, or refactored into one.

Actual result

Two classes almost the same.

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Apr 27, 2018
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Jul 25, 2018
@engcom-backlog-nickolas engcom-backlog-nickolas added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: Sales Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Jul 25, 2018
@engcom-backlog-nickolas

Hello @amenk, thank you for your report.
We've acknowledged the issue and added to our backlog.

@engcom-backlog-nickolas engcom-backlog-nickolas removed their assignment Jul 25, 2018
@korostii
Copy link
Contributor

Ran into this, as well.
FYI it seems that for some reason the ../Shipment/Sender/EmailSender.php gets invoked when a shipment is created via API (so, both classes are used by Magento).
This can be a rather nasty surprise if you attempt to modify the corresponding behaviour using a di.xml plugin as you'll need to declare two plugins at once.

@sivaschenko
Copy link
Member

Hi @rvoronovmeticulosity https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php was introduced to work with data interfaces instead of the concrete model. So I believe https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php can be marked as deprecated and client code refactored to use the new service.

@engcom-Echo engcom-Echo removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Dec 30, 2019
@engcom-Echo engcom-Echo self-assigned this Dec 30, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 30, 2019

Hi @engcom-Echo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Echo engcom-Echo added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch improvement Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Dec 30, 2019
@ghost ghost unassigned engcom-Echo Dec 30, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Echo
Thank you for verifying the issue. Based on the provided information internal tickets MC-30135 were created

Issue Available: @engcom-Echo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@m2-assistant
Copy link

m2-assistant bot commented Feb 2, 2020

Hi @drpayyne. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@vigneshbalasubramani
Copy link

#mm20in

@magento-engcom-team
Copy link
Contributor

@vigneshbalasubramani thank you for joining. Please accept team invitation here and self-assign the issue.

@m2-assistant
Copy link

m2-assistant bot commented Feb 2, 2020

Hi @vigneshbalasubramani. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


vigneshbalasubramani added a commit to vigneshbalasubramani/magento2 that referenced this issue Feb 2, 2020
@vigneshbalasubramani vigneshbalasubramani removed their assignment Feb 2, 2020
@drpayyne drpayyne self-assigned this Feb 5, 2020
@drpayyne drpayyne added the Progress: PR Created Indicates that Pull Request has been created to fix issue label Feb 6, 2020
@magento-engcom-team
Copy link
Contributor

Hi @amenk. Thank you for your report.
The issue has been fixed in #26714 by @drpayyne in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Sales Fixed in 2.4.x The issue has been fixed in 2.4-develop branch good first issue improvement Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: PR Created Indicates that Pull Request has been created to fix issue Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
Development

No branches or pull requests

10 participants