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

refactor(sanity): move bundle metadata store to resource cache #7077

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

juice49
Copy link
Contributor

@juice49 juice49 commented Jul 7, 2024

Description

This branch moves the bundle metadata store to the resource cache and removes the BundlesContext context, which is no longer required.

The bundle metadata store is initialised lazily when first subscribed to. Upon subscription, it will fetch a list of bundles and create a listener to keep the locally held state fresh.

The store is not disposed of when all subscriptions are closed. After it has been initialised, it will keep listening for the duration of the app's lifecycle. Subsequent subscriptions will be given the latest state upon subscription.

Note: the packages/sanity/src/core/releases/tool/__tests__/BundlesOverview.test.tsx test is failing, but this seems to have been occurring prior to the change.

What to review

Testing

Notes for release

Copy link

vercel bot commented Jul 7, 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 Jul 8, 2024 9:53pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2024 9:53pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2024 9:53pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2024 9:53pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2024 9:53pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jul 8, 2024 9:53pm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juice49 forgive me if I'm mixing concepts: would it be here that we should do the fetch for the existing versions of documents like @pedrobonamin brought up as a question in an earlier PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bundles store fetches the bundle documents from the addon dataset only.
We will need to fetch the version documents from other location, because we could in theory have a version document without a bundle

@RitaDias
Copy link
Contributor

RitaDias commented Jul 8, 2024

Left a comment!
I would prefer that we push @pedrobonamin 's change from PR #7074 before moving this one :)

@juice49 juice49 force-pushed the feat/resource-cache-bundle-metadata-store branch from aab7b2e to 48f20f3 Compare July 8, 2024 20:34
Copy link
Contributor

github-actions bot commented Jul 8, 2024

No changes to documentation

@juice49 juice49 force-pushed the feat/resource-cache-bundle-metadata-store branch from 48f20f3 to e9be93f Compare July 8, 2024 20:48
@juice49 juice49 force-pushed the feat/resource-cache-bundle-metadata-store branch from e9be93f to f9aafec Compare July 8, 2024 21:26
Co-authored-by: Pedro Bonamin <pedrobonamin@gmail.com>
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.

3 participants