Skip to content

Commit

Permalink
Merge branch 'develop' into regression/email-memory-leak-and-attachme…
Browse files Browse the repository at this point in the history
…nt-issues
  • Loading branch information
cauefcr authored Oct 14, 2022
2 parents 470b035 + 3244070 commit dae0e56
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 17 deletions.
5 changes: 0 additions & 5 deletions apps/meteor/app/livechat/server/lib/RoutingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ export const RoutingManager = {
return callbacks.run('livechat.onAgentAssignmentFailed', { inquiry, room, options });
}

if (room.onHold) {
logger.debug(`Room ${room._id} is on hold. Remove current assignments before routing`);
Subscriptions.removeByRoomIdAndUserId(room._id, agent.agentId);
}

LivechatInquiry.takeInquiry(_id);
const inq = this.assignAgent(inquiry, agent);
logger.debug(`Inquiry ${inquiry._id} taken by agent ${agent.agentId}`);
Expand Down
8 changes: 0 additions & 8 deletions apps/meteor/app/models/server/models/Subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1373,14 +1373,6 @@ export class Subscriptions extends Base {

return this.update(query, update, { multi: true });
}

setOnHold(roomId) {
return this.update({ rid: roomId }, { $set: { onHold: true } }, { multi: true });
}

unsetOnHold(roomId) {
return this.update({ rid: roomId }, { $unset: { onHold: 1 } }, { multi: true });
}
}

export default new Subscriptions('subscription', true);
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/providers/RoomProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type RoomProviderProps = {
const RoomProvider = ({ rid, children }: RoomProviderProps): ReactElement => {
useRoomRolesManagement(rid);

const roomQuery = useReactiveQuery(['rooms', rid], ({ rooms }) => rooms.findOne({ _id: rid }) ?? null);
const roomQuery = useReactiveQuery(['rooms', rid], ({ rooms }) => rooms.findOne({ _id: rid }));

// TODO: the following effect is a workaround while we don't have a general and definitive solution for it
const homeRoute = useRoute('home');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { LivechatInquiry, Users } from '@rocket.chat/models';

import LivechatUnit from '../../../models/server/models/LivechatUnit';
import LivechatTag from '../../../models/server/models/LivechatTag';
import { LivechatRooms, Subscriptions, Messages } from '../../../../../app/models/server';
import { LivechatRooms, Messages } from '../../../../../app/models/server';
import LivechatPriority from '../../../models/server/models/LivechatPriority';
import { addUserRoles } from '../../../../../server/lib/roles/addUserRoles';
import { removeUserFromRoles } from '../../../../../server/lib/roles/removeUserFromRoles';
Expand Down Expand Up @@ -195,7 +195,6 @@ export const LivechatEnterprise = {
return false;
}
LivechatRooms.setOnHold(roomId);
Subscriptions.setOnHold(roomId);

Messages.createOnHoldHistoryWithRoomIdMessageAndUser(roomId, comment, onHoldBy);
Meteor.defer(() => {
Expand All @@ -214,7 +213,6 @@ export const LivechatEnterprise = {

await AutoCloseOnHoldScheduler.unscheduleRoom(roomId);
LivechatRooms.unsetAllOnHoldFieldsByRoomId(roomId);
Subscriptions.unsetOnHold(roomId);
},
};

Expand Down

0 comments on commit dae0e56

Please sign in to comment.