-
Notifications
You must be signed in to change notification settings - Fork 435
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(core): make sure to re-emit current edit state when re-subscribing to document validation #4954
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@@ -105,7 +106,7 @@ export const validation = memoize( | |||
// so only pass on documents if _other_ attributes changes | |||
return shallowEquals(omit(prev, '_rev', '_updatedAt'), omit(next, '_rev', '_updatedAt')) | |||
}), | |||
share(), | |||
shareLatestWithRefCount(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the line that fixes the issue. Since we were using share, re-subscribing to this observable didn't publish the current edit state of the document, leaving the validation in a pending state
No changes to documentation |
Component Testing Report Updated Sep 29, 2023 12:16 PM (UTC)
|
…g to document validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test looks good to me but it would be good to have someone else's eyes on it as well since I am not very familiar with this
Description
This fixes an issue that currently happens when editing a document that has a reference to an unpublished document, switching to another document and then switching back. Sometimes this could lead to the validation error for unpublished document reference being ignored.
Steps to reproduce:
Standard Inputs
>Reference Test
>REPRO SDX-736 #1
" and observe that the reference field has the correct validation errorREPRO SDX-736 #2
REPRO SDX-736 #1
" and notice that the validation error has disappeared.What to review
Go to the branch deployment (https://test-studio-git-sdx-736.sanity.build/test/content) and make sure the above steps does not cause the validation error to disappear
I also took the opportunity to fixe a couple of deprecation warnings while at it.
Notes for release