Fix lessons not being saved when creating a course on the latest Gutenberg version #7091
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.
Resolves #7083
Proposed Changes
This bug was caused because of the logic detecting if a post is saved does not work on the latest Gutenberg version.
In our logic, we're tracking 3 different save requests - saving the post, saving the post meta, and saving the course structure. The problem was that in the latest Gutenberg version, the post meta saving request starts while the post saving request is still running. That caused a bug because the logic wasn't expecting the requests to happen in parallel. This PR changes the logic to track the requests independently.
I wasn't able to find a good way to add integration tests for this, but it should be covered by E2E tests already.
Testing Instructions
Pre-Merge Checklist