Auto-save conflict upon populating an empty required `type: string` SDC prop and immediately publishing

Created on 24 July 2025, 2 days ago

Overview

Reported by @mayur-sose at

However, I observed the following issue: if a required text field is left blank and a publish attempt is made, the system correctly throws an error. But after entering a value into the text field and trying to publish again, the user is prompted to refresh the page with the message:

“Your latest change was not saved because the content was modified elsewhere since you loaded the page. Please refresh your browser to receive the latest changes and continue.”

Additionally, the publish tool displays this error:

“An item in the publish request did not match the expected format or value. Please refresh your page and try again.”

Refreshing the page resolves the issue, but this workflow could be improved so that the refresh message does not appear every time.

@Wim Leers tried to reproduce and:

Reproduced:

Investigated that and:

  1. the first message is coming from ui/src/features/editor/ConflictWarning.tsx, introduced in 📌 [PP-1] Enforce conflict enforcement outside of tests and e2e tests Postponed
  2. the second message is coming from \Drupal\experience_builder\Controller\UnmatchedItemInPublishRequest, introduced in 🐛 Messages in \Drupal\experience_builder\Controller\ErrorCodesEnum are not helpful Active

Proposed resolution

This is not reproducible every time, but almost every time.

It's just a race condition in the auto-save system. It's literally what both of the referenced issues were about. We'll just need to harden against that.

User interface changes

📌 Task
Status

Active

Version

1.0

Component

Auto-save

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

  • Issue created by @wim leers
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Crediting Mayur for finding this.

    Assigning to Auto-save maintainer @tedbow to investigate deeper, and to decide whether this requires only front-end changes or not.

  • 🇺🇸United States tedbow Ithaca, NY, USA

    I don't think it has anything to do with error about the require field. Instead I think is actually because when Page is already checked in "review x changes" then the client doesn't request the update list after there are new changes. It just happens it was discovered because when you get the error about the require property the UI leaves the page checked in "review X changes"

    It should be reproducible via

    1. Open XB with no pending changes
    2. create a new page
    3. make a change to the title
    4. wait till "review 1 change" to show
    5. click "review 1 change"
    6. select the new page in the "unpublished changes" list but do not publish
    7. close the "unpublished changes"
    8. make another change to the title
    9. wait a few seconds, to ensure this not a problem with a race condition
    10. click "review 1 change",
    11. observe that page is still selected
    12. wait a few seconds, to ensure this not a problem with a race condition
    13. click publish
    14. you should get the error

    It appears that if you have something selected in the "unpublished changes" list then even when you close the list and make a new change the client does not request the pending changes from /xb/api/v0/auto-saves/pending

    If you do the same steps but do not select the page for publishing until after you have viewed and closed the "unpublished changes" list 1x time and only select it right before publishing you will not get the problem

    There may be other race conditions still but I think the problem described is actually a race condition it doesn't matter how long you wait between the steps you will still run into the problem.

    I think this needs a front-end fix

    Might have been introduced in 📌 Create UI for selective publishing of changes Active because that is where the ability to select individual items to publish was added

    Assigining to @mred9 because I think he does most of the front-end work there

  • 🇺🇸United States tedbow Ithaca, NY, USA
  • 🇺🇸United States tedbow Ithaca, NY, USA
Production build 0.71.5 2024