MMT-3953: Fix for User is encountering latency issue with Save and Publish #1333
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.
Overview
What is the feature?
The "Save and Publish" menu option is causing an issue where the user is encountering a latency error mesage after clicking this option. This happens every time.
What is the Solution?
When the save and publish updates the draft, there is a use effect that verifies that the revision id saved matches what is in the url after the save. The issue was that the URL was not being updated in between the time the save happened and the publish navigating away from the page. The fix was simply to include the navigate to update the page revision id while publishing.
What areas of the application does this impact?
Metadata Form menu navigate menu options.
Testing
Create a draft, fill in all the required fields, click Save. The click Save and Publish. The draft should now properly redirect to the preview page without any errors.
Checklist