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(test-studio): add repro case for using server actions with custom publish document action #6945

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Jun 14, 2024

Description

This branch removes usage of the ifDraftRevisionId optimistic lock when publishing documents using the Actions API. For custom publish document actions, snapshots.draft._rev may be stale, which means the ifDraftRevisionId optimistic lock cannot currently be used.

This is less safe, because it means it's technically possible for a user publishing a document via Studio to cause the publication of a draft that has not yet been synced to them. However, it's important to note this same issue exists with the Mutations API integration today. When the underlying staleness bug is fixed in the future, we should switch ifDraftRevisionId back on.

We still make use of ifPublishedRevisionId to ensure concurrent publish action invocations do not override each other.

What to review

That removing the ifDraftRevisionId optimistic lock does not introduce any failure points that do not already exist in the Mutations API integration.

Testing

Ensure that the "Custom publish that sets publishedAt to now" action (test/structure/input-debug;documentActionsTest) works as expected.

Copy link

vercel bot commented Jun 14, 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 Jun 18, 2024 10:24am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2024 10:24am
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2024 10:24am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2024 10:24am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2024 10:24am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jun 18, 2024 10:24am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Jun 14, 2024

Component Testing Report Updated Jun 18, 2024 10:30 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/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 45s 2 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 13s 20 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) 15s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 28s 12 0 0

…lication

Co-authored-by: Bjørge Næss <bjoerge@gmail.com>
juice49
juice49 previously approved these changes Jun 18, 2024
…blishing documents

Co-authored-by: Bjørge Næss <bjoerge@gmail.com>
@juice49 juice49 merged commit 3064705 into next Jun 18, 2024
44 checks passed
@juice49 juice49 deleted the sdx-1407/patch-before-publish branch June 18, 2024 10:33
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.

None yet

2 participants