Skip to content
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

Prevent base stream from logging after stop #4564

Merged
merged 6 commits into from
May 17, 2022
Merged

Conversation

wehriam
Copy link
Contributor

@wehriam wehriam commented Feb 15, 2022

Prevent base stream from logging after stop

This PR will...

This PR will prevent the base stream controller from attempting to log after the state has changed to STOPPED.

Why is this Pull Request needed?

The logger is set to null when the state is STOPPED; this pull request prevents an unhandled type error.

Are there any points in the code the reviewer needs to double check?

Should the code check if this.warn is a function instead of checking the state?

Resolves issues:

#4092

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

…tting fragment loading following a rejection
@wehriam
Copy link
Contributor Author

wehriam commented Feb 15, 2022

Screenshot of Sentry event that identified issue:

Screen Shot 2022-02-15 at 1 19 36 PM

@@ -377,6 +377,9 @@ export default class BaseStreamController
this._handleFragmentLoadComplete(data);
})
.catch((reason) => {
if (this.state === State.STOPPED) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't exactly that it's stopped that it's an issue, but more so that destroy has been called.

this.hls = this.log = this.warn = null;

Adding an existence check here, but also if you could set this.log, and this.warn as possibly null, TypeScript should warn of all the locations that it needs to be an optional call. You could fix by changing it to this.warn?.(reason) as a shorthand.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching and submitting the PR!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itsjamie - You're welcome for the PR. Do you recommend that I make these changes or would you prefer to use my original solution?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge the PR as it exists now because this.resetFragmentLoading wouldn't have been running prior so likely should run post merge unless it should be in the case when the player has been destroyed.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the Stale label Apr 16, 2022
@robwalch robwalch removed the Stale label Apr 16, 2022
@itsjamie itsjamie enabled auto-merge May 13, 2022 19:30
@itsjamie itsjamie disabled auto-merge May 17, 2022 16:15
@itsjamie itsjamie merged commit c10359d into video-dev:master May 17, 2022
@itsjamie
Copy link
Collaborator

Ran local CI on macOS Chrome 101, 129 passing. Merging down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants