-
Notifications
You must be signed in to change notification settings - Fork 69
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
Conversation
- Not able to create a meeting in the threads view. - Not able to create meeting on clicking "Create New Meeting" in a channel.
/update-branch |
We don't have permissions to update this PR, please contact the submitter to apply the update. |
@raghavaggarwal2308 Did you check the box that allows maintainers to edit the PR? |
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.
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 👍
webapp/src/actions/index.js
Outdated
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); |
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.
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
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.
@mickmister I agree with your suggestions. Should I create an issue for the same?
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.
@raghavaggarwal2308 Yes sounds good to me 👍
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.
@mickmister Created the issue. Please let me know if we need to add anything else.
#319
webapp/src/client/client.js
Outdated
startMeeting = async ( | ||
channelId, personal = true, topic = '', meetingId = 0, force = false, | ||
) => { | ||
startMeeting = async (channelId, rootId, personal = true, topic = '', meetingId = 0, force = false) => { |
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.
Is meetingId
ever defined when calling these client functions?
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.
@mickmister I don't think this will ever be defined.
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.
@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?
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.
@mickmister I don't think it will be used. Removed it now.
Codecov ReportAttention:
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
☔ View full report in Codecov by Sentry. |
webapp/src/client/client.js
Outdated
@@ -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) => { |
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.
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
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.
@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.
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.
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.
Summary
Fix the following issues:
What to test?
Steps to reproduce:
Expected behaviour:
Environment:
MM version: v7.8.10
Node version: 14.18.0
Go version: 1.19.0
Ticket Link
FIxes #311