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

Release 3.0.3 #16770

Merged
merged 6 commits into from
Mar 2, 2020
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
2 changes: 1 addition & 1 deletion .docker/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7

ENV RC_VERSION 3.0.2
ENV RC_VERSION 3.0.3

MAINTAINER buildmaster@rocket.chat

Expand Down
91 changes: 90 additions & 1 deletion .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -39823,6 +39823,27 @@
}
]
},
"2.4.10": {
"node_version": "8.17.0",
"npm_version": "6.13.4",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "16495",
"title": "[FIX] users.info endpoint not handling the error if the user does not exist",
"userLogin": "MarcosSpessatto",
"milestone": "3.0.2",
"contributors": [
"MarcosSpessatto",
"sampaiodiego"
]
}
]
},
"3.0.2": {
"node_version": "12.14.0",
"npm_version": "6.13.4",
Expand Down Expand Up @@ -39870,6 +39891,74 @@
]
}
]
},
"2.4.11": {
"node_version": "8.17.0",
"npm_version": "6.13.4",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": []
},
"3.0.3": {
"node_version": "12.14.0",
"npm_version": "6.13.4",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "16757",
"title": "[FIX] Language country has been ignored on translation load",
"userLogin": "rodrigok",
"milestone": "3.0.3",
"contributors": [
"rodrigok"
]
},
{
"pr": "16726",
"title": "[FIX] Manual Register use correct state for determining registered",
"userLogin": "geekgonecrazy",
"milestone": "3.0.3",
"contributors": [
"geekgonecrazy",
"web-flow",
"d-gubert"
]
},
{
"pr": "16723",
"title": "[FIX] Rocket.Chat takes too long to set the username when it fails to send enrollment email",
"userLogin": "pierre-lehnen-rc",
"milestone": "3.0.3",
"contributors": [
"pierre-lehnen-rc"
]
},
{
"pr": "16671",
"title": "[FIX] LDAP sync admin action was not syncing existent users",
"userLogin": "rodrigok",
"milestone": "3.0.3",
"contributors": [
"rodrigok"
]
},
{
"pr": "16618",
"title": "[FIX] Check agent status when starting a new conversation with an agent assigned",
"userLogin": "renatobecker",
"milestone": "3.0.3",
"contributors": [
"renatobecker"
]
}
]
}
}
}
}
43 changes: 42 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@

# 3.0.3
`2020-03-02 · 5 🐛 · 5 👩‍💻👨‍💻`

### Engine versions
- Node: `12.14.0`
- NPM: `6.13.4`
- MongoDB: `3.4, 3.6, 4.0`

### 🐛 Bug fixes

- Language country has been ignored on translation load ([#16757](https://github.com/RocketChat/Rocket.Chat/pull/16757))
- Manual Register use correct state for determining registered ([#16726](https://github.com/RocketChat/Rocket.Chat/pull/16726))
- Rocket.Chat takes too long to set the username when it fails to send enrollment email ([#16723](https://github.com/RocketChat/Rocket.Chat/pull/16723))
- LDAP sync admin action was not syncing existent users ([#16671](https://github.com/RocketChat/Rocket.Chat/pull/16671))
- Check agent status when starting a new conversation with an agent assigned ([#16618](https://github.com/RocketChat/Rocket.Chat/pull/16618))

### 👩‍💻👨‍💻 Core Team 🤓

- [@d-gubert](https://github.com/d-gubert)
- [@geekgonecrazy](https://github.com/geekgonecrazy)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@rodrigok](https://github.com/rodrigok)

# 3.0.2
`2020-02-21 · 4 🐛 · 5 👩‍💻👨‍💻`

Expand Down Expand Up @@ -203,6 +227,23 @@
- [@sampaiodiego](https://github.com/sampaiodiego)
- [@tassoevan](https://github.com/tassoevan)

# 2.4.10
`2020-02-20 · 1 🐛 · 2 👩‍💻👨‍💻`

### Engine versions
- Node: `8.17.0`
- NPM: `6.13.4`
- MongoDB: `3.4, 3.6, 4.0`

### 🐛 Bug fixes

- users.info endpoint not handling the error if the user does not exist ([#16495](https://github.com/RocketChat/Rocket.Chat/pull/16495))

### 👩‍💻👨‍💻 Core Team 🤓

- [@MarcosSpessatto](https://github.com/MarcosSpessatto)
- [@sampaiodiego](https://github.com/sampaiodiego)

# 2.4.9
`2020-02-10 · 1 🐛 · 1 🔍 · 1 👩‍💻👨‍💻`

Expand Down Expand Up @@ -6632,4 +6673,4 @@
- [@graywolf336](https://github.com/graywolf336)
- [@marceloschmidt](https://github.com/marceloschmidt)
- [@rodrigok](https://github.com/rodrigok)
- [@sampaiodiego](https://github.com/sampaiodiego)
- [@sampaiodiego](https://github.com/sampaiodiego)
2 changes: 1 addition & 1 deletion app/api/server/v1/cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ API.v1.addRoute('cloud.manualRegister', { authRequired: true }, {

const registrationInfo = retrieveRegistrationStatus();

if (registrationInfo.connectToCloud) {
if (registrationInfo.workspaceRegistered) {
return API.v1.failure('Workspace is already registered');
}

Expand Down
2 changes: 1 addition & 1 deletion app/cloud/client/admin/cloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<section class="page-container page-home page-static page-settings">
{{#header sectionName="Connectivity_Services" hideHelp=true fixedHeight=true fullpage=true}}
<div class="rc-header__section-button">
{{#unless info.connectToCloud}}
{{#unless info.workspaceRegistered}}
<button class="rc-button rc-button--small rc-button--primary rc-button--outline js-register">
{{_ "Cloud_Register_manually"}}
</button>
Expand Down
7 changes: 6 additions & 1 deletion app/ldap/server/ldap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor';
import ldapjs from 'ldapjs';
import Bunyan from 'bunyan';

import { callbacks } from '../../callbacks/server';
import { settings } from '../../settings';
import { Logger } from '../../logger';

Expand Down Expand Up @@ -376,6 +377,8 @@ export default class LDAP {
searchAllPaged(BaseDN, options, page) {
this.bindIfNecessary();

({ BaseDN, options } = callbacks.run('ldap.beforeSearchAll', { BaseDN, options }));

const processPage = ({ entries, title, end, next }) => {
logger.search.info(title);
// Force LDAP idle to wait the record processing
Expand Down Expand Up @@ -425,8 +428,8 @@ export default class LDAP {
title: 'Final Page',
end: true,
});
entries = [];
} else if (entries.length) {
logger.search.info('Page');
processPage({
entries,
title: 'Page',
Expand All @@ -453,6 +456,8 @@ export default class LDAP {
searchAllAsync(BaseDN, options, callback) {
this.bindIfNecessary();

({ BaseDN, options } = callbacks.run('ldap.beforeSearchAll', { BaseDN, options }));

this.client.search(BaseDN, options, (error, res) => {
if (error) {
logger.search.error(error);
Expand Down
9 changes: 5 additions & 4 deletions app/ldap/server/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SyncedCron } from 'meteor/littledata:synced-cron';
import _ from 'underscore';

import LDAP from './ldap';
import { callbacks } from '../../callbacks/server';
import { RocketChatFile } from '../../file';
import { settings } from '../../settings';
import { Notifications } from '../../notifications';
Expand All @@ -16,7 +17,7 @@ import { FileUpload } from '../../file-upload';
import { addUserToRoom, removeUserFromRoom, createRoom } from '../../lib/server/functions';


const logger = new Logger('LDAPSync', {});
export const logger = new Logger('LDAPSync', {});

export function isUserInLDAPGroup(ldap, ldapUser, user, ldapGroup) {
const syncUserRolesFilter = settings.get('LDAP_Sync_User_Data_Groups_Filter').trim();
Expand Down Expand Up @@ -531,7 +532,7 @@ export function importNewUsers(ldap) {
}));
}

function sync() {
export function sync() {
if (settings.get('LDAP_Enable') !== true) {
return;
}
Expand Down Expand Up @@ -562,9 +563,9 @@ function sync() {

if (ldapUser) {
syncUserData(user, ldapUser, ldap);
} else {
logger.info('Can\'t sync user', user.username);
}

callbacks.run('ldap.afterSyncExistentUser', { ldapUser, user });
});
}
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions app/ldap/server/syncUsers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';

import { importNewUsers } from './sync';
import { sync } from './sync';
import { hasRole } from '../../authorization';
import { settings } from '../../settings';

Expand All @@ -21,7 +21,7 @@ Meteor.methods({

this.unblock();

importNewUsers();
sync();

return {
message: 'Sync_in_progress',
Expand Down
46 changes: 46 additions & 0 deletions app/lib/server/functions/setUserActiveStatus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { check } from 'meteor/check';
import { Accounts } from 'meteor/accounts-base';

import * as Mailer from '../../../mailer';
import { Users, Subscriptions } from '../../../models';
import { settings } from '../../../settings';

export function setUserActiveStatus(userId, active) {
check(userId, String);
check(active, Boolean);

const user = Users.findOneById(userId);

if (!user) {
return false;
}

Users.setUserActive(userId, active);

if (user.username) {
Subscriptions.setArchivedByUsername(user.username, !active);
}

if (active === false) {
Users.unsetLoginTokens(userId);
} else {
Users.unsetReason(userId);
}
if (active && !settings.get('Accounts_Send_Email_When_Activating')) {
return true;
}
if (!active && !settings.get('Accounts_Send_Email_When_Deactivating')) {
return true;
}

const destinations = Array.isArray(user.emails) && user.emails.map((email) => `${ user.name || user.username }<${ email.address }>`);

const email = {
to: destinations,
from: settings.get('From_Email'),
subject: Accounts.emailTemplates.userActivated.subject({ active }),
html: Accounts.emailTemplates.userActivated.html({ active, name: user.name, username: user.username }),
};

Mailer.sendNoWrap(email);
}
4 changes: 3 additions & 1 deletion app/lib/server/functions/setUsername.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export const _setUsername = function(userId, u) {
// If first time setting username, send Enrollment Email
try {
if (!previousUsername && user.emails && user.emails.length > 0 && settings.get('Accounts_Enrollment_Email')) {
Accounts.sendEnrollmentEmail(user._id);
Meteor.defer(() => {
Accounts.sendEnrollmentEmail(user._id);
});
}
} catch (e) {
console.error(e);
Expand Down
10 changes: 10 additions & 0 deletions app/livechat/server/lib/Helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,13 @@ export const normalizeTransferredByData = (transferredBy, room) => {
type,
};
};

export const checkServiceStatus = ({ guest, agent }) => {
if (agent) {
const { agentId } = agent;
const users = Users.findOnlineAgents(agentId);
return users && users.count() > 0;
}

return Livechat.online(guest.department);
};
5 changes: 2 additions & 3 deletions app/livechat/server/lib/QueueManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';

import { LivechatRooms, LivechatInquiry } from '../../../models/server';
import { createLivechatRoom, createLivechatInquiry } from './Helper';
import { checkServiceStatus, createLivechatRoom, createLivechatInquiry } from './Helper';
import { callbacks } from '../../../callbacks/server';
import { RoutingManager } from './RoutingManager';
import { Livechat } from './Livechat';

export const QueueManager = {
async requestRoom({ guest, message, roomInfo, agent }) {
Expand All @@ -19,7 +18,7 @@ export const QueueManager = {
department: Match.Maybe(String),
}));

if (!Livechat.online(guest.department)) {
if (!checkServiceStatus({ guest, agent })) {
throw new Meteor.Error('no-agent-online', 'Sorry, no online agents');
}

Expand Down
4 changes: 2 additions & 2 deletions app/models/server/models/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export class Users extends Base {
return this.update(_id, update);
}

findOnlineAgents() {
const query = queryStatusAgentOnline();
findOnlineAgents(agentId) {
const query = queryStatusAgentOnline(agentId && { _id: agentId });

return this.find(query);
}
Expand Down
Loading