-
Notifications
You must be signed in to change notification settings - Fork 71
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
GH-109: Participant join before host webhook event #185
Conversation
Hello @lantrungseo, Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here. |
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
@lantrungseo Is this ready to review, or are you still working on this? I see some lint errors in the build pipeline. Could you take a look at those? |
@larkox this is still in progress. It's gonna be finished soon. |
…t-plugin-zoom into GH-109
Codecov Report
@@ Coverage Diff @@
## master #185 +/- ##
==========================================
- Coverage 20.85% 19.79% -1.06%
==========================================
Files 7 7
Lines 729 778 +49
==========================================
+ Hits 152 154 +2
- Misses 536 582 +46
- Partials 41 42 +1
Continue to review full report at Codecov.
|
Ready for review! |
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.
In general, looks pretty good to me, just two small details. Could you add screenshots of the final result?
post.Props["meeting_host_joined"] = isHostJoined | ||
post.Props["meeting_waiting_count"] = waitingCnt | ||
_, updatePostErr := p.API.UpdatePost(post) | ||
_, err := w.Write([]byte(post.ToJson())) |
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.
I wonder if there is any need to write the post to the zoom. Maybe just an OK is enough?
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.
Yeah, I could fix that =))
_, updatePostErr := p.API.UpdatePost(post) | ||
_, err := w.Write([]byte(post.ToJson())) | ||
if err != nil || updatePostErr != nil { | ||
p.API.LogWarn("failed to write response", "error", err.Error()) |
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.
If err == nil and updatePostErr != nil, this will create a panic. Use two separate checks. That way you can introduce better errors for each case.
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.
Okay.
Yup, I will post the screen record of the whole flow here. |
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.
Thanks for implementing this useful feature @lantrungseo! Functionally LGTM 👍 I have just a few requests regarding style.
@@ -219,18 +219,79 @@ func (p *Plugin) handleWebhook(w http.ResponseWriter, r *http.Request) { | |||
return |
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.
This PR doesn't touch this part, but do you mind adding this to line 214?
defer r.Body.Close()
p.handleParticipantJoinedWebhook(w, r, &meetingWebhook) | ||
return | ||
} | ||
if webhook.Event == zoom.EventTypeMeetingEnded { |
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.
Can we add an extra line between these if blocks?
return | ||
} | ||
p.handleMeetingEnded(w, r, &meetingWebhook) | ||
post, appErr := p.API.GetPost(postID) |
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.
Can we add an extra line after each if block in this function?
let announcementText = ''; | ||
if (props.meeting_host_joined) { | ||
announcementText = 'Host already in the meeting'; | ||
} else { |
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.
What do you think about making this less lines like this?
let announcementText = ''; | |
if (props.meeting_host_joined) { | |
announcementText = 'Host already in the meeting'; | |
} else { | |
let announcementText = 'Host already in the meeting'; | |
if (!props.meeting_host_joined) { |
} | ||
if (props.meeting_waiting_count > 1) { |
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.
Can we do this for better readability?
} | |
if (props.meeting_waiting_count > 1) { | |
} else if (props.meeting_waiting_count > 1) { |
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
@lantrungseo thank you for your contribution! Let us know if you have any questions about the feedback above, we'd be happy to help :) |
@lantrungseo are you able to continue working on this issue? |
Hi @lantrungseo - I'm helping to review stale PRs and, since we haven't heard from you in 6 months, I'll close this PR for now. I've re-added the "Up for Grabs" label on #109 //cc @larkox @mickmister |
Summary
This PR supports sending updates and notifications to host if a participant joins before host in a Zoom meeting
To recognize whether host is already in the meeting, this PR utilize
Participant joined
webhookTicket Link
Fixes #109