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

fix: end meeting for all getCurUserType type issue #4038

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/@webex/plugin-meetings/src/meetings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ export type BasicMeetingInformation = {
};
meetingInfo: any;
sessionCorrelationId: string;
roles: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

question. Why have we also added roles and callStateForMetrics?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

roles being read in getCurUserType utility function and callStateForMetrics is being read in next line where previous error occured.

getCurUserType: () => string | null;
callStateForMetrics: CallStateForMetrics;
};

/**
Expand Down Expand Up @@ -1143,6 +1146,9 @@ export default class Meetings extends WebexPlugin {
sessionId: meeting.locusInfo?.fullState?.sessionId,
},
},
roles: meeting.roles,
callStateForMetrics: meeting.callStateForMetrics,
getCurUserType: meeting.getCurUserType,
Copy link
Collaborator

Choose a reason for hiding this comment

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

initially I didn't like this approach, because I thought that having a reference to the method of a meeting will prevent that meeting object from being garbage collected, but I think it's OK, you can have references to methods of an object and these methods on their own don't have a reference to the object itself (as long as they don't use any closures), so it should be fine.

});
this.meetingCollection.delete(meeting.id);
Trigger.trigger(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ describe('plugin-meetings', () => {
logger,
people: {
_getMe: sinon.stub().resolves({
type: 'validuser',
type: 'validuser',
}),
}
},
});

startReachabilityStub = sinon.stub(webex.meetings, 'startReachability').resolves();
Expand Down Expand Up @@ -1985,6 +1985,8 @@ describe('plugin-meetings', () => {
const meetingIds = {
meetingId: meeting.id,
correlationId: meeting.correlationId,
roles: meeting.roles,
callStateForMetrics: meeting.callStateForMetrics,
};

webex.meetings.destroy(meeting, test1);
Expand Down Expand Up @@ -2021,6 +2023,8 @@ describe('plugin-meetings', () => {

assert.equal(deletedMeetingInfo.id, meetingIds.meetingId);
assert.equal(deletedMeetingInfo.correlationId, meetingIds.correlationId);
assert.equal(deletedMeetingInfo.roles, meetingIds.roles);
assert.equal(deletedMeetingInfo.callStateForMetrics, meetingIds.callStateForMetrics);
});
});

Expand Down Expand Up @@ -2092,7 +2096,7 @@ describe('plugin-meetings', () => {
);
});

const setup = ({me = { type: 'validuser'}, user} = {}) => {
const setup = ({me = {type: 'validuser'}, user} = {}) => {
loggerProxySpy = sinon.spy(LoggerProxy.logger, 'error');
assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);

Expand All @@ -2113,9 +2117,9 @@ describe('plugin-meetings', () => {

it('should not call request.getMeetingPreferences if user is a guest', async () => {
setup({me: {type: 'appuser'}});

await webex.meetings.fetchUserPreferredWebexSite();

assert.equal(webex.meetings.preferredWebexSite, '');
assert.deepEqual(webex.internal.services._getCatalog().getAllowedDomains(), []);
assert.notCalled(webex.internal.services.getMeetingPreferences);
Expand Down
Loading