Skip to content

Legacy mode fix: release reserved increment_id after cancel/submit to…#1964

Open
garmashdev wants to merge 1 commit into
masterfrom
ygarmash/legacy_backend_orders_fix
Open

Legacy mode fix: release reserved increment_id after cancel/submit to…#1964
garmashdev wants to merge 1 commit into
masterfrom
ygarmash/legacy_backend_orders_fix

Conversation

@garmashdev
Copy link
Copy Markdown
Collaborator

@garmashdev garmashdev commented Apr 17, 2026

Description

  • Merchants running with M2_CANCEL_FAILED_PAYMENT_ORDERS_INSTEAD_OF_DELETING hit a loop: after a failed payment the canceled order keeps its increment_id, the admin session quote still carries the same bolt_reserved_order_id, and the next attempt trips doesOrderExist → popup "Order was created. Please reload the page and try again".
  • Same symptom also appears after a successful backoffice order when JS re-fetches the order token on the same admin page.

Fix

  • Helper/Order::dispatchPostCheckoutEvents - null bolt_reserved_order_id + reserved_order_id on the parent quote after checkout_submit_all_after dispatch (so observers still see the id).
  • Helper/Order::cancelFailedPaymentOrder - same null-out after cancellation (guarded by if ($parentQuote)).

Fixes: (link ticket)

#changelog Legacy mode fix: release reserved increment_id after cancel/submit to…

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please validate that you have tested your change in at least one of the following areas:

  • Successfully tested locally (or docker image)
  • Successfully tested on a staging or sandbox server
  • Successfully tested on a merchant's staging server

For PR Reviewer

  • Reviewed unit tests to make sure we are using real components rather than mocks as much as possible?
  • For any major change (observer, new Bolt feature, core Magento interaction) we must add a feature switch, did you verify this?

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • New and existing unit tests pass locally with my changes.
  • I have created or modified unit tests to sufficiently cover my changes.
  • I have added my ticket link and provided a changelog message.

@garmashdev garmashdev requested a review from a team as a code owner April 17, 2026 04:50
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Apr 17, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@peril-bolt
Copy link
Copy Markdown

peril-bolt Bot commented Apr 17, 2026

Warnings
⚠️ Please make sure to add new test or update existing tests

Generated by 🚫 dangerJS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants