-
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
fix: Do not report MANIFEST RESTRICTIONS_CANNOT_BE_MET error twice #4194
fix: Do not report MANIFEST RESTRICTIONS_CANNOT_BE_MET error twice #4194
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.
It would be nice to have a regression test for this, so that a future refactor doesn't introduce the error again. @albertdaurell, please follow-up with a test that fails without the fix and passes with it.
Thx @joeyparrish. Here it is #4205 |
…4194) We want to avoid reporting MANIFEST RESTRICTIONS_CANNOT_BE_MET error twice. This is because when error detected from `onKeyStatus_` calls `updateAbrManagerVariants_` which calls `checkRestrictedVariants_` and error is catched and propagated from `onError_` **but source code execution continues** and `chooseVariantAndSwitch_` triggers same error again: ```javascript onKeyStatus_() { .... if (tracksChanged) { this.updateAbrManagerVariants_(); // -> checkRestrictedVariants_ // -> RESTRICTIONS_CANNOT_BE_MET } ... if (currentVariant && !currentVariant.allowedByKeySystem) { ... this.chooseVariantAndSwitch_(); // -> chooseVariant_ // -> updateAbrManagerVariants_ // -> checkRestrictedVariants_ // -> RESTRICTIONS_CANNOT_BE_MET } ``` Closes #4190
…4194) We want to avoid reporting MANIFEST RESTRICTIONS_CANNOT_BE_MET error twice. This is because when error detected from `onKeyStatus_` calls `updateAbrManagerVariants_` which calls `checkRestrictedVariants_` and error is catched and propagated from `onError_` **but source code execution continues** and `chooseVariantAndSwitch_` triggers same error again: ```javascript onKeyStatus_() { .... if (tracksChanged) { this.updateAbrManagerVariants_(); // -> checkRestrictedVariants_ // -> RESTRICTIONS_CANNOT_BE_MET } ... if (currentVariant && !currentVariant.allowedByKeySystem) { ... this.chooseVariantAndSwitch_(); // -> chooseVariant_ // -> updateAbrManagerVariants_ // -> checkRestrictedVariants_ // -> RESTRICTIONS_CANNOT_BE_MET } ``` Closes #4190
…4194) We want to avoid reporting MANIFEST RESTRICTIONS_CANNOT_BE_MET error twice. This is because when error detected from `onKeyStatus_` calls `updateAbrManagerVariants_` which calls `checkRestrictedVariants_` and error is catched and propagated from `onError_` **but source code execution continues** and `chooseVariantAndSwitch_` triggers same error again: ```javascript onKeyStatus_() { .... if (tracksChanged) { this.updateAbrManagerVariants_(); // -> checkRestrictedVariants_ // -> RESTRICTIONS_CANNOT_BE_MET } ... if (currentVariant && !currentVariant.allowedByKeySystem) { ... this.chooseVariantAndSwitch_(); // -> chooseVariant_ // -> updateAbrManagerVariants_ // -> checkRestrictedVariants_ // -> RESTRICTIONS_CANNOT_BE_MET } ``` Closes #4190
…twice (shaka-project#4194)" This reverts commit 0b03e79.
Description
We want to avoid reporting MANIFEST RESTRICTIONS_CANNOT_BE_MET error twice.
This is because when error detected from
onKeyStatus_
callsupdateAbrManagerVariants_
which callscheckRestrictedVariants_
and error is catched and propagated fromonError_
but source code execution continuesand
chooseVariantAndSwitch_
triggers same error again:Resolves
#4190