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: undefined error message #33702

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions apps/meteor/app/livechat/server/methods/takeInquiry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export const takeInquiry = async (

const room = await LivechatRooms.findOneById(inquiry.rid);
if (!room || !(await Omnichannel.isWithinMACLimit(room))) {
throw new Error('error-mac-limit-reached');
throw new Meteor.Error('error-mac-limit-reached');
}

const contactId = await migrateVisitorIfMissingContact(inquiry.v._id, room.source);
if (contactId && (await shouldTriggerVerificationApp(contactId, room.source))) {
throw new Error('error-unverified-contact');
throw new Meteor.Error('error-unverified-contact');
}

const agent = {
Expand Down
4 changes: 4 additions & 0 deletions apps/meteor/tests/e2e/fixtures/inject-initial-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export default async function injectInitialData() {
_id: 'Accounts_OAuth_Google',
value: false,
},
{
_id: 'Livechat_Require_Contact_Verification',
value: 'never',
},
].map((setting) =>
connection
.db()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ test.describe('OC - Current Chats [Auto Selection]', async () => {
const responses = await Promise.all([
api.post('/settings/Livechat_allow_manual_on_hold', { value: true }),
api.post('/settings/Livechat_allow_manual_on_hold_upon_agent_engagement_only', { value: false }),
api.post('/settings/Livechat_Require_Contact_Verification', { value: 'never' }),
]);
responses.forEach((res) => expect(res.status()).toBe(200));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ test.describe('OC - Livechat API', () => {
let agent: Awaited<ReturnType<typeof createAgent>>;

test.beforeAll(async ({ browser, api }) => {
if (IS_EE) {
await api.post('/settings/Livechat_Require_Contact_Verification', { value: 'never' });
}

agent = await createAgent(api, 'user1');

page = await browser.newPage();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Page } from '@playwright/test';

import { createFakeVisitor } from '../../mocks/data';
import { IS_EE } from '../config/constants';
import { createAuxContext } from '../fixtures/createAuxContext';
import { Users } from '../fixtures/userStates';
import { HomeOmnichannel, OmnichannelLiveChatEmbedded } from '../page-objects';
Expand Down Expand Up @@ -31,10 +30,6 @@ test.describe('OC - Livechat - Avatar visibility', async () => {
if (res.status() !== 200) {
throw new Error('Failed to make agent available');
}

if (IS_EE) {
await api.post('/settings/Livechat_Require_Contact_Verification', { value: 'never' });
}
});

test.beforeEach(async ({ browser }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ test.describe('OC - Livechat - Department Flow', () => {
let agent2: Awaited<ReturnType<typeof createAgent>>['data'];

test.beforeAll(async ({ api }) => {
await api.post('/settings/Livechat_Require_Contact_Verification', { value: 'never' });

// Assign agents & departments
agents = await Promise.all([createAgent(api, 'user1'), createAgent(api, 'user2')]);
[agent1, agent2] = agents.map(({ data }) => data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Page } from '@playwright/test';

import { createFakeVisitor } from '../../mocks/data';
import { IS_EE } from '../config/constants';
import { createAuxContext } from '../fixtures/createAuxContext';
import { Users } from '../fixtures/userStates';
import { HomeOmnichannel, OmnichannelLiveChatEmbedded } from '../page-objects';
Expand All @@ -25,9 +24,6 @@ test.describe('OC - Livechat - Bubble background color', async () => {

test.beforeAll(async ({ api }) => {
agent = await createAgent(api, 'user1');
if (IS_EE) {
await api.post('/settings/Livechat_Require_Contact_Verification', { value: 'never' });
}

const res = await makeAgentAvailable(api, agent.data._id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ test.describe('OC - Livechat - Queue Management', () => {
api.post('/settings/Livechat_waiting_queue', { value: true }),
api.post('/settings/Livechat_waiting_queue_message', { value: waitingQueueMessage }),
api.post('/livechat/users/agent', { username: 'user1' }),
api.post('/settings/Livechat_Require_Contact_Verification', { value: 'never' }),
]);

const { page: omniPage } = await createAuxContext(browser, Users.user1, '/', true);
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2183,6 +2183,7 @@
"error-max-number-simultaneous-chats-reached": "The maximum number of simultaneous chats per agent has been reached.",
"error-max-rooms-per-guest-reached": "The maximum number of rooms per guest has been reached.",
"error-mac-limit-reached": "The maximum number of monthly active contacts for this workspace has been reached.",
"error-unverified-contact": "The contact must be verified.",
"error-message-deleting-blocked": "Message deleting is blocked",
"error-message-editing-blocked": "Message editing is blocked",
"error-message-size-exceeded": "Message size exceeds Message_MaxAllowedSize",
Expand Down
Loading