Skip to content

Sales order grid doesn't pull in missing sales #36384

@edward-simpson

Description

@edward-simpson

Preconditions and environment

  • Magento version 2.4.5-p1
  • dev/grid/async_indexing set to 1
  • at least 2 existing orders

Steps to reproduce

  1. Sort sales_order_grid by updated_at oldest first
  2. Delete the first row (so you are deleting the order with the oldest updated_at
  3. Run the sales_grid_order_async_insert cron job

I'm aware this is unlikely to happen in real life, but we are unaware of exactly how this state occurred, potentially the cron got killed off before the older order was synced

Expected result

The deleted grid order should get re-created, allowing the order to be viewed in the admin panel sales grid section

Actual result

The deleted grid order does not get re-created, the order cannot be viewed in the admin panel sales grid section, leading admin panel users to believe the order does not exist.

Note: There is no issue if any other order is deleted from sales_order_grid DB table.

Additional information

The sales_order_grid entry doesn't get re-created because it does not match the conditions which trigger this:

  • sales_order entry has an updated_at newer than the most recent sales_order_grid entry
  • the sales_order entry has a newer updated_at than the equivalent entry in the sales_order_grid (this doesn't match because the sales_order_grid entry doesn't exist)

Workaround is to update the sales_order.updated_at to be more recent than the most recent sales_order_grid.updated_at value. This can be tricky as the cron runs every minute, you have to time it correctly and get the value right, as you risk updating it to a value which then stops newer orders getting pulled into the grid

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions