enhancement
major
minor
major
minor
major
#29667
TL Views: a form in edit mode keeps showing stale values after a command committed a change to the same object
Problem
A page-spanning <form> over an object is in edit mode with one changed field (summary). A command of the same page that commits in place — an <execute-script> in <with-transaction> setting status and adding an assignee — runs without any question and commits. The form keeps showing the old status and assignees; only a second window shows the committed state. A later Save writes only the fields changed in the form, so nothing is overwritten, but until then the edit form displays values that are no longer true and invites edits on top of them. Commands that open a dialog are guarded by the unsaved-changes dialog; commands committing in place are not. Seen in the TL Development app, ticket page (Accept while editing the summary), snapshot build 42.
Expected
A form in edit mode follows committed changes of its object for every field the user has not changed (the untouched fields show the new values; a conflict on a changed field is flagged). Alternatively, or in addition, a command that commits a change to the object of a form holding unsaved changes asks first, like <open-dialog> does.
Lösung
The lock the form acquires on entering edit mode does not help here: it is held by the very session whose command commits. The form already receives the update event of such a commit (and of commits of other sessions) through its ModelScope, but ignored it in edit mode.
In edit mode, an update of the displayed object now refreshes every field the user has not changed: its displayed value and its unchanged-reference value follow the committed state. Fields the user has changed keep the user's value and are written on Save as before; there is no three-way merge or conflict display. Composition tables and other form participants keep their buffered edits unchanged.
A command that should ask before committing next to a form with unsaved changes can already be configured with check-dirty="SELF".