Skip to content

Commit

Permalink
Merge pull request #673 from assistify/release/3.0.7
Browse files Browse the repository at this point in the history
Release '3.0.7'
  • Loading branch information
jschirrmacher authored Mar 28, 2020
2 parents e502b05 + a3f3acc commit 2dd4d60
Show file tree
Hide file tree
Showing 29 changed files with 416 additions and 213 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.0.3
ENV RC_VERSION 3.0.7

MAINTAINER [email protected]

Expand Down
110 changes: 109 additions & 1 deletion .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -39959,6 +39959,114 @@
]
}
]
},
"3.0.4": {
"node_version": "12.14.0",
"npm_version": "6.13.4",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "16617",
"title": "[IMPROVE] Send files over REST API",
"userLogin": "ggazzo",
"milestone": "3.1.0",
"contributors": [
"ggazzo",
"web-flow",
"sampaiodiego"
]
},
{
"pr": "16838",
"title": "[FIX] Integrations page pagination",
"userLogin": "sampaiodiego",
"milestone": "3.1.0",
"contributors": [
"sampaiodiego"
]
},
{
"pr": "16699",
"title": "[FIX] TypeError when trying to load avatar of an invalid room.",
"userLogin": "pierre-lehnen-rc",
"contributors": [
"pierre-lehnen-rc"
]
}
]
},
"3.0.5": {
"node_version": "12.14.0",
"npm_version": "6.13.4",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "16989",
"title": "[FIX] Race conditions on/before login",
"userLogin": "sampaiodiego",
"contributors": [
"sampaiodiego"
]
}
]
},
"3.0.6": {
"node_version": "12.14.0",
"npm_version": "6.13.4",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "16999",
"title": "Regression: Replace the Omnichannel queue model observe with Stream",
"userLogin": "renatobecker",
"milestone": "3.1.0",
"contributors": [
"renatobecker"
]
},
{
"pr": "16787",
"title": "[FIX] Keeps the agent in the room after accepting a new Omnichannel request",
"userLogin": "renatobecker",
"milestone": "3.1.0",
"contributors": [
"renatobecker",
"web-flow"
]
}
]
},
"3.0.7": {
"node_version": "12.14.0",
"npm_version": "6.13.4",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "17017",
"title": "Regression: Remove deprecated Omnichannel setting used to fetch the queue data through subscription ",
"userLogin": "renatobecker",
"milestone": "3.1.0",
"contributors": [
"renatobecker"
]
}
]
}
}
}
}
88 changes: 83 additions & 5 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,85 @@

# 3.0.7
`2020-03-25 · 1 🔍 · 1 👩‍💻👨‍💻`

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

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

- Regression: Remove deprecated Omnichannel setting used to fetch the queue data through subscription ([#17017](https://github.com/RocketChat/Rocket.Chat/pull/17017))

</details>

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

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

# 3.0.6
`2020-03-25 · 1 🐛 · 1 🔍 · 1 👩‍💻👨‍💻`

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

### 🐛 Bug fixes

- Keeps the agent in the room after accepting a new Omnichannel request ([#16787](https://github.com/RocketChat/Rocket.Chat/pull/16787))

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

- Regression: Replace the Omnichannel queue model observe with Stream ([#16999](https://github.com/RocketChat/Rocket.Chat/pull/16999))

</details>

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

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

# 3.0.5
`2020-03-24 · 1 🐛 · 1 👩‍💻👨‍💻`

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

### 🐛 Bug fixes

- Race conditions on/before login ([#16989](https://github.com/RocketChat/Rocket.Chat/pull/16989))

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

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

# 3.0.4
`2020-03-16 · 1 🚀 · 2 🐛 · 3 👩‍💻👨‍💻`

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

### 🚀 Improvements

- Send files over REST API ([#16617](https://github.com/RocketChat/Rocket.Chat/pull/16617))

### 🐛 Bug fixes

- Integrations page pagination ([#16838](https://github.com/RocketChat/Rocket.Chat/pull/16838))
- TypeError when trying to load avatar of an invalid room. ([#16699](https://github.com/RocketChat/Rocket.Chat/pull/16699))

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

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

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

Expand All @@ -24,7 +105,7 @@
- [@rodrigok](https://github.com/rodrigok)

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

### Engine versions
- Node: `12.14.0`
Expand All @@ -35,16 +116,13 @@

- ie11 support ([#16682](https://github.com/RocketChat/Rocket.Chat/pull/16682))
- Omnichannel Inquiry queues when removing chats ([#16603](https://github.com/RocketChat/Rocket.Chat/pull/16603))
- users.info endpoint not handling the error if the user does not exist ([#16495](https://github.com/RocketChat/Rocket.Chat/pull/16495))
- Clear unread red line when the ESC key is pressed ([#16668](https://github.com/RocketChat/Rocket.Chat/pull/16668))

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

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

# 3.0.1
`2020-02-19 · 7 🐛 · 4 👩‍💻👨‍💻`
Expand Down Expand Up @@ -6765,4 +6843,4 @@ Assistify.Chat is now based on Rocket.Chat 0.68.5!
- [@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)
66 changes: 35 additions & 31 deletions app/api/server/v1/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,45 @@ API.v1.addRoute('rooms.get', { authRequired: true }, {
},
});

API.v1.addRoute('rooms.upload/:rid', { authRequired: true }, {
post() {
const room = Meteor.call('canAccessRoom', this.urlParams.rid, this.userId);
const getFiles = Meteor.wrapAsync(({ request }, callback) => {
const busboy = new Busboy({ headers: request.headers });
const files = [];

if (!room) {
return API.v1.unauthorized();
const fields = {};


busboy.on('file', (fieldname, file, filename, encoding, mimetype) => {
if (fieldname !== 'file') {
return callback(new Meteor.Error('invalid-field'));
}

const busboy = new Busboy({ headers: this.request.headers });
const files = [];
const fields = {};
const fileDate = [];
file.on('data', (data) => fileDate.push(data));

Meteor.wrapAsync((callback) => {
busboy.on('file', (fieldname, file, filename, encoding, mimetype) => {
if (fieldname !== 'file') {
return callback(new Meteor.Error('invalid-field'));
}
file.on('end', () => {
files.push({ fieldname, file, filename, encoding, mimetype, fileBuffer: Buffer.concat(fileDate) });
});
});

const fileDate = [];
file.on('data', (data) => fileDate.push(data));
busboy.on('field', (fieldname, value) => { fields[fieldname] = value; });

file.on('end', () => {
files.push({ fieldname, file, filename, encoding, mimetype, fileBuffer: Buffer.concat(fileDate) });
});
});
busboy.on('finish', Meteor.bindEnvironment(() => callback(null, { files, fields })));

busboy.on('field', (fieldname, value) => { fields[fieldname] = value; });
request.pipe(busboy);
});

busboy.on('finish', Meteor.bindEnvironment(() => callback()));
API.v1.addRoute('rooms.upload/:rid', { authRequired: true }, {
post() {
const room = Meteor.call('canAccessRoom', this.urlParams.rid, this.userId);

if (!room) {
return API.v1.unauthorized();
}

this.request.pipe(busboy);
})();

const { files, fields } = getFiles({
request: this.request,
});

if (files.length === 0) {
return API.v1.failure('File required');
Expand All @@ -102,8 +109,6 @@ API.v1.addRoute('rooms.upload/:rid', { authRequired: true }, {

const file = files[0];

const fileStore = FileUpload.getStore('Uploads');

const details = {
name: file.filename,
size: file.fileBuffer.length,
Expand All @@ -112,18 +117,17 @@ API.v1.addRoute('rooms.upload/:rid', { authRequired: true }, {
userId: this.userId,
};

let fileData = {};

Meteor.runAsUser(this.userId, () => {
const uploadedFile = Meteor.wrapAsync(fileStore.insert.bind(fileStore))(details, file.fileBuffer);
const fileData = Meteor.runAsUser(this.userId, () => {
const fileStore = FileUpload.getStore('Uploads');
const uploadedFile = fileStore.insertSync(details, file.fileBuffer);

uploadedFile.description = fields.description;

delete fields.description;

API.v1.success(Meteor.call('sendFileMessage', this.urlParams.rid, null, uploadedFile, fields));
Meteor.call('sendFileMessage', this.urlParams.rid, null, uploadedFile, fields);

fileData = uploadedFile;
return uploadedFile;
});

return API.v1.success({ message: Messages.getMessageByFileIdAndUsername(fileData._id, this.userId) });
Expand Down
4 changes: 2 additions & 2 deletions app/apps/client/admin/appInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ Template.appInstall.events({
let result;

if (isUpdating) {
result = await APIClient.upload(`apps/${ t.isUpdatingId.get() }`, data);
result = await APIClient.upload(`apps/${ t.isUpdatingId.get() }`, data).promise;
} else {
result = await APIClient.upload('apps', data);
result = await APIClient.upload('apps', data).promise;
}

FlowRouter.go(`/admin/apps/${ result.app.id }?version=${ result.app.version }`);
Expand Down
10 changes: 9 additions & 1 deletion app/authorization/client/startup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';

import { hasAtLeastOnePermission } from './hasPermission';
import { CachedCollectionManager } from '../../ui-cached-collection';
Expand Down Expand Up @@ -28,5 +29,12 @@ Meteor.startup(() => {
},
removed: (role) => Roles.remove({ _id: role.name }),
};
rolesStreamer.on('roles', (role) => events[role.type](role));

Tracker.autorun((c) => {
if (!Meteor.userId()) {
return;
}
rolesStreamer.on('roles', (role) => events[role.type](role));
c.stop();
});
});
2 changes: 2 additions & 0 deletions app/file-upload/server/lib/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ export class FileUploadClass {
}

FileUpload.handlers[name] = this;

this.insertSync = Meteor.wrapAsync(this.insert, this);
}

getStore() {
Expand Down
2 changes: 1 addition & 1 deletion app/integrations/client/views/integrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Template.integrations.onCreated(async function() {

this.autorun(async () => {
const offset = this.offset.get();
const { integrations, total } = await APIClient.v1.get(`integrations.list?count=${ ITEMS_COUNT }&offset=${ offset }`);
const { integrations, total } = await APIClient.v1.get(`integrations.list?sort={"type":1}&count=${ ITEMS_COUNT }&offset=${ offset }`);
this.total.set(total);
this.integrations.set(this.integrations.get().concat(integrations));
});
Expand Down
Loading

0 comments on commit 2dd4d60

Please sign in to comment.