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 LockedStream console error by providing metaData in advance #71

Merged
merged 3 commits into from
Dec 15, 2022

Conversation

iansvo
Copy link
Contributor

@iansvo iansvo commented Nov 23, 2022

Description of the Change

This change resolves a reported error that occurs due to the metaData key being missing from the initialTracks provided to Webamp.

You can reproduce this error on the official CodeSandbox demo by just removing the metaData key: https://codesandbox.io/s/y0xypox60z.

Closes #46

How to test the Change

  1. Load the block on any page and confirm no LockedStream promise errors appear in the console and the tracks have the correct metadata.

Changelog Entry

Fixed - Updated initialTracks to include metaData to prevent a LockedStream console error.

Credits

Props @iansvo @ajmaurya99

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.

Providing the metadata should prevent the locked stream error.

Additional formatting fixes were also applied.
@iansvo
Copy link
Contributor Author

iansvo commented Nov 23, 2022

One caveat to note here is that this behavior is only applied to the frontend of the site. It might be worth applying this same consideration to the editor interface, but it feels like a lower value-to-time ratio for that lift.

If we were to do it in the editor we'd just need to be able to get the attachment metadata via a JS method and then just do the same thing I'm doing in the frontend.js file when WebAmp is initialized.

@jeffpaul jeffpaul added this to the 1.1.1 milestone Nov 30, 2022
@jeffpaul jeffpaul removed their request for review November 30, 2022 17:54
Sidsector9
Sidsector9 previously approved these changes Dec 11, 2022
Copy link
Member

@Sidsector9 Sidsector9 left a comment

Choose a reason for hiding this comment

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

LGTM, tested well 👍

@jeffpaul
Copy link
Member

@cadic resolving the merge conflict here and then merging this would be helpful, thanks!

@cadic
Copy link
Contributor

cadic commented Dec 15, 2022

@Sidsector9 this needs another review after conflicts resolved (just package-lock.json)

Sidsector9
Sidsector9 previously approved these changes Dec 15, 2022
Copy link
Member

@Sidsector9 Sidsector9 left a comment

Choose a reason for hiding this comment

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

Tested well 👍

Copy link
Member

@Sidsector9 Sidsector9 left a comment

Choose a reason for hiding this comment

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

Added a fix for JS linting errors

@Sidsector9 Sidsector9 merged commit ce013e5 into develop Dec 15, 2022
@Sidsector9 Sidsector9 deleted the fix/46-console-errors branch December 15, 2022 09:30
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.

Console error in the Editor and FE when previewing the Winamp Player
4 participants