-
Notifications
You must be signed in to change notification settings - Fork 32
🐛 [Frontend] Fix: Service's Pricing Plans #8035
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
🐛 [Frontend] Fix: Service's Pricing Plans #8035
Conversation
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.
Pull Request Overview
Fixes the caching mechanism for service pricing plans by switching from a single-string key to a nested cache keyed by service identifier and version.
- Extract service identifier and version for cache lookup instead of using the full URL string.
- Update cache retrieval to check nested keys, and cache storage to initialize and populate per-service-version entries.
- Adjust logic in
getPricingPlanto align with new nested cache structure.
Comments suppressed due to low confidence (3)
services/static-webserver/client/source/class/osparc/store/Services.js:354
- [nitpick] Using generic names
keyandversioncan cause confusion. Consider renaming toserviceKeyandserviceVersion(orcacheKey/cacheVersion) to clarify their purpose.
const version = serviceUrl["version"];
services/static-webserver/client/source/class/osparc/store/Services.js:372
- There are no existing tests covering the new nested cache behavior. Please add unit tests to verify cache lookups and storage for various service keys and versions.
this.__pricingPlansCached[key][version] = pricingPlansData;
services/static-webserver/client/source/class/osparc/store/Services.js:353
- The
serviceUrlreturned bygetServiceUrlis typically a string, not an object withkeyandversionproperties. Instead, use the originalserviceKeyandserviceVersionparameters to index the cache.
const key = serviceUrl["key"];
mguidon
left a comment
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.
Merci. Could that be hot-fixed at some point?
matusdrobuliak66
left a comment
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!
Let's ask @pcrespov what label we should use for hotfix candidates 👍 |
pcrespov
left a comment
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.
“There are only two hard things in Computer Science: cache invalidation and naming things.”
— Phil Karlton
@matusdrobuliak66 @mguidon list them to the corresponding hotfix issue. In this case I found a one-for-all hotfix issue #8003 |
sanderegg
left a comment
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
|
@mergify queue |
🟠 Waiting for conditions to match
|
|



What do these changes do?
The frontend wasn't caching Service's Pricing Plans correctly. This PR fixes it.
Buggy:

Fixed:

Related issue/s
How to test
Dev-ops