-
Notifications
You must be signed in to change notification settings - Fork 409
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): add retry to image observer and loading state #6709
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
Component Testing Report Updated May 21, 2024 1:31 PM (UTC)
|
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.
Great find. We should investigate why we're getting stale data when refetching as a response to an event received from a listener set up with visibility=query
, but this is a nice workaround in the meantime.
Would be great if you could add a comment to the operator chain to make it easier to know if/when it can be removed.
packages/sanity/src/core/form/studio/inputs/client-adapters/assets.ts
Outdated
Show resolved
Hide resolved
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.
Thanks @pedrobonamin!
Description
We have a racing condition in the
BaseImageInput
component, in some cases, specially with big images the fetch request to resolve the reference is happening before the reference exists. Making the image input to persist in a "loading" state which nothing indicates it.Also, there was no retry option when the reference was not properly resolved.
With this changes, a retry option is added to the
observeAssetDoc
function, fixing this problem.Also, a loading state was included in the image input.
How to reproduce this issue:
Reproducing the issue in next
Screen.Recording.2024-05-17.at.11.20.41.mov
After fix
After the fix I was not able to reproduce this issue anymore.
Screen.Recording.2024-05-17.at.11.23.57.mov
What to review
Testing
Manual testing of the issue, couldn't reproduce it.
Notes for release