Closed juice49 closed 1 week ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
performance-studio | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 17, 2024 11:48am |
test-next-studio | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 17, 2024 11:48am |
test-studio | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 17, 2024 11:48am |
No changes to documentation
Component Testing Report Updated May 17, 2024 11:53 AM (UTC)
File | Status | Duration | Passed | Skipped | Failed |
---|---|---|---|---|---|
comments/CommentInput.spec.tsx | ✅ Passed (Inspect) | 35s | 15 | 0 | 0 |
formBuilder/ArrayInput.spec.tsx | ✅ Passed (Inspect) | 6s | 3 | 0 | 0 |
formBuilder/inputs/PortableText/Annotations.spec.tsx | ✅ Passed (Inspect) | 25s | 6 | 0 | 0 |
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx | ✅ Passed (Inspect) | 31s | 11 | 7 | 0 |
formBuilder/inputs/PortableText/Decorators.spec.tsx | ✅ Passed (Inspect) | 14s | 6 | 0 | 0 |
formBuilder/inputs/PortableText/FocusTracking.spec.tsx | ✅ Passed (Inspect) | 36s | 15 | 0 | 0 |
formBuilder/inputs/PortableText/Input.spec.tsx | ✅ Passed (Inspect) | 1m 16s | 21 | 0 | 0 |
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx | ✅ Passed (Inspect) | 1m 3s | 18 | 0 | 0 |
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx | ✅ Passed (Inspect) | 6s | 3 | 9 | 0 |
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx | ✅ Passed (Inspect) | 20s | 9 | 0 | 0 |
formBuilder/inputs/PortableText/Styles.spec.tsx | ✅ Passed (Inspect) | 14s | 6 | 0 | 0 |
formBuilder/inputs/PortableText/Toolbar.spec.tsx | ✅ Passed (Inspect) | 30s | 12 | 0 | 0 |
Description
This branch adds optimistic locking when publishing documents via the Actions API by adopting its
ifDraftRevisionId
andifPublishedRevisionId
guards. These guards are a recent addition to the Actions API.Optimistic locking ensures the editor can see the latest state of both the draft document they are publishing, and the published document they are choosing to replace.
Additionally, this branch adds a check prior to publishing that ensures Studio has a draft snapshot. This check is already in place when publishing via the Mutations API. It stands to reason that the editor must be able to see the draft they are choosing to publish.
What to review
Is the usage of the
ifDraftRevisionId
andifPublishedRevisionId
guards correct?Testing
execute
throws if the client has no draft snapshot.packages/sanity/src/core/store/_legacy/document/document-pair/serverOperations/publish.test.ts
.