Skip to content

Order save() updates all fields instead of only changed ones, causing data loss in concurrent processes #40147

@marcinfr

Description

@marcinfr

Preconditions and environment

No response

Steps to reproduce

  1. Load an order (e.g. via OrderRepository or model load).
  2. Modify one field (for example, a staus).
  3. Call save().
  4. Check the executed SQL queries.

Expected result

Only modified fields should be updated in the database, so that concurrent saves do not overwrite unrelated data.

Actual result

  • Magento executes an UPDATE query that includes all columns, not just the modified ones.
  • This behavior causes data loss if two separate processes load two different orders and save them around the same time, because they may overwrite each other’s changes on unrelated fields.

Additional information

No response

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

Assignees

No one assigned

    Labels

    Area: OrderComponent: SalesIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    Status

    Ready for Development

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions