Skip to content

Commit

Permalink
Merge pull request RocketChat#374 from WideChat/develop_pwa-catchup-2…
Browse files Browse the repository at this point in the history
…fb78cf

[Upstream Catchup] Merge RC:master to develop_pwa
  • Loading branch information
Shailesh351 authored Aug 10, 2020
2 parents 9dcbd68 + 2fb78cf commit e0cf91b
Show file tree
Hide file tree
Showing 21 changed files with 189 additions and 37 deletions.
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.5.0
ENV RC_VERSION 3.5.1

MAINTAINER [email protected]

Expand Down
98 changes: 98 additions & 0 deletions .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
]
}
}
}
2 changes: 1 addition & 1 deletion .snapcraft/resources/prepareRocketChat
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion .snapcraft/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -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 👩‍💻👨‍💻`

Expand Down
3 changes: 0 additions & 3 deletions app/livechat/imports/server/rest/inquiries.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions app/livechat/server/lib/Helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -400,4 +404,6 @@ export const updateDepartmentAgents = (departmentId, agents) => {
const numAgents = LivechatDepartmentAgents.find({ departmentId }).count();
LivechatDepartment.updateNumAgentsById(departmentId, numAgents);
}

return true;
};
13 changes: 6 additions & 7 deletions app/livechat/server/lib/Livechat.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,31 +813,30 @@ 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);
if (!department) {
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) {
Expand Down Expand Up @@ -880,7 +879,7 @@ export const Livechat = {
}

const departmentDB = LivechatDepartment.createOrUpdateDepartment(_id, departmentData);
if (departmentDB) {
if (departmentDB && departmentAgents) {
updateDepartmentAgents(departmentDB._id, departmentAgents);
}

Expand Down
14 changes: 3 additions & 11 deletions app/livechat/server/lib/stream/agentStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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));
Expand Down
10 changes: 8 additions & 2 deletions app/push/server/apn.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import apn from 'apn';
import { EJSON } from 'meteor/ejson';

import { logger } from './logger';

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
};
3 changes: 2 additions & 1 deletion app/push/server/gcm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import gcm from 'node-gcm';
import { EJSON } from 'meteor/ejson';

import { logger } from './logger';

Expand All @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions app/push/server/push.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/ui/client/lib/chatMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export class ChatMessages {
showCancelButton: true,
confirmButtonText: t('Yes'),
cancelButtonText: t('No'),
closeOnConfirm: true,
closeOnConfirm: false,
});

const contentType = 'text/plain';
Expand Down
2 changes: 1 addition & 1 deletion app/ui/client/lib/recorderjs/audioEncoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/utils/rocketchat.info
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "3.5.0"
"version": "3.5.1"
}
2 changes: 1 addition & 1 deletion app/videobridge/client/views/videoFlexTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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/"
Expand Down
1 change: 1 addition & 0 deletions server/startup/migrations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,5 @@ import './v198';
import './v199';
import './v200';
import './v201';
import './v202';
import './xrun';
2 changes: 1 addition & 1 deletion server/startup/migrations/v194.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading

0 comments on commit e0cf91b

Please sign in to comment.