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

Expose PeerTube socket to plugins #5239

Merged
merged 6 commits into from Oct 10, 2022

Conversation

kontrollanten
Copy link
Contributor

Description

Expose socket to plugins, so that they can send notifications and update live video state.

Related issues

#3282

Has this been tested?

Doesn't make sense to test this.

@Chocobozzz
Copy link
Owner

Thanks, but please design a public API so renaming an internal method don't impact plugins. Please also add server tests to ensure it correctly works.

@kontrollanten
Copy link
Contributor Author

Great input. I created two basic tests to just ensure the API is callable. To really ensure it works I guess we'd need to setup a WS client and check the message received. I couldn't find more ways in testing it. Any input?

@kontrollanten
Copy link
Contributor Author

@Chocobozzz The tests are failing at

Test live
       Live transcoding
         Should enable transcoding with some resolutions and correctly save them:
     AssertionError: expected 27 to be close to 30 +/- 2

I can't see that my changes affect this test, may it be flaky?

@Chocobozzz
Copy link
Owner

I can't see that my changes affect this test, may it be flaky?

I'll relax them!

Copy link
Owner

@Chocobozzz Chocobozzz left a comment

Choose a reason for hiding this comment

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

To really ensure it works I guess we'd need to setup a WS client and check the message received. I couldn't find more ways in testing it. Any input?

Yes, you can take inspiration of https://github.com/Chocobozzz/PeerTube/blob/develop/server/tests/api/live/live-socket-messages.ts#L72

server/lib/plugins/plugin-helpers-builder.ts Outdated Show resolved Hide resolved
server/tests/fixtures/peertube-plugin-test-four/main.js Outdated Show resolved Hide resolved
@Chocobozzz Chocobozzz merged commit c43ed8e into Chocobozzz:develop Oct 10, 2022
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

2 participants