-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: Cache mediaCapabilities.decodingInfo results #4789
Conversation
Incremental code coverage: 100.00% |
*/ | ||
static async getDecodingInfosForVariant_(variant, decodingConfig) { | ||
try { | ||
const cacheKey = JSON.stringify(decodingConfig); |
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 a problematic key. If the fields are serialized in a different order, this will fail to match.
It's better than no caching, but this needs work. Please file an issue to follow-up on this.
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's an entire ToTT episode on this subject, BTW, in context of comparing objects in tests using JSON.stringify. But it still applies here.)
* (stringified) decodingConfig. | ||
* | ||
* @type {Object.<(!string), (!MediaCapabilitiesDecodingInfo)>} | ||
* @export |
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.
Why is this exported? I don't think we want this exposed to the application and subject to backward compatibility guarantees.
If you just need it for unit testing, use @suppress
in a test helper instead.
Issue #4775