Fixing outdated entities issue after update to version 1.11

Created on 28 March 2024, 9 months ago
Updated 4 August 2024, 5 months ago

Problem/Motivation

After updating to version 1.11, I noticed that sometimes I was getting outdated information. My tests flagged this issue, and I discovered it's because of a change made in #3098924.

Previously, the system fetched the latest data directly from the database. Now, it retrieves related data from the current object, which might not be up-to-date.

Steps to Reproduce

Here's what happened in my case:

1) I added a paragraph field to an order item.
2) In my service, I changed the content of this paragraph and saved it.

What I expected: When I accessed the paragraph later, I expected to see the updated version.
What actually happened: I got the old version of the paragraph, which didn't reflect the changes I made.

Proposed Resolution

Short-term: We can revert the changes introduced in #3098924 πŸ› referencedEntities() causes data loss Needs review . This will bring back the old method of fetching data directly from the database, which is more reliable.

Long-term: We should keep an eye on the ongoing discussion in #2826717 πŸ› EntityReferenceFieldItemList::referencedEntities might not return up-to-date entity objects Needs work . This issue is exploring ways to improve the current approach of fetching data. Once a solution is ready, we can either use it directly or adapt it to work with revisions.

This approach ensures that we have a working solution in the short term while also working towards a more robust and sustainable solution in the long term.

πŸ› Bug report
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine reflie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024