-
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
Store unload promise on player #613
Store unload promise on player #613
Conversation
is ongoing. Add check in Player.prototype.unload to see if an unload is currently underway, and if so, to return that Promise instead of creating a new one. Add method for creating unloading process Promise which nulls itself out when unloading is complete.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed the CLA! |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
Hi Chris, Thanks for the PR! I'd like to see an additional test for this case in You can run the tests locally with Thanks again for contributing! |
* the unload promise. | ||
* @return {!Promise} | ||
*/ | ||
shaka.Player.prototype.createUnloadPromise_ = function(unloadProcess) { |
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.
Since you're passing in an unresolved Promise chain, and to keep terminology consistent with other parts of this file, change "unloadProcess" to "unloadChain" or "unloadPromiseChain".
Hi Joey, looks like I am probably using my work address for git but my personal address for the CLA, so I'll have to resolve that in the morning. Thanks. |
I added my work email to my Google email accounts, help me @googlebot you're my only hope |
CLAs look good, thanks! |
Based on PR #613 There was a bug where calling unload() right before calling load() would cause a race that would sometimes cause a failure. This is because the fields are reset before the unload is complete so the second call to unload() (from inside load) will complete immediately. So now we store the unload Promise chain while it is in progress so we can wait on it from load(). Closes #612 Change-Id: I6c0cdd931827d709fc41322edd51fe10e4aa87ae
Thanks for the contribution, but we decided to fix this slightly differently. |
Based on PR #613 There was a bug where calling unload() right before calling load() would cause a race that would sometimes cause a failure. This is because the fields are reset before the unload is complete so the second call to unload() (from inside load) will complete immediately. So now we store the unload Promise chain while it is in progress so we can wait on it from load(). Closes #612 Change-Id: I6c0cdd931827d709fc41322edd51fe10e4aa87ae
Fix for #612