fix!: ignore metadata when setting entry unsaved flag #3305
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Relation widget updates metadata when first loading the relationship mapping.
These metadata updates cause any collections using the relation widget to always
get marked as having usaved changes whenever they are opened.
Note: This is obviously a pretty serious change to the underlying data model
semantics. It might not make sense, but there didn't seem to be a better way of handling
the relation widget without adding an extra field to the DRAFT_CHANGE_FIELD action
to flag that this is a metadata only change and to leave the
hasChanged
field alone.This is the 'metadata fix' from #2377. Some of the issues reported in #725 will be resolved (#725 is only for new entries and default values, but many of the relation widget complaints for existing entries are being funneled to that issue - see #2743)
fixes #2211
Test plan
I've testing this fixed the relation widget for myself. I wasn't able to run the e2e test package on this machine when trying the
tests:all
script. The new test spec sets thehasChanged
semantic.A picture of a cute animal (not mandatory but encouraged)