Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sanity): prevent empty patches being created #7499

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

juice49
Copy link
Contributor

@juice49 juice49 commented Sep 12, 2024

Description

This branch prevents the patch Actions API operation resulting in an empty array of mutations being executed, regardless of whether the operation is a noop.

This caused Studio to get stuck in a syncing state when all of the following conditions were true:

  1. Attempting to publish a draft that has no corresponding published document.
  2. A custom publish action sets a document value prior to publication.
  3. The value the custom publish action tries to set is already the value set in the draft.

What to review

Does this solution make sense?

Testing

This can be tested in Test Studio by:

  1. Navigating to a document with custom document actions.
  2. Creating a new document.
  3. Setting the "Some Boolean" field to true in the UI.
  4. Executing the "Custom publish that sets someBoolean to true" document action.

Prior to this fix, Studio would become stuck in a "saving" state, and the document would never be published.

Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 2:58pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 2:58pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 2:58pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 2:58pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 2:58pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Sep 12, 2024 2:58pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Sep 12, 2024

Component Testing Report Updated Sep 12, 2024 3:20 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 43s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 38s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 10s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 45s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 46s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 17s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 8s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 26s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 36s 12 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

@juice49 juice49 marked this pull request as ready for review September 13, 2024 08:26
@juice49 juice49 requested a review from a team as a code owner September 13, 2024 08:26
@juice49 juice49 requested review from ryanbonial and removed request for a team September 13, 2024 08:26
@juice49 juice49 added this pull request to the merge queue Sep 13, 2024
Merged via the queue into next with commit 99f1bb6 Sep 13, 2024
68 of 69 checks passed
@juice49 juice49 deleted the fix/corel-171/actions-api-patch-publish-action branch September 13, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants