Skip to content

Commit 6366f6c

Browse files
github-actions[bot]renatobeckerggazzosampaiodiegoFelipe Parreira
authored
[Upstream Catchup] Merge RC:master to develop_pwa (RocketChat#415)
* [FIX] Omnichannel Current Chats open status filter not working (RocketChat#18795) * [FIX][ENTERPRISE] Omnichannel service status switching to unavailable (RocketChat#18835) * [FIX] File upload (Avatars, Emoji, Sounds) (RocketChat#18841) * [FIX] IE11 support livechat widget (RocketChat#18850) * [FIX] Admin user blank page (RocketChat#18851) * [FIX] User can't invite or join other Omnichannel rooms (RocketChat#18852) * [FIX] Showing alerts during setup wizard (RocketChat#18862) * Remember users' 2FA right after registration * Change register server to false by default * Bump version to 3.6.1 * [FIX] invite-all-from and invite-all-to commands don't work with multibyte room names (RocketChat#18919) * [FIX] Create Custom OAuth services from environment variables (RocketChat#17377) * [FIX] Read receipts showing blank names and not marking messages as read (RocketChat#18918) * [FIX] Version update check cron job (RocketChat#18916) * [FIX] Ignore User action from user card (RocketChat#18866) * [FIX] Deactivate users that are the last owner of a room using REST API (RocketChat#18864) * test: add e2e tests for REST API user deactivation * fix(app): read confirmRelinquish from HTTP request * chore(app): remove unnecessary console.log * [FIX] Show custom fields of invalid type (RocketChat#18794) * Bump version to 3.6.2 * [FIX] PDF not rendering (RocketChat#18956) * [FIX] Errors in LDAP avatar sync preventing login (RocketChat#18948) * [FIX] LDAP avatar upload (RocketChat#18994) * [FIX] Federation issues (RocketChat#18978) * fixed message sending, you should not filter the domains, specially filter by only the local origin/source * Fixing callback registration * Increased the rate limiting * Obbey to settings properties (RocketChat#19020) * Bump version to 3.6.3 * Update package-lock.json Co-authored-by: Renato Becker <renato.augusto.becker@gmail.com> Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com> Co-authored-by: Diego Sampaio <chinello@gmail.com> Co-authored-by: Felipe Parreira <felipeparreirafb@gmail.com> Co-authored-by: Maarten <me@maartendewaard.nl> Co-authored-by: William Reiske <wreiske@mieweb.com> Co-authored-by: pierre-lehnen-rc <55164754+pierre-lehnen-rc@users.noreply.github.com> Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Co-authored-by: Alan Sikora <alansikora@gmail.com> Co-authored-by: Shailesh Baldaniya <shaileshbaldaniya351@gmail.com>
1 parent cd87e95 commit 6366f6c

File tree

15 files changed

+177
-62
lines changed

15 files changed

+177
-62
lines changed

.docker/Dockerfile.rhel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7
22

3-
ENV RC_VERSION 3.6.2
3+
ENV RC_VERSION 3.6.3
44

55
MAINTAINER buildmaster@rocket.chat
66

.github/history.json

+58
Original file line numberDiff line numberDiff line change
@@ -49343,6 +49343,64 @@
4934349343
]
4934449344
}
4934549345
]
49346+
},
49347+
"3.6.3": {
49348+
"node_version": "12.16.1",
49349+
"npm_version": "6.14.0",
49350+
"apps_engine_version": "1.17.0",
49351+
"mongo_versions": [
49352+
"3.4",
49353+
"3.6",
49354+
"4.0"
49355+
],
49356+
"pull_requests": [
49357+
{
49358+
"pr": "19020",
49359+
"title": "Obey to settings properties",
49360+
"userLogin": "sampaiodiego",
49361+
"milestone": "3.6.3",
49362+
"contributors": [
49363+
"sampaiodiego"
49364+
]
49365+
},
49366+
{
49367+
"pr": "18978",
49368+
"title": "[FIX] Federation issues",
49369+
"userLogin": "alansikora",
49370+
"milestone": "3.6.3",
49371+
"contributors": [
49372+
"alansikora"
49373+
]
49374+
},
49375+
{
49376+
"pr": "18994",
49377+
"title": "[FIX] LDAP avatar upload",
49378+
"userLogin": "pierre-lehnen-rc",
49379+
"milestone": "3.6.3",
49380+
"contributors": [
49381+
"pierre-lehnen-rc"
49382+
]
49383+
},
49384+
{
49385+
"pr": "18948",
49386+
"title": "[FIX] Errors in LDAP avatar sync preventing login",
49387+
"userLogin": "pierre-lehnen-rc",
49388+
"milestone": "3.6.3",
49389+
"contributors": [
49390+
"pierre-lehnen-rc"
49391+
]
49392+
},
49393+
{
49394+
"pr": "18956",
49395+
"title": "[FIX] PDF not rendering",
49396+
"userLogin": "gabriellsh",
49397+
"milestone": "3.6.3",
49398+
"contributors": [
49399+
"gabriellsh",
49400+
"web-flow"
49401+
]
49402+
}
49403+
]
4934649404
}
4934749405
}
4934849406
}

.snapcraft/resources/prepareRocketChat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
curl -SLf "https://releases.rocket.chat/3.6.2/download/" -o rocket.chat.tgz
3+
curl -SLf "https://releases.rocket.chat/3.6.3/download/" -o rocket.chat.tgz
44

55
tar xf rocket.chat.tgz --strip 1
66

.snapcraft/snap/snapcraft.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# 5. `snapcraft snap`
88

99
name: rocketchat-server
10-
version: 3.6.2
10+
version: 3.6.3
1111
summary: Rocket.Chat server
1212
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
1313
confinement: strict

HISTORY.md

+53-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,41 @@
11

2+
# 3.6.3
3+
`2020-09-25 · 4 🐛 · 1 🔍 · 4 👩‍💻👨‍💻`
4+
5+
### Engine versions
6+
- Node: `12.16.1`
7+
- NPM: `6.14.0`
8+
- MongoDB: `3.4, 3.6, 4.0`
9+
- Apps-Engine: `1.17.0`
10+
11+
### 🐛 Bug fixes
12+
13+
14+
- Errors in LDAP avatar sync preventing login ([#18948](https://github.com/RocketChat/Rocket.Chat/pull/18948))
15+
16+
- Federation issues ([#18978](https://github.com/RocketChat/Rocket.Chat/pull/18978))
17+
18+
- LDAP avatar upload ([#18994](https://github.com/RocketChat/Rocket.Chat/pull/18994))
19+
20+
- PDF not rendering ([#18956](https://github.com/RocketChat/Rocket.Chat/pull/18956))
21+
22+
<details>
23+
<summary>🔍 Minor changes</summary>
24+
25+
26+
- Obey to settings properties ([#19020](https://github.com/RocketChat/Rocket.Chat/pull/19020))
27+
28+
</details>
29+
30+
### 👩‍💻👨‍💻 Core Team 🤓
31+
32+
- [@alansikora](https://github.com/alansikora)
33+
- [@gabriellsh](https://github.com/gabriellsh)
34+
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
35+
- [@sampaiodiego](https://github.com/sampaiodiego)
36+
237
# 3.6.2
3-
`2020-09-17 · 7 🐛 · 6 👩‍💻👨‍💻`
38+
`2020-09-18 · 7 🐛 · 6 👩‍💻👨‍💻`
439

540
### Engine versions
641
- Node: `12.16.1`
@@ -13,13 +48,13 @@
1348

1449
- Create Custom OAuth services from environment variables ([#17377](https://github.com/RocketChat/Rocket.Chat/pull/17377) by [@mrtndwrd](https://github.com/mrtndwrd))
1550

16-
- Deactivate users that are the last owner of a room using REST API ([#18864](https://github.com/RocketChat/Rocket.Chat/pull/18864))
51+
- Deactivate users that are the last owner of a room using REST API ([#18864](https://github.com/RocketChat/Rocket.Chat/pull/18864) by [@FelipeParreira](https://github.com/FelipeParreira))
1752

1853
Allow for user deactivation through REST API (even if user is the last owner of a room)
1954

2055
- Ignore User action from user card ([#18866](https://github.com/RocketChat/Rocket.Chat/pull/18866))
2156

22-
- invite-all-from and invite-all-to commands don't work with multibyte room names ([#18919](https://github.com/RocketChat/Rocket.Chat/pull/18919))
57+
- invite-all-from and invite-all-to commands don't work with multibyte room names ([#18919](https://github.com/RocketChat/Rocket.Chat/pull/18919) by [@FelipeParreira](https://github.com/FelipeParreira))
2358

2459
Fix slash commands (invite-all-from and invite-all-to) to accept multi-byte room names.
2560

@@ -31,12 +66,12 @@
3166

3267
### 👩‍💻👨‍💻 Contributors 😍
3368

69+
- [@FelipeParreira](https://github.com/FelipeParreira)
3470
- [@mrtndwrd](https://github.com/mrtndwrd)
3571
- [@wreiske](https://github.com/wreiske)
3672

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

39-
- [@FelipeParreira](https://github.com/FelipeParreira)
4075
- [@gabriellsh](https://github.com/gabriellsh)
4176
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
4277
- [@sampaiodiego](https://github.com/sampaiodiego)
@@ -113,9 +148,9 @@
113148
- **2FA:** Password enforcement setting and 2FA protection when saving settings or resetting E2E encryption ([#18640](https://github.com/RocketChat/Rocket.Chat/pull/18640))
114149

115150
- Increase the 2FA remembering time from 5min to 30min
116-
151+
117152
- Add new setting to enforce 2FA password fallback (enabled only for new installations)
118-
153+
119154
- Require 2FA to save settings and reset E2E Encryption keys
120155

121156
- **Omnichannel:** Allow set other agent status via method `livechat:changeLivechatStatus ` ([#18571](https://github.com/RocketChat/Rocket.Chat/pull/18571))
@@ -484,11 +519,11 @@
484519
- Mention autocomplete UI and performance improvements ([#18309](https://github.com/RocketChat/Rocket.Chat/pull/18309))
485520

486521
* New setting to configure the number of suggestions `Admin > Layout > User Interface > Number of users' autocomplete suggestions` (default 5)
487-
522+
488523
* The UI shows whenever the user is not a member of the room
489-
524+
490525
* The UI shows when the suggestion came from the last messages for quick selection/reply
491-
526+
492527
* The suggestions follow this order:
493528
* The user with the exact username and member of the room
494529
* The user with the exact username but not a member of the room (if allowed to list non-members)
@@ -1347,11 +1382,11 @@
13471382
- Notification sounds ([#17616](https://github.com/RocketChat/Rocket.Chat/pull/17616))
13481383

13491384
* Global CDN config was ignored when loading the sound files
1350-
1385+
13511386
* Upload of custom sounds wasn't getting the file extension correctly
1352-
1387+
13531388
* Some translations were missing
1354-
1389+
13551390
* Edit and delete of custom sounds were not working correctly
13561391

13571392
- Omnichannel departments are not saved when the offline channel name is not defined ([#17553](https://github.com/RocketChat/Rocket.Chat/pull/17553))
@@ -1641,15 +1676,15 @@
16411676

16421677
We are still using the same logic to define which notifications every new message will generate, it takes some servers' settings, users's preferences and subscriptions' settings in consideration to determine who will receive each notification type (desktop, audio, email and mobile push), but now it doesn't check the user's status (online, away, offline) for email and mobile push notifications but send those notifications to a new queue with the following rules:
16431678

1644-
1679+
16451680
- When the user is online the notification is scheduled to be sent in 120 seconds
1646-
1681+
16471682
- When the user is away the notification is scheduled to be sent in 120 seconds minus the amount of time he is away
1648-
1683+
16491684
- When the user is offline the notification is scheduled to be sent right away
1650-
1685+
16511686
- When the user reads a channel all the notifications for that user are removed (clear queue)
1652-
1687+
16531688
- When a notification is processed to be sent to a user and there are other scheduled notifications:
16541689
- All the scheduled notifications for that user are rescheduled to now
16551690
- The current notification goes back to the queue to be processed ordered by creation date
@@ -13514,4 +13549,4 @@
1351413549
- [@graywolf336](https://github.com/graywolf336)
1351513550
- [@marceloschmidt](https://github.com/marceloschmidt)
1351613551
- [@rodrigok](https://github.com/rodrigok)
13517-
- [@sampaiodiego](https://github.com/sampaiodiego)
13552+
- [@sampaiodiego](https://github.com/sampaiodiego)

app/authorization/server/streamer/permissions/emitter.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ Permissions.on('change', ({ clientAction, id, data, diff }) => {
3232
// if the permission changes, the effect on the visible settings depends on the role affected.
3333
// The selected-settings-based consumers have to react accordingly and either add or remove the
3434
// setting from the user's collection
35-
const setting = Settings.findOneById(data.settingId);
35+
const setting = Settings.findOneNotHiddenById(data.settingId);
36+
if (!setting) {
37+
return;
38+
}
3639
Notifications.notifyLoggedInThisInstance(
3740
'private-settings-changed',
3841
'updated',

app/federation/server/endpoints/dispatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ const eventHandlers = {
444444
},
445445
};
446446

447-
API.v1.addRoute('federation.events.dispatch', { authRequired: false }, {
447+
API.v1.addRoute('federation.events.dispatch', { authRequired: false, rateLimiterOptions: { numRequestsAllowed: 30, intervalTimeInMS: 1000 } }, {
448448
async post() {
449449
if (!isFederationEnabled()) {
450450
return API.v1.failure('Federation not enabled');

app/federation/server/handler/index.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ export function dispatchEvents(domains, events) {
6767
}
6868

6969
export function dispatchEvent(domains, event) {
70-
// Ensure the domain list is distinct to avoid excessive events
71-
const distinctDomains = [...new Set(domains)].filter((domain) => domain === event.origin);
72-
73-
dispatchEvents(distinctDomains, [event]);
70+
dispatchEvents([...new Set(domains)], [event]);
7471
}
7572

7673
export function getUpload(domain, fileId) {

app/federation/server/lib/callbacks.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
import { callbacks } from '../../../callbacks/server';
2+
import { settings } from '../../../settings/server';
23

34
const callbackDefinitions = [];
45

5-
export function registerCallback(callbackDefition) {
6-
callbackDefinitions.push(callbackDefition);
6+
function enableCallback(definition) {
7+
callbacks.add(definition.hook, definition.callback, callbacks.priority.LOW, definition.id);
8+
}
9+
10+
export function registerCallback(callbackDefinition) {
11+
callbackDefinitions.push(callbackDefinition);
12+
13+
if (settings.get('FEDERATION_Enabled')) {
14+
enableCallback(callbackDefinition);
15+
}
716
}
817

918
export function enableCallbacks() {
1019
for (const definition of callbackDefinitions) {
11-
callbacks.add(definition.hook, definition.callback, callbacks.priority.LOW, definition.id);
20+
enableCallback(definition);
1221
}
1322
}
1423

app/ldap/server/sync.js

+36-27
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,41 @@ export function mapLDAPGroupsToChannels(ldap, ldapUser, user) {
337337
return userChannels;
338338
}
339339

340+
function syncUserAvatar(user, ldapUser) {
341+
if (!user?._id || settings.get('LDAP_Sync_User_Avatar') !== true) {
342+
return;
343+
}
344+
345+
const avatarField = (settings.get('LDAP_Avatar_Field') || 'thumbnailPhoto').trim();
346+
const avatar = ldapUser._raw[avatarField] || ldapUser._raw.thumbnailPhoto || ldapUser._raw.jpegPhoto;
347+
if (!avatar) {
348+
return;
349+
}
350+
351+
logger.info('Syncing user avatar');
352+
353+
Meteor.defer(() => {
354+
const rs = RocketChatFile.bufferToStream(avatar);
355+
const fileStore = FileUpload.getStore('Avatars');
356+
fileStore.deleteByName(user.username);
357+
358+
const file = {
359+
userId: user._id,
360+
type: 'image/jpeg',
361+
size: avatar.length,
362+
};
363+
364+
Meteor.runAsUser(user._id, () => {
365+
fileStore.insert(file, rs, (err, result) => {
366+
Meteor.setTimeout(function() {
367+
Users.setAvatarData(user._id, 'ldap', result.etag);
368+
Notifications.notifyLogged('updateAvatar', { username: user.username, etag: result.etag });
369+
}, 500);
370+
});
371+
});
372+
});
373+
}
374+
340375
export function syncUserData(user, ldapUser, ldap) {
341376
logger.info('Syncing user data');
342377
logger.debug('user', { email: user.email, _id: user._id });
@@ -397,33 +432,7 @@ export function syncUserData(user, ldapUser, ldap) {
397432
}
398433
}
399434

400-
const avatarField = (settings.get('LDAP_Avatar_Field') || 'thumbnailPhoto').trim();
401-
402-
if (user && user._id && settings.get('LDAP_Sync_User_Avatar') === true) {
403-
const avatar = ldapUser._raw[avatarField] || ldapUser._raw.thumbnailPhoto || ldapUser._raw.jpegPhoto;
404-
405-
if (avatar) {
406-
logger.info('Syncing user avatar');
407-
408-
const rs = RocketChatFile.bufferToStream(avatar);
409-
const fileStore = FileUpload.getStore('Avatars');
410-
fileStore.deleteByName(user.username);
411-
412-
const file = {
413-
userId: user._id,
414-
type: 'image/jpeg',
415-
};
416-
417-
Meteor.runAsUser(user._id, () => {
418-
fileStore.insert(file, rs, (err, result) => {
419-
Meteor.setTimeout(function() {
420-
Users.setAvatarData(user._id, 'ldap', result.etag);
421-
Notifications.notifyLogged('updateAvatar', { username: user.username, etag: result.etag });
422-
}, 500);
423-
});
424-
});
425-
}
426-
}
435+
syncUserAvatar(user, ldapUser);
427436
}
428437

429438
export function addLdapUser(ldapUser, username, password, ldap) {

app/message-attachments/client/messageAttachment.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ async function renderPdfToCanvas(canvasId, pdfLink) {
4242
loader.style.display = 'block';
4343
}
4444

45-
const pdf = await pdfjsLib.getDocument(pdfLink);
45+
const pdf = await pdfjsLib.getDocument(pdfLink).promise;
4646
const page = await pdf.getPage(1);
4747
const scale = 0.5;
48-
const viewport = page.getViewport(scale);
48+
const viewport = page.getViewport({ scale });
4949
const context = canvas.getContext('2d');
5050
canvas.height = viewport.height;
5151
canvas.width = viewport.width;

app/utils/rocketchat.info

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "3.6.2"
2+
"version": "3.6.3"
33
}

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)