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

api: Fix recording webhooks #1360

Merged
merged 7 commits into from
Oct 25, 2022
Merged

api: Fix recording webhooks #1360

merged 7 commits into from
Oct 25, 2022

Conversation

victorges
Copy link
Member

What does this pull request do? Explain your changes. (required)
As an exercise of understanding the current recording pipeline as we'll need
to revamp it soon for the catalyst integreation (and since a key customer was
suffering with that), I found some easy improvements we could make to the
recording webhooks in order to make them more useful.

The main changes revolve towards sending the session object with the recording
both on the started and ready webhooks. For that, it also required changing the
point in the code where we send the recording.started (but the ready had to stay
where it was).

Specific updates (required)

  • Move the recording.ready hook from /setactive to POST /stream/:id (MistProcLivepeer), where we create the user session object
  • Add session object to the webhook payload both started and ready
  • Make sure that session object is the user session, not the final "child stream" from MistProcLivepeer. Relevant only for the recording.ready hook.

-

  • How did you test each of these updates (required)
  • Deploy to staging
  • Make a recorded livestream
  • Check webhooks are received with the session in payload

Does this pull request close any open issues?
Fixes customer issue.

Screenshots (optional):
https://webhook.site/#!/d5fd9d61-383c-4891-8d10-0e29886fef50/c587140c-a5ae-4b22-a576-7d35f0553ff8/1

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@victorges victorges requested a review from a team as a code owner October 22, 2022 00:13
@vercel
Copy link

vercel bot commented Oct 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
livepeer-studio ✅ Ready (Inspect) Visit Preview Oct 22, 2022 at 0:17AM (UTC)

@codecov
Copy link

codecov bot commented Oct 22, 2022

Codecov Report

Merging #1360 (fd452a0) into master (8f39e16) will increase coverage by 0.21709%.
The diff coverage is 70.58824%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #1360         +/-   ##
===================================================
+ Coverage   51.90412%   52.12121%   +0.21709%     
===================================================
  Files             68          68                 
  Lines           4464        4455          -9     
  Branches         834         829          -5     
===================================================
+ Hits            2317        2322          +5     
+ Misses          1851        1838         -13     
+ Partials         296         295          -1     
Impacted Files Coverage Δ
packages/api/src/controllers/stream.ts 50.15974% <42.85714%> (+0.79265%) ⬆️
packages/api/src/controllers/session.ts 18.80342% <90.00000%> (+2.97009%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f39e16...fd452a0. Read the comment docs.

Impacted Files Coverage Δ
packages/api/src/controllers/stream.ts 50.15974% <42.85714%> (+0.79265%) ⬆️
packages/api/src/controllers/session.ts 18.80342% <90.00000%> (+2.97009%) ⬆️

Copy link
Member

@iameli iameli left a comment

Choose a reason for hiding this comment

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

LGTM that nothing's obviously off, not intimately familiar with this anymore

@victorges victorges merged commit cb1183d into master Oct 25, 2022
@victorges victorges deleted the vg/fix/recording-started-hook branch October 25, 2022 16:10
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