EntityFormController should load auto save state if it exists

Created on 23 March 2025, about 2 months ago

Overview

When you're editing an entity and make changes to the page data form fields, these are saved in auto-save
If you reload the page the form doesn't reflect the values in the auto-save store

Proposed resolution

Load form-state from auto-save store in EntityFormController

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Redux-integrated field widgets

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

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

Merge Requests

Comments & Activities

  • Issue created by @larowlan
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    AFAICT this issue queue component is a more precise match?

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    This is most obvious after πŸ“Œ Add e2e tests for multi-value textfield widget in page data form Active because if you have added multiple items via ajax, they're missing if you reload the page

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Postponed on πŸ“Œ Add e2e tests for multi-value textfield widget in page data form Active
    Bumping to critical because there is data loss here.
    Updated issue summary.
    This can be based on top of πŸ“Œ Add e2e tests for multi-value textfield widget in page data form Active if someone wants to work on it in the meantime.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Will start this tomorrow based on the very clear suggestions in the issue summary. Thanks @larowlan!

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    If you're debugging, this hunk in FormBuilder is where it should pick up the form cache based on the autosave entry.

  • Pipeline finished with Failed
    13 days ago
    Total: 259s
    #487441
  • Pipeline finished with Failed
    13 days ago
    Total: 614s
    #487444
  • Pipeline finished with Failed
    13 days ago
    Total: 1268s
    #487451
  • Pipeline finished with Failed
    13 days ago
    Total: 717s
    #487478
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    I'm a little puzzled. End-to-end tests are failing because there are several places where they assert that the form build ID has changed. That, apparently, is now inverted by what we're doing here. What's the correct approach here -- do we expect the same form build ID to persist (in which case these assertions need to be changed), or do we expect a new build of the form, populated by data from the auto-save manager?

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    I think what is happening is the converse of what we're fixing in the issue this is blocked on

    IE there's a cached programmed form state, which prevents Ajax rebuilding the form

    It felt too easy that this would just work πŸ˜„

    The changes the other issue make to ensure the form state is programmed even if cached. We will need the controller to ensure the form state is not programmed even if cached

    Can pick it up Tues morn my time

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    🀦I'm overthinking it
    We can't set input on post requests as it ignores the submitted values
    So we just need to wrap the new changes in a check for GET method on the request
    Hopefully that's the sauce

  • Pipeline finished with Failed
    10 days ago
    Total: 740s
    #489445
  • Pipeline finished with Failed
    10 days ago
    Total: 436s
    #489461
  • Pipeline finished with Failed
    10 days ago
    Total: 813s
    #489462
Production build 0.71.5 2024