You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit a node and check that a correct complete is sent in /api/sync request whenever its value changes. Validation rules are listed here.
Implementation Notes
After playing with several approaches, including forcing complete to be present on each related Resource's updates, I ended up using what @rtibbles initially suggested, and that is to rather evaluate and set complete in corresponding actions. This solution has shown to be more flexible than other approaches that usually ended up with lots of unnecessary code in our views for operations that do not even affect the completeness of a node. As long as we run this evaluation on clients only, we'll need to be careful about not forgetting to have all data available, whatever strategy used.
Checklist
Is the code clean and well-commented?
Has the docs label been added if this introduces a change that needs to be updated in the user docs?
Has the CHANGELOG label been added to this pull request? Items with this label will be added to the CHANGELOG at a later time
Are there tests for this change?
Are all user-facing strings translated properly (if applicable)?
Has the notranslate class been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)?
Are all UI components LTR and RTL compliant (if applicable)?
The reason will be displayed to describe this comment to others. Learn more.
Although I am not 100% sure, I assume that this watcher might be the cause of some inconsistencies we've been experiencing lately because (1) it updates a content node in another tick, and (2) the update is run in another transaction than updates that triggered complete re-evaluation.
I haven't closed any related issues I am assigned to though. I'd like to test everything at once after @micahscopes is done with his updates addressing some other, but possibly related, problems.
The reason will be displayed to describe this comment to others. Learn more.
Read through of the code changes makes sense to me, and definitely seems like a good change to consolidate this outside of the component code and into the actions. (I just reread your PR comment, and had forgotten that this was my initial suggestion, so I am glad I am consistent at least).
I've done some manual testing and I think everything is working (at least in my understanding of using Studio so far 😄) - both from the UX point of view and with the true/false values for complete returning as expected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Description
Make
completevalidation more robust:completein corresponding actions in one transaction together with the related node updatesIssue Addressed
Closes#2482
Steps to Test
completeis sent in/api/syncrequest whenever its value changes. Validation rules are listed here.Implementation Notes
After playing with several approaches, including forcing
completeto be present on each relatedResource's updates, I ended up using what @rtibbles initially suggested, and that is to rather evaluate and setcompletein corresponding actions. This solution has shown to be more flexible than other approaches that usually ended up with lots of unnecessary code in our views for operations that do not even affect the completeness of a node. As long as we run this evaluation on clients only, we'll need to be careful about not forgetting to have all data available, whatever strategy used.Checklist
docslabel been added if this introduces a change that needs to be updated in the user docs?CHANGELOGlabel been added to this pull request? Items with this label will be added to the CHANGELOG at a later timenotranslateclass been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)?pages,components, andlayoutsdirectories as described in the docs?