From 5f58a4a2333fa03342c49afa23bb58ad05534681 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Tue, 28 Jul 2020 13:09:53 -0300 Subject: [PATCH 1/9] [FIX] Can't send long messages as attachment (#18355) Co-authored-by: Tasso Evangelista --- app/ui/client/lib/chatMessages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui/client/lib/chatMessages.js b/app/ui/client/lib/chatMessages.js index 9c4db3d1ee2e..2fe83a9406c4 100644 --- a/app/ui/client/lib/chatMessages.js +++ b/app/ui/client/lib/chatMessages.js @@ -375,7 +375,7 @@ export class ChatMessages { showCancelButton: true, confirmButtonText: t('Yes'), cancelButtonText: t('No'), - closeOnConfirm: true, + closeOnConfirm: false, }); const contentType = 'text/plain'; From de27d47f525cbb8326f1d4fc034a09eb8a48afb0 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 31 Jul 2020 15:31:06 -0300 Subject: [PATCH 2/9] [FIX] Appending 'false' to Jitsi URL (#18430) --- app/videobridge/client/views/videoFlexTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/videobridge/client/views/videoFlexTab.js b/app/videobridge/client/views/videoFlexTab.js index 50d52f599af0..c9daa99a62b6 100644 --- a/app/videobridge/client/views/videoFlexTab.js +++ b/app/videobridge/client/views/videoFlexTab.js @@ -131,7 +131,7 @@ Template.videoFlexTab.onRendered(function() { return Tracker.nonreactive(async () => { await start(); - const queryString = accessToken && `?jwt=${ accessToken }`; + const queryString = accessToken ? `?jwt=${ accessToken }` : ''; const newWindow = window.open(`${ (noSsl ? 'http://' : 'https://') + domain }/${ jitsiRoom }${ queryString }`, jitsiRoom); if (newWindow) { From c9ccb786628f53a60e5a7fbcc09dad600f390656 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 31 Jul 2020 18:04:38 -0300 Subject: [PATCH 3/9] [FIX] Multiple push notifications sent via native drivers (#18442) --- app/push/server/apn.js | 10 ++++++++-- app/push/server/gcm.js | 3 ++- app/push/server/push.js | 3 --- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/push/server/apn.js b/app/push/server/apn.js index f661da45cda2..693f8dcc0529 100644 --- a/app/push/server/apn.js +++ b/app/push/server/apn.js @@ -1,4 +1,5 @@ import apn from 'apn'; +import { EJSON } from 'meteor/ejson'; import { logger } from './logger'; @@ -34,7 +35,7 @@ export const sendAPN = ({ userToken, notification, _removeToken }) => { } // Allow the user to set payload data - note.payload = notification.payload || {}; + note.payload = notification.payload ? { ejson: EJSON.stringify(notification.payload) } : {}; note.payload.messageFrom = notification.from; note.priority = priority; @@ -111,5 +112,10 @@ export const initAPN = ({ options, absoluteUrl }) => { } // Rig apn connection - apnConnection = new apn.Provider(options.apn); + try { + apnConnection = new apn.Provider(options.apn); + } catch (e) { + console.error('Error trying to initialize APN'); + console.error(e); + } }; diff --git a/app/push/server/gcm.js b/app/push/server/gcm.js index 5d7c11d04cb7..05acee5b8819 100644 --- a/app/push/server/gcm.js +++ b/app/push/server/gcm.js @@ -1,4 +1,5 @@ import gcm from 'node-gcm'; +import { EJSON } from 'meteor/ejson'; import { logger } from './logger'; @@ -21,7 +22,7 @@ export const sendGCM = function({ userTokens, notification, _replaceToken, _remo logger.debug('sendGCM', userTokens, notification); // Allow user to set payload - const data = notification.payload || {}; + const data = notification.payload ? { ejson: EJSON.stringify(notification.payload) } : {}; data.title = notification.title; data.message = notification.text; diff --git a/app/push/server/push.js b/app/push/server/push.js index 3c61b9aef55a..b0d7abed1ad8 100644 --- a/app/push/server/push.js +++ b/app/push/server/push.js @@ -1,5 +1,4 @@ import { Meteor } from 'meteor/meteor'; -import { EJSON } from 'meteor/ejson'; import { Match, check } from 'meteor/check'; import { Mongo } from 'meteor/mongo'; import { HTTP } from 'meteor/http'; @@ -80,8 +79,6 @@ export class PushClass { sendNotificationNative(app, notification, countApn, countGcm) { logger.debug('send to token', app.token); - notification.payload = notification.payload ? { ejson: EJSON.stringify(notification.payload) } : {}; - if (app.token.apn) { countApn.push(app._id); // Send to APN From b185129676b6c25b5308d547ce168a4805a86d42 Mon Sep 17 00:00:00 2001 From: Renato Becker Date: Fri, 31 Jul 2020 18:55:21 -0300 Subject: [PATCH 4/9] [FIX] Omnichannel Take Inquiry endpoint checking wrong permission (#18446) --- app/livechat/imports/server/rest/inquiries.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/livechat/imports/server/rest/inquiries.js b/app/livechat/imports/server/rest/inquiries.js index 3abfc5eee735..85b23f2f00ef 100644 --- a/app/livechat/imports/server/rest/inquiries.js +++ b/app/livechat/imports/server/rest/inquiries.js @@ -48,9 +48,6 @@ API.v1.addRoute('livechat/inquiries.list', { authRequired: true }, { API.v1.addRoute('livechat/inquiries.take', { authRequired: true }, { post() { - if (!hasPermission(this.userId, 'view-livechat-manager')) { - return API.v1.unauthorized(); - } try { check(this.bodyParams, { inquiryId: String, From cf81e7fe856a46f4e9a5c9b8f580e006321a08d7 Mon Sep 17 00:00:00 2001 From: Renato Becker Date: Fri, 31 Jul 2020 19:04:19 -0300 Subject: [PATCH 5/9] [FIX] Error when updating omnichannel department without agents parameter (#18428) * Fix error when updating department through REST API. * Improves validation of endpoint parameters --- app/livechat/server/lib/Helper.js | 6 ++++++ app/livechat/server/lib/Livechat.js | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/livechat/server/lib/Helper.js b/app/livechat/server/lib/Helper.js index 4ec60f142e38..bf6f3b26dae0 100644 --- a/app/livechat/server/lib/Helper.js +++ b/app/livechat/server/lib/Helper.js @@ -379,6 +379,10 @@ export const updateDepartmentAgents = (departmentId, agents) => { } upsert.forEach((agent) => { + if (!Users.findOneById(agent.agentId, { fields: { _id: 1 } })) { + return; + } + LivechatDepartmentAgents.saveAgent({ agentId: agent.agentId, departmentId, @@ -400,4 +404,6 @@ export const updateDepartmentAgents = (departmentId, agents) => { const numAgents = LivechatDepartmentAgents.find({ departmentId }).count(); LivechatDepartment.updateNumAgentsById(departmentId, numAgents); } + + return true; }; diff --git a/app/livechat/server/lib/Livechat.js b/app/livechat/server/lib/Livechat.js index 88278a48746b..0fe3480aa77d 100644 --- a/app/livechat/server/lib/Livechat.js +++ b/app/livechat/server/lib/Livechat.js @@ -813,22 +813,22 @@ export const Livechat = { saveDepartmentAgents(_id, departmentAgents) { check(_id, String); check(departmentAgents, { - upsert: [ + upsert: Match.Maybe([ Match.ObjectIncluding({ agentId: String, username: String, count: Match.Maybe(Match.Integer), order: Match.Maybe(Match.Integer), }), - ], - remove: [ + ]), + remove: Match.Maybe([ Match.ObjectIncluding({ agentId: String, username: Match.Maybe(String), count: Match.Maybe(Match.Integer), order: Match.Maybe(Match.Integer), }), - ], + ]), }); const department = LivechatDepartment.findOneById(_id); @@ -836,8 +836,7 @@ export const Livechat = { throw new Meteor.Error('error-department-not-found', 'Department not found', { method: 'livechat:saveDepartmentAgents' }); } - const departmentDB = LivechatDepartment.createOrUpdateDepartment(_id, department); - return departmentDB && updateDepartmentAgents(departmentDB._id, departmentAgents); + return updateDepartmentAgents(_id, departmentAgents); }, saveDepartment(_id, departmentData, departmentAgents) { @@ -880,7 +879,7 @@ export const Livechat = { } const departmentDB = LivechatDepartment.createOrUpdateDepartment(_id, departmentData); - if (departmentDB) { + if (departmentDB && departmentAgents) { updateDepartmentAgents(departmentDB._id, departmentAgents); } From f03a20a9da8fcd8e684200be9af5ff03d3f8946e Mon Sep 17 00:00:00 2001 From: Renato Becker Date: Fri, 31 Jul 2020 19:32:31 -0300 Subject: [PATCH 6/9] [FIX] Invalid MIME type when uploading audio files (#18426) * Fix invalid mime type when uploading audio files * Add migration. --- app/ui/client/lib/recorderjs/audioEncoder.js | 2 +- server/startup/migrations/index.js | 1 + server/startup/migrations/v202.js | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 server/startup/migrations/v202.js diff --git a/app/ui/client/lib/recorderjs/audioEncoder.js b/app/ui/client/lib/recorderjs/audioEncoder.js index ffa950e587ea..d05604110065 100644 --- a/app/ui/client/lib/recorderjs/audioEncoder.js +++ b/app/ui/client/lib/recorderjs/audioEncoder.js @@ -40,7 +40,7 @@ class AudioEncoder extends EventEmitter { handleWorkerMessage = (event) => { switch (event.data.command) { case 'end': { - const blob = new Blob(event.data.buffer, { type: 'audio/mp3' }); + const blob = new Blob(event.data.buffer, { type: 'audio/mpeg' }); this.emit('encoded', blob); this.worker.terminate(); break; diff --git a/server/startup/migrations/index.js b/server/startup/migrations/index.js index 5628426c442d..52bfb3888d84 100644 --- a/server/startup/migrations/index.js +++ b/server/startup/migrations/index.js @@ -198,4 +198,5 @@ import './v198'; import './v199'; import './v200'; import './v201'; +import './v202'; import './xrun'; diff --git a/server/startup/migrations/v202.js b/server/startup/migrations/v202.js new file mode 100644 index 000000000000..15f18cd54c67 --- /dev/null +++ b/server/startup/migrations/v202.js @@ -0,0 +1,15 @@ +import { Migrations } from '../../../app/migrations/server'; +import Uploads from '../../../app/models/server/models/Uploads'; + +Migrations.add({ + version: 202, + up() { + Promise.await(Uploads.model.rawCollection().updateMany({ + type: 'audio/mp3', + }, { + $set: { + type: 'audio/mpeg', + }, + })); + }, +}); From efb956ab7b8fb98ae0ee10706bc160383c81d090 Mon Sep 17 00:00:00 2001 From: Renato Becker Date: Fri, 31 Jul 2020 19:37:20 -0300 Subject: [PATCH 7/9] [FIX] Omnichannel session monitor is not starting (#18412) * Fix Omnicahnnel session handler. * Fix remove user process. --- app/livechat/server/lib/stream/agentStatus.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/livechat/server/lib/stream/agentStatus.ts b/app/livechat/server/lib/stream/agentStatus.ts index 0634f78bc396..4d875e95ebcc 100644 --- a/app/livechat/server/lib/stream/agentStatus.ts +++ b/app/livechat/server/lib/stream/agentStatus.ts @@ -17,17 +17,8 @@ settings.get('Livechat_agent_leave_action_timeout', (_key, value) => { }); settings.get('Livechat_agent_leave_action', (_key, value) => { - if (typeof value !== 'boolean') { - return; - } - monitorAgents = value; -}); - -settings.get('Livechat_agent_leave_action', (_key, value) => { - if (typeof value !== 'string') { - return; - } - action = value; + monitorAgents = value !== 'none'; + action = value as string; }); settings.get('Livechat_agent_leave_comment', (_key, value) => { @@ -57,6 +48,7 @@ const onlineAgents = { if (!this.exists(userId)) { return; } + this.users.delete(userId); if (this.queue.has(userId)) { clearTimeout(this.queue.get(userId)); From af6988e9ef6cf9ac0c877c0a213194e86bc0cdbf Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 1 Aug 2020 18:52:41 +0200 Subject: [PATCH 8/9] [FIX] Migration 194 (#18457) --- server/startup/migrations/v194.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/startup/migrations/v194.js b/server/startup/migrations/v194.js index 4875d6b2a2e3..1b34f829a37a 100644 --- a/server/startup/migrations/v194.js +++ b/server/startup/migrations/v194.js @@ -7,7 +7,7 @@ import { Migrations } from '../../../app/migrations/server'; function updateFieldMap() { const _id = 'SAML_Custom_Default_user_data_fieldmap'; const setting = Settings.findOne({ _id }); - if (!setting.value) { + if (!setting || !setting.value) { return; } From 411c5c22d47cec4e0284d51de908fac4764989c0 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Sat, 1 Aug 2020 17:25:24 -0300 Subject: [PATCH 9/9] Bump version to 3.5.1 --- .docker/Dockerfile.rhel | 2 +- .github/history.json | 98 ++++++++++++++++++++++++++ .snapcraft/resources/prepareRocketChat | 2 +- .snapcraft/snap/snapcraft.yaml | 2 +- HISTORY.md | 40 +++++++++++ app/utils/rocketchat.info | 2 +- package-lock.json | 2 +- package.json | 2 +- 8 files changed, 144 insertions(+), 6 deletions(-) diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index 3bc544970a3c..1bf0175dac88 100644 --- a/.docker/Dockerfile.rhel +++ b/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7 -ENV RC_VERSION 3.5.0 +ENV RC_VERSION 3.5.1 MAINTAINER buildmaster@rocket.chat diff --git a/.github/history.json b/.github/history.json index d115db8aa4f9..175f45db050e 100644 --- a/.github/history.json +++ b/.github/history.json @@ -47908,6 +47908,104 @@ ] } ] + }, + "3.4.3": { + "node_version": "12.16.1", + "npm_version": "6.14.0", + "apps_engine_version": "1.15.0", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [] + }, + "3.5.1": { + "node_version": "12.16.1", + "npm_version": "6.14.0", + "apps_engine_version": "1.16.0", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [ + { + "pr": "18457", + "title": "[FIX] Migration 194", + "userLogin": "thirsch", + "contributors": [ + "thirsch", + "web-flow" + ] + }, + { + "pr": "18412", + "title": "[FIX] Omnichannel session monitor is not starting", + "userLogin": "renatobecker", + "milestone": "3.5.1", + "contributors": [ + "renatobecker", + "web-flow" + ] + }, + { + "pr": "18426", + "title": "[FIX] Invalid MIME type when uploading audio files", + "userLogin": "renatobecker", + "milestone": "3.5.1", + "contributors": [ + "renatobecker" + ] + }, + { + "pr": "18428", + "title": "[FIX] Error when updating omnichannel department without agents parameter", + "userLogin": "renatobecker", + "milestone": "3.5.1", + "contributors": [ + "renatobecker" + ] + }, + { + "pr": "18446", + "title": "[FIX] Omnichannel Take Inquiry endpoint checking wrong permission", + "userLogin": "renatobecker", + "milestone": "3.5.1", + "contributors": [ + "renatobecker" + ] + }, + { + "pr": "18442", + "title": "[FIX] Multiple push notifications sent via native drivers", + "userLogin": "sampaiodiego", + "milestone": "3.5.1", + "contributors": [ + "sampaiodiego" + ] + }, + { + "pr": "18430", + "title": "[FIX] Appending 'false' to Jitsi URL", + "userLogin": "ggazzo", + "milestone": "3.5.1", + "contributors": [ + "ggazzo" + ] + }, + { + "pr": "18355", + "title": "[FIX] Can't send long messages as attachment", + "userLogin": "gabriellsh", + "milestone": "3.5.1", + "contributors": [ + "gabriellsh", + "tassoevan", + "web-flow" + ] + } + ] } } } \ No newline at end of file diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat index 7c236a638b9d..6565ef2ffbdf 100755 --- a/.snapcraft/resources/prepareRocketChat +++ b/.snapcraft/resources/prepareRocketChat @@ -1,6 +1,6 @@ #!/bin/bash -curl -SLf "https://releases.rocket.chat/3.5.0/download/" -o rocket.chat.tgz +curl -SLf "https://releases.rocket.chat/3.5.1/download/" -o rocket.chat.tgz tar xf rocket.chat.tgz --strip 1 diff --git a/.snapcraft/snap/snapcraft.yaml b/.snapcraft/snap/snapcraft.yaml index 83a216f10242..a70d896a0fcb 100644 --- a/.snapcraft/snap/snapcraft.yaml +++ b/.snapcraft/snap/snapcraft.yaml @@ -7,7 +7,7 @@ # 5. `snapcraft snap` name: rocketchat-server -version: 3.5.0 +version: 3.5.1 summary: Rocket.Chat server description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/ confinement: strict diff --git a/HISTORY.md b/HISTORY.md index e0a063882d81..a0308f5fb206 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,44 @@ +# 3.5.1 +`2020-08-01 ยท 8 ๐Ÿ› ยท 6 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### Engine versions +- Node: `12.16.1` +- NPM: `6.14.0` +- MongoDB: `3.4, 3.6, 4.0` +- Apps-Engine: `1.16.0` + +### ๐Ÿ› Bug fixes + + +- Migration 194 ([#18457](https://github.com/RocketChat/Rocket.Chat/pull/18457) by [@thirsch](https://github.com/thirsch)) + +- Omnichannel session monitor is not starting ([#18412](https://github.com/RocketChat/Rocket.Chat/pull/18412)) + +- Invalid MIME type when uploading audio files ([#18426](https://github.com/RocketChat/Rocket.Chat/pull/18426)) + +- Error when updating omnichannel department without agents parameter ([#18428](https://github.com/RocketChat/Rocket.Chat/pull/18428)) + +- Omnichannel Take Inquiry endpoint checking wrong permission ([#18446](https://github.com/RocketChat/Rocket.Chat/pull/18446)) + +- Multiple push notifications sent via native drivers ([#18442](https://github.com/RocketChat/Rocket.Chat/pull/18442)) + +- Appending 'false' to Jitsi URL ([#18430](https://github.com/RocketChat/Rocket.Chat/pull/18430)) + +- Can't send long messages as attachment ([#18355](https://github.com/RocketChat/Rocket.Chat/pull/18355)) + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Contributors ๐Ÿ˜ + +- [@thirsch](https://github.com/thirsch) + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@gabriellsh](https://github.com/gabriellsh) +- [@ggazzo](https://github.com/ggazzo) +- [@renatobecker](https://github.com/renatobecker) +- [@sampaiodiego](https://github.com/sampaiodiego) +- [@tassoevan](https://github.com/tassoevan) + # 3.5.0 `2020-07-27 ยท 8 ๐ŸŽ‰ ยท 5 ๐Ÿš€ ยท 29 ๐Ÿ› ยท 34 ๐Ÿ” ยท 21 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info index 3414c2bf5e41..923769a269d7 100644 --- a/app/utils/rocketchat.info +++ b/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "3.5.0" + "version": "3.5.1" } diff --git a/package-lock.json b/package-lock.json index cb6a6efdf6bd..d614b9078f2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Rocket.Chat", - "version": "3.5.0", + "version": "3.5.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2d721f6c935b..27acfdd902db 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "3.5.0", + "version": "3.5.1", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/"