creditmemo_created event registered twice if creditmemo mail is sent async
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 357
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
### Preconditions (*)
1. Setup order/creditmemo mail sending in Magento.
2. Enable async mail sending.
### Steps to reproduce (*)
1. Place and invoice order.
2. Create creditmemo based on invoice, return items to stock and send copy of creditmemo as email to customer.
3. Order is now closed and `creditmemo_created` event is saved in inventory_reservation table.
4. Run `sales_send_order_creditmemo_emails` cronjob
5. Another `creditmemo_created` event is saved in inventory_reservation table.
### Expected result (*)
1. `creditmemo_created` event is saved only once.
### Actual result (*)
1. `creditmemo_created` event is saved twice.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the flow with async mail enabled, following creditmemo creation and the sales_send_order_creditmemo_emails cronjob. Compare when creditmemo_created is persisted in inventory_reservation before and after the cronjob; done means the event is saved only once.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100