-
Notifications
You must be signed in to change notification settings - Fork 431
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: prevent key value store from firing setKey for each open subscri… #5997
Merged
cngonzalez
merged 1 commit into
feat/fetch-settings-from-backend
from
fix/simplify-kv-store
Mar 14, 2024
Merged
fix: prevent key value store from firing setKey for each open subscri… #5997
cngonzalez
merged 1 commit into
feat/fetch-settings-from-backend
from
fix/simplify-kv-store
Mar 14, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
cngonzalez
force-pushed
the
fix/simplify-kv-store
branch
from
March 13, 2024 21:24
a5a058b
to
7e70e63
Compare
Component Testing Report Updated Mar 13, 2024 9:33 PM (UTC)
|
bjoerge
approved these changes
Mar 14, 2024
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 catch, and great solution!
cngonzalez
merged commit Mar 14, 2024
5482b8e
into
feat/fetch-settings-from-backend
32 of 35 checks passed
cngonzalez
added a commit
that referenced
this pull request
Mar 14, 2024
cngonzalez
added a commit
that referenced
this pull request
Mar 14, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 14, 2024
* feat(core): fetch structure tool settings from backend (#5901) * feat(core): store recent search history in backend (#5940) * feat(core): fetch inspect mode from backend (#5938) * chore: update studio version for production-ready cellar (#5993) * fix: prevent key value store from firing setKey for each open subscription (#5997) * fix: update tests to match api (#6000) * fix: update tests to match api * fix: comment out flaky tests for now * chore: remove unused resolve logic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The KeyValueStore used to emit a setKey event (setting off a PUT call to the backend) for every open subscription. This means we could fire off 3-4 PUT calls for the same key in quick succession. To keep state tidy and make this scalable, I've added a shareReplay function here, which we use in other parts of the studio (especially stores in the resource cache). I've seen no ill effects or stale data, so I think it's a decent solution.
What to review
Any gotchas with this approach, or any other negative side effects I may be missing.
Testing
There are e2e tests for this branch, but no tests specifically for this case. I can add additional tests in the refactor PR for e2e tests.