Merge pull request #12691 from ramonlsouza/reconnect-fix

fix: reconnection crash
This commit is contained in:
Anton Georgiev 2021-07-02 14:17:40 -04:00 committed by GitHub
commit 213e0e4b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 9 deletions

View File

@ -16,7 +16,7 @@ function userSettings() {
const currentUser = User.findOne({ userId, meetingId });
if (currentUser && currentUser.breakoutProps.isBreakoutUser) {
if (currentUser && currentUser?.breakoutProps?.isBreakoutUser) {
const { parentId } = currentUser.breakoutProps;
const [externalId] = currentUser.extId.split('-');

View File

@ -56,17 +56,19 @@ const AppContainer = (props) => {
navbar,
actionsbar,
media,
currentUserId,
...otherProps
} = props;
return (
return currentUserId ?
<App
navbar={navbar}
actionsbar={actionsbar}
media={media}
currentUserId={currentUserId}
{...otherProps}
/>
);
: null
};
const currentUserEmoji = currentUser => (currentUser ? {
@ -95,7 +97,7 @@ export default injectIntl(withModalMounter(withTracker(({ intl, baseControls })
{ fields: { publishedPoll: 1, voiceProp: 1, randomlySelectedUser: 1 } });
const { publishedPoll, voiceProp, randomlySelectedUser } = currentMeeting;
if (!currentUser.approved) {
if (currentUser && !currentUser.approved) {
baseControls.updateLoadingState(intl.formatMessage(intlMessages.waitingApprovalMessage));
}
@ -122,8 +124,8 @@ export default injectIntl(withModalMounter(withTracker(({ intl, baseControls })
startBandwidthMonitoring,
handleNetworkConnection: () => updateNavigatorConnection(navigator.connection),
randomlySelectedUser,
currentUserId: currentUser.userId,
isPresenter: currentUser.presenter,
currentUserId: currentUser?.userId,
isPresenter: currentUser?.presenter,
isLargeFont: Session.get('isLargeFont')
};
})(AppContainer)));

View File

@ -89,7 +89,7 @@ const Adapter = () => {
/* needed to prevent an issue with dupĺicated messages when user role is changed
more info: https://github.com/bigbluebutton/bigbluebutton/issues/11842 */
useEffect(() => {
if (users[Auth.meetingID]) {
if (users[Auth.meetingID] && users[Auth.meetingID][Auth.userID]) {
if (currentUserData?.role !== users[Auth.meetingID][Auth.userID].role) {
prevUserData = currentUserData;
}

View File

@ -55,7 +55,7 @@ const reducer = (state, action) => {
// USER PERSISTENT DATA
case ACTIONS.ADDED_USER_PERSISTENT_DATA: {
const { user } = action.value;
if (state[user.meetingId][user.userId]) {
if (state[user.meetingId] && state[user.meetingId][user.userId]) {
return state;
}

View File

@ -231,7 +231,11 @@ class Auth {
Tracker.autorun((c) => {
computation = c;
const authenticationTokenValidation = AuthTokenValidation.findOne({}, { sort: { updatedAt: -1 } });
const selector = {
connectionId: Meteor.connection._lastSessionId,
};
const authenticationTokenValidation = AuthTokenValidation.findOne(selector);
if (!authenticationTokenValidation) return;