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

[GH-311] Fix issues: Not able to create meeting in threads view and by clicking "Create New Metting" button in a channel #316

Merged
merged 4 commits into from
Nov 13, 2023

Conversation

raghavaggarwal2308
Copy link
Contributor

Summary

Fix the following issues:

  • Not able to create a meeting in the threads view.
  • Not able to create a meeting by clicking "Create New Meeting" in a channel.

What to test?

  • Able to create a meeting in the threads view
  • Able to create a new meeting by clicking the "Create New Meeting" button
Steps to reproduce:
  • For threads view:
  1. Have CRT enabled, and open the Threads view
  2. Open a thread that pops into the RHS
  3. Click the Zoom button on the right
  • For clicking the button:
  1. Start a new meeting from the desired user's account.
  2. Without ending the meeting started, try to start a new meeting again.
  3. Click on the "Create New Meeting" button.
Expected behaviour:
  • The meetings should be created successfully.
Environment:

MM version: v7.8.10
Node version: 14.18.0
Go version: 1.19.0

Ticket Link

FIxes #311

- Not able to create a meeting in the threads view.
- Not able to create meeting on clicking "Create New Meeting" in a channel.
@raghavaggarwal2308 raghavaggarwal2308 changed the title [GH-311] Fix issues: Not able to create meeting in threads view and by clicking "Create New Metting" button [GH-311] Fix issues: Not able to create meeting in threads view and by clicking "Create New Metting" button in a channel Nov 6, 2023
@mickmister
Copy link
Contributor

/update-branch

@mattermost-build
Copy link
Contributor

We don't have permissions to update this PR, please contact the submitter to apply the update.

@mickmister
Copy link
Contributor

@raghavaggarwal2308 Did you check the box that allows maintainers to edit the PR?

Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

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

The code is a bit hard to read/understand (not the changes in this PR, just the code itself). I suggest as a follow up we introduce typescript into this repo and use objects as the function args for startMeeting etc.

For the purpose of this fix, LGTM 👍

Comment on lines 8 to 12
export function startMeeting(channelId, rootId = '', force = false, topic = '') {
return async (dispatch, getState) => {
try {
let meetingURL = '';
if (force) {
meetingURL = await Client.forceStartMeeting(
channelId, true, '', 0, topic,
);
} else {
meetingURL = await Client.startMeeting(
channelId, true, '', 0, false, topic,
);
}
const startFunction = force ? Client.forceStartMeeting : Client.startMeeting;
const meetingURL = await startFunction(channelId, rootId, true, topic);
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good for this PR. Unrelated comment below


Do we really need a Client.forceStartMeeting? Since that function really just calls Client.startMeeting with force=true

Also, this function signature is pretty hard to read, along with the function call below. Thoughts on changing this to accept an object instead? Would be best if it were typescript as well so we have type safety on the object

type StartMeetingArgs = {
    channelId: string;
    rootId?: string;
    force?: boolean;
    topic?: string;
}

export function startMeeting(args: StartMeetingArgs) {
    return async (dispatch, getState) => {
        try {
            const startFunction = force ? Client.forceStartMeeting : Client.startMeeting;
            const meetingURL = await startFunction(channelId, rootId, true, topic);

We can do this as a follow up thing since that would expand the scope of this fix quite a bit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mickmister I agree with your suggestions. Should I create an issue for the same?

Copy link
Contributor

Choose a reason for hiding this comment

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

@raghavaggarwal2308 Yes sounds good to me 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mickmister Created the issue. Please let me know if we need to add anything else.
#319

startMeeting = async (
channelId, personal = true, topic = '', meetingId = 0, force = false,
) => {
startMeeting = async (channelId, rootId, personal = true, topic = '', meetingId = 0, force = false) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is meetingId ever defined when calling these client functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mickmister I don't think this will ever be defined.

Copy link
Contributor

Choose a reason for hiding this comment

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

@raghavaggarwal2308 If it's never defined when this function is called anywhere in the plugin, then I think we should remove the function parameter in this PR. Do you think it will eventually be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mickmister I don't think it will be used. Removed it now.

@mickmister mickmister added the 3: QA Review Requires review by a QA tester label Nov 7, 2023
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (6813e92) 19.33% compared to head (1b51d87) 19.33%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #316   +/-   ##
=======================================
  Coverage   19.33%   19.33%           
=======================================
  Files           9        9           
  Lines        1479     1479           
=======================================
  Hits          286      286           
  Misses       1138     1138           
  Partials       55       55           
Files Coverage Δ
server/http.go 5.18% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -11,22 +11,16 @@ export default class Client {
this.url = url + '/plugins/' + id;
}

startMeeting = async (channelId, rootId, personal = true, topic = '', meetingId = 0, force = false) => {
startMeeting = async (channelId, rootId, personal = true, topic = '', force = false) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like personal is always true as well right? I think these were added as placeholders, but they haven't been implemented for years so I think they are a bit of tech debt at this point. Do you see value in keeping it around? I don't want to add risk to the PR so I trust your judgment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mickmister I don't think we need this for now. I have removed it. We can always add it back if we need it in the future.

Copy link
Contributor

@AayushChaudhary0001 AayushChaudhary0001 left a comment

Choose a reason for hiding this comment

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

Tested and approved.

This PR is tested for the below scenarios :-

  • Able to create a meeting having CRT enabled in threads view.
  • Able to start a new meeting by clicking the "Create new meeting" button.

Working fine, LGTM.

@avas27JTG avas27JTG merged commit dbbb587 into mattermost:master Nov 13, 2023
11 checks passed
@avas27JTG avas27JTG deleted the MM-311 branch November 13, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: QA Review Requires review by a QA tester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create new meeting causes an issue of generating multiple similar custom posts.
5 participants