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.1.2 #17454

Merged
merged 11 commits into from
Apr 27, 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.1.1
ENV RC_VERSION 3.1.2

MAINTAINER [email protected]

Expand Down
95 changes: 95 additions & 0 deletions .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -42492,6 +42492,101 @@
]
}
]
},
"3.1.2": {
"pull_requests": [
{
"pr": "17453",
"title": "[FIX] LDAP error when trying to add room with spaces in the name",
"userLogin": "pierre-lehnen-rc",
"milestone": "3.1.2",
"contributors": [
"pierre-lehnen-rc"
]
},
{
"pr": "17430",
"title": "Regression: Add missing cacheKey to mem",
"userLogin": "sampaiodiego",
"milestone": "3.1.2",
"contributors": [
"sampaiodiego"
]
},
{
"pr": "17422",
"title": "[FIX] Empty Incoming webhook script field ",
"userLogin": "ggazzo",
"milestone": "3.1.2",
"contributors": [
"ggazzo"
]
},
{
"pr": "17417",
"title": "[FIX] LDAP Sync error",
"userLogin": "fastrde",
"milestone": "3.1.2",
"contributors": [
"fastrde"
]
},
{
"pr": "17404",
"title": "[FIX] Bot Agents not being able to get Omnichannel Inquiries",
"userLogin": "renatobecker",
"milestone": "3.1.2",
"contributors": [
"renatobecker"
]
},
{
"pr": "17406",
"title": "[FIX] Allowing blocking a user on channels",
"userLogin": "sampaiodiego",
"milestone": "3.1.2",
"contributors": [
"sampaiodiego"
]
},
{
"pr": "17391",
"title": "Regression: Fix mem usage with more than one argument",
"userLogin": "sampaiodiego",
"milestone": "3.1.2",
"contributors": [
"sampaiodiego"
]
},
{
"pr": "17320",
"title": "[FIX] Web Client memory leak caused by the Emoji rendering",
"userLogin": "ggazzo",
"milestone": "3.1.2",
"contributors": [
"ggazzo",
"web-flow"
]
},
{
"pr": "17348",
"title": "[FIX] Omnichannel room info panel opening whenever a message is sent",
"userLogin": "renatobecker",
"milestone": "3.1.2",
"contributors": [
"renatobecker"
]
},
{
"pr": "17249",
"title": "[FIX] New user added by admin doesn't receive random password email",
"userLogin": "pierre-lehnen-rc",
"milestone": "3.1.2",
"contributors": [
"pierre-lehnen-rc"
]
}
]
}
}
}
73 changes: 59 additions & 14 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@

# 3.1.2
`2020-04-27 · 8 🐛 · 2 🔍 · 5 👩‍💻👨‍💻`

### 🐛 Bug fixes


- LDAP error when trying to add room with spaces in the name ([#17453](https://github.com/RocketChat/Rocket.Chat/pull/17453))

- Empty Incoming webhook script field ([#17422](https://github.com/RocketChat/Rocket.Chat/pull/17422))

- LDAP Sync error ([#17417](https://github.com/RocketChat/Rocket.Chat/pull/17417) by [@fastrde](https://github.com/fastrde))

- Bot Agents not being able to get Omnichannel Inquiries ([#17404](https://github.com/RocketChat/Rocket.Chat/pull/17404))

- Allowing blocking a user on channels ([#17406](https://github.com/RocketChat/Rocket.Chat/pull/17406))

- Web Client memory leak caused by the Emoji rendering ([#17320](https://github.com/RocketChat/Rocket.Chat/pull/17320))

- Omnichannel room info panel opening whenever a message is sent ([#17348](https://github.com/RocketChat/Rocket.Chat/pull/17348))

- New user added by admin doesn't receive random password email ([#17249](https://github.com/RocketChat/Rocket.Chat/pull/17249))

<details>
<summary>🔍 Minor changes</summary>


- Regression: Add missing cacheKey to mem ([#17430](https://github.com/RocketChat/Rocket.Chat/pull/17430))

- Regression: Fix mem usage with more than one argument ([#17391](https://github.com/RocketChat/Rocket.Chat/pull/17391))

</details>

### 👩‍💻👨‍💻 Contributors 😍

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

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

- [@ggazzo](https://github.com/ggazzo)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@sampaiodiego](https://github.com/sampaiodiego)

# 3.1.1
`2020-04-14 · 8 🐛 · 1 🔍 · 6 👩‍💻👨‍💻`

Expand Down Expand Up @@ -54,12 +97,12 @@
### 🎉 New features


- **ENTERPRISE:** Engagement Dashboard ([#16960](https://github.com/RocketChat/Rocket.Chat/pull/16960))

- Sort channel directory listing by latest message ([#16604](https://github.com/RocketChat/Rocket.Chat/pull/16604) by [@subham103](https://github.com/subham103))

- Direct message between multiple users ([#16761](https://github.com/RocketChat/Rocket.Chat/pull/16761))

- [ENTERPRISE] Engagement Dashboard ([#16960](https://github.com/RocketChat/Rocket.Chat/pull/16960))

- Synchronize saml roles to local user (#16152) ([#16158](https://github.com/RocketChat/Rocket.Chat/pull/16158) by [@col-panic](https://github.com/col-panic))

- Route to get updated roles after a date ([#16610](https://github.com/RocketChat/Rocket.Chat/pull/16610) by [@ashwaniYDV](https://github.com/ashwaniYDV))
Expand All @@ -77,6 +120,7 @@
- Two Factor authentication via email ([#15949](https://github.com/RocketChat/Rocket.Chat/pull/15949))

- Translation via MS translate ([#16363](https://github.com/RocketChat/Rocket.Chat/pull/16363) by [@mrsimpson](https://github.com/mrsimpson))

Adds Microsoft's translation service (https://translator.microsoft.com/) as a provider for translation of messages.
In addition to implementing the interface (similar to google and DeepL), a small change has been done in order to display the translation provider on the UI.

Expand All @@ -99,6 +143,7 @@
- Directory page refactored, new user's bio field ([#17043](https://github.com/RocketChat/Rocket.Chat/pull/17043))

- Merge Sort List and View Mode menus and improve its UI/UX ([#17103](https://github.com/RocketChat/Rocket.Chat/pull/17103))

![image](https://user-images.githubusercontent.com/5263975/78036622-e8db2a80-7340-11ea-91d0-65728eabdcb6.png)

- Add omnichannel external frame feature ([#17038](https://github.com/RocketChat/Rocket.Chat/pull/17038))
Expand Down Expand Up @@ -216,6 +261,7 @@
- Slackbridge-import command doesn't work ([#16645](https://github.com/RocketChat/Rocket.Chat/pull/16645) by [@antkaz](https://github.com/antkaz))

- Language country has been ignored on translation load ([#16757](https://github.com/RocketChat/Rocket.Chat/pull/16757))

Languages including country variations like `pt-BR` were ignoring the country party because the user's preference has been saved in lowercase `pt-br` causing the language to not match the available languages. Now we enforce the uppercase of the country part when loading the language.

- Cannot edit Profile when Full Name is empty and not required ([#16744](https://github.com/RocketChat/Rocket.Chat/pull/16744))
Expand Down Expand Up @@ -1619,7 +1665,6 @@
### Engine versions
- Node: `8.15.1`
- NPM: `6.9.0`
- MongoDB: ``

### 🐛 Bug fixes

Expand Down Expand Up @@ -6211,9 +6256,9 @@
### ⚠️ BREAKING CHANGES


- Update the default port of the Prometheus exporter ([#11351](https://github.com/RocketChat/Rocket.Chat/pull/11351) by [@thaiphv](https://github.com/thaiphv))
- **IMPROVE:** New emails design ([#12009](https://github.com/RocketChat/Rocket.Chat/pull/12009))

- [IMPROVE] New emails design ([#12009](https://github.com/RocketChat/Rocket.Chat/pull/12009))
- Update the default port of the Prometheus exporter ([#11351](https://github.com/RocketChat/Rocket.Chat/pull/11351) by [@thaiphv](https://github.com/thaiphv))

### 🎉 New features

Expand Down Expand Up @@ -8746,7 +8791,7 @@
### 🐛 Bug fixes


- [i18n] add room type translation support for room-changed-privacy message ([#9369](https://github.com/RocketChat/Rocket.Chat/pull/9369) by [@cyclops24](https://github.com/cyclops24))
- **i18n:** add room type translation support for room-changed-privacy message ([#9369](https://github.com/RocketChat/Rocket.Chat/pull/9369) by [@cyclops24](https://github.com/cyclops24))

- Fix livechat register form ([#9452](https://github.com/RocketChat/Rocket.Chat/pull/9452))

Expand Down Expand Up @@ -9157,6 +9202,10 @@
### 🐛 Bug fixes


- **i18n:** My Profile & README.md links ([#8270](https://github.com/RocketChat/Rocket.Chat/pull/8270) by [@Rzeszow](https://github.com/Rzeszow))

- **PL:** Polish translation ([#7989](https://github.com/RocketChat/Rocket.Chat/pull/7989) by [@Rzeszow](https://github.com/Rzeszow))

- Can't react on Read Only rooms even when enabled ([#8925](https://github.com/RocketChat/Rocket.Chat/pull/8925) by [@karlprieb](https://github.com/karlprieb))

- CAS does not share secrets when operating multiple server instances ([#8654](https://github.com/RocketChat/Rocket.Chat/pull/8654) by [@AmShaegar13](https://github.com/AmShaegar13))
Expand Down Expand Up @@ -9345,8 +9394,6 @@

- Attachment icons alignment in LTR and RTL ([#8271](https://github.com/RocketChat/Rocket.Chat/pull/8271) by [@cyclops24](https://github.com/cyclops24))

- [i18n] My Profile & README.md links ([#8270](https://github.com/RocketChat/Rocket.Chat/pull/8270) by [@Rzeszow](https://github.com/Rzeszow))

- Incorrect URL for login terms when using prefix ([#8211](https://github.com/RocketChat/Rocket.Chat/pull/8211) by [@Darkneon](https://github.com/Darkneon))

- Scrollbar not using new style ([#8190](https://github.com/RocketChat/Rocket.Chat/pull/8190))
Expand Down Expand Up @@ -9391,8 +9438,6 @@

- Recent emojis not updated when adding via text ([#7998](https://github.com/RocketChat/Rocket.Chat/pull/7998))

- [PL] Polish translation ([#7989](https://github.com/RocketChat/Rocket.Chat/pull/7989) by [@Rzeszow](https://github.com/Rzeszow))

- Chat box no longer auto-focuses when typing ([#7984](https://github.com/RocketChat/Rocket.Chat/pull/7984))

- Fix the status on the members list ([#7963](https://github.com/RocketChat/Rocket.Chat/pull/7963))
Expand Down Expand Up @@ -10017,6 +10062,10 @@
### 🐛 Bug fixes


- **PL:** Polish translation ([#7989](https://github.com/RocketChat/Rocket.Chat/pull/7989) by [@Rzeszow](https://github.com/Rzeszow))

- **i18n:** My Profile & README.md links ([#8270](https://github.com/RocketChat/Rocket.Chat/pull/8270) by [@Rzeszow](https://github.com/Rzeszow))

- File upload on multi-instances using a path prefix ([#7855](https://github.com/RocketChat/Rocket.Chat/pull/7855) by [@Darkneon](https://github.com/Darkneon))

- Fix migration 100 ([#7863](https://github.com/RocketChat/Rocket.Chat/pull/7863))
Expand Down Expand Up @@ -10147,8 +10196,6 @@

- Recent emojis not updated when adding via text ([#7998](https://github.com/RocketChat/Rocket.Chat/pull/7998))

- [PL] Polish translation ([#7989](https://github.com/RocketChat/Rocket.Chat/pull/7989) by [@Rzeszow](https://github.com/Rzeszow))

- Fix email on mention ([#7754](https://github.com/RocketChat/Rocket.Chat/pull/7754))

- RTL ([#8112](https://github.com/RocketChat/Rocket.Chat/pull/8112))
Expand Down Expand Up @@ -10223,8 +10270,6 @@

- Attachment icons alignment in LTR and RTL ([#8271](https://github.com/RocketChat/Rocket.Chat/pull/8271) by [@cyclops24](https://github.com/cyclops24))

- [i18n] My Profile & README.md links ([#8270](https://github.com/RocketChat/Rocket.Chat/pull/8270) by [@Rzeszow](https://github.com/Rzeszow))

- some placeholder and phrase traslation fix ([#8269](https://github.com/RocketChat/Rocket.Chat/pull/8269) by [@cyclops24](https://github.com/cyclops24))

- "Channel Setting" buttons alignment in RTL ([#8266](https://github.com/RocketChat/Rocket.Chat/pull/8266) by [@cyclops24](https://github.com/cyclops24))
Expand Down
9 changes: 6 additions & 3 deletions app/authorization/server/functions/canSendMessage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { canAccessRoomAsync } from './canAccessRoom';
import { hasPermissionAsync } from './hasPermission';
import { Subscriptions, Rooms } from '../../../models/server/raw';
import { roomTypes, RoomMemberActions } from '../../../utils/server';

const subscriptionOptions = {
projection: {
Expand All @@ -16,9 +17,11 @@ export const canSendMessageAsync = async (rid, { uid, username, type }, extraDat
throw new Error('error-not-allowed');
}

const subscription = await Subscriptions.findOneByRoomIdAndUserId(rid, uid, subscriptionOptions);
if (subscription && (subscription.blocked || subscription.blocker)) {
throw new Error('room_is_blocked');
if (roomTypes.getConfig(room.t).allowMemberAction(room, RoomMemberActions.BLOCK)) {
const subscription = await Subscriptions.findOneByRoomIdAndUserId(rid, uid, subscriptionOptions);
if (subscription && (subscription.blocked || subscription.blocker)) {
throw new Error('room_is_blocked');
}
}

if (room.ro === true && !await hasPermissionAsync(uid, 'post-readonly', rid)) {
Expand Down
11 changes: 7 additions & 4 deletions app/authorization/server/functions/hasPermission.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ import mem from 'mem';
import { Permissions, Users, Subscriptions } from '../../../models/server/raw';

const rolesHasPermission = mem(async (permission, roles) => {
const result = await Permissions.findOne({ _id: permission, roles: { $in: roles } });
const result = await Permissions.findOne({ _id: permission, roles: { $in: roles } }, { projection: { _id: 1 } });
return !!result;
}, {
cacheKey: JSON.stringify,
...process.env.TEST_MODE === 'true' && { maxAge: 0 },
});

const getRoles = mem(async (uid, scope) => {
const { roles: userRoles = [] } = await Users.findOne({ _id: uid });
const { roles: subscriptionsRoles = [] } = (scope && await Subscriptions.findOne({ rid: scope, 'u._id': uid }, { fields: { roles: 1 } })) || {};
const { roles: userRoles = [] } = await Users.findOne({ _id: uid }, { projection: { roles: 1 } });
const { roles: subscriptionsRoles = [] } = (scope && await Subscriptions.findOne({ rid: scope, 'u._id': uid }, { projection: { roles: 1 } })) || {};
return [...userRoles, ...subscriptionsRoles].sort((a, b) => a.localeCompare(b));
}, { maxAge: 1000 });
}, { maxAge: 1000, cacheKey: JSON.stringify });

export const clearCache = () => {
mem.clear(getRoles);
Expand Down
9 changes: 5 additions & 4 deletions app/emoji-emojione/lib/rocketchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ emojione.emojioneList[':asterisk_symbol:'] = {

// fix for :+1: - had to replace all function that does its conversion: https://github.com/joypixels/emojione/blob/4.5.0/lib/js/emojione.js#L249
(function(ns) {
ns.shortnameConversionMap = mem(ns.shortnameConversionMap);
ns.unicodeCharRegex = mem(ns.unicodeCharRegex);
ns.shortnameConversionMap = mem(ns.shortnameConversionMap, { maxAge: 1000 });

ns.unicodeCharRegex = mem(ns.unicodeCharRegex, { maxAge: 1000 });

const convertShortName = mem(function(shortname) {
// the fix is basically adding this .replace(/[+]/g, '\\$&')
Expand Down Expand Up @@ -202,7 +203,7 @@ emojione.emojioneList[':asterisk_symbol:'] = {
return `<span class="emojione emojione-${ category } _${ fname }" ${ title }>${ alt }</span>`;
}
return `<img class="emojione" alt="${ alt }" ${ title } src="${ ePath }${ fname }${ ns.fileExtension }"/>`;
});
}, { maxAge: 1000 });

const convertUnicode = mem(function(entire, m1, m2, m3) {
const mappedUnicode = ns.mapUnicodeToShort();
Expand All @@ -228,7 +229,7 @@ emojione.emojioneList[':asterisk_symbol:'] = {
return `${ m2 }<span class="emojione emojione-${ category } _${ unicode }" ${ title }>${ alt }</span>`;
}
return `${ m2 }<img class="emojione" alt="${ alt }" ${ title } src="${ ePath }${ unicode }${ ns.fileExtension }"/>`;
});
}, { maxAge: 1000, cacheKey: JSON.stringify });

ns.shortnameToImage = function(str) {
// replace regular shortnames first
Expand Down
2 changes: 1 addition & 1 deletion app/ldap/server/loginHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Accounts.registerLoginHandler('ldap', function(loginRequest) {
}

// Create new user
const result = addLdapUser(ldapUser, username, loginRequest.ldapPass);
const result = addLdapUser(ldapUser, username, loginRequest.ldapPass, ldap);

if (result instanceof Error) {
throw result;
Expand Down
2 changes: 1 addition & 1 deletion app/ldap/server/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export function mapLDAPGroupsToChannels(ldap, ldapUser, user) {
}

for (const channel of channels) {
let room = Rooms.findOneByName(channel);
let room = Rooms.findOneByNonValidatedName(channel);
if (!room) {
room = createRoomForSync(channel);
}
Expand Down
Loading