Release 2.1.1 (#15611)

* [FIX] dynamic import  (#15598)

* [FIX] Read Recepts was not working (#15603)

* Bump version to 2.1.1
pull/15622/head^2 2.1.1
Rodrigo Nascimento 6 years ago committed by Aaron Ogle
parent c95663d2ca
commit 1277048070
  1. 2
      .docker/Dockerfile.rhel
  2. 29
      .github/history.json
  3. 2
      .travis/snap.sh
  4. 18
      HISTORY.md
  5. 4
      app/utils/client/lib/baseuri.js
  6. 2
      app/utils/rocketchat.info
  7. 25
      client/routes.js
  8. 2
      package.json
  9. 9
      server/methods/readMessages.js
  10. 76
      tests/end-to-end/api/10-subscriptions.js

@ -1,6 +1,6 @@
FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7
ENV RC_VERSION 2.1.0
ENV RC_VERSION 2.1.1
MAINTAINER buildmaster@rocket.chat

@ -35316,6 +35316,35 @@
"4.0"
],
"pull_requests": []
},
"2.1.1": {
"node_version": "8.15.1",
"npm_version": "6.9.0",
"mongo_versions": [
"3.4",
"3.6",
"4.0"
],
"pull_requests": [
{
"pr": "15603",
"title": "[FIX] Read Recepts was not working",
"userLogin": "rodrigok",
"milestone": "2.1.1",
"contributors": [
"rodrigok"
]
},
{
"pr": "15598",
"title": "[FIX] Dynamic import of JS files were not working correctly",
"userLogin": "ggazzo",
"milestone": "2.1.1",
"contributors": [
"ggazzo"
]
}
]
}
}
}

@ -17,7 +17,7 @@ elif [[ $TRAVIS_TAG ]]; then
RC_VERSION=$TRAVIS_TAG
else
CHANNEL=edge
RC_VERSION=2.1.0
RC_VERSION=2.1.1
fi
echo "Preparing to trigger a snap release for $CHANNEL channel"

@ -1,4 +1,22 @@
# 2.1.1
`2019-10-17 · 2 🐛 · 2 👩💻👨💻`
### Engine versions
- Node: `8.15.1`
- NPM: `6.9.0`
- MongoDB: `3.4, 3.6, 4.0`
### 🐛 Bug fixes
- Read Recepts was not working ([#15603](https://github.com/RocketChat/Rocket.Chat/pull/15603))
- Dynamic import of JS files were not working correctly ([#15598](https://github.com/RocketChat/Rocket.Chat/pull/15598))
### 👩💻👨💻 Core Team 🤓
- [@ggazzo](https://github.com/ggazzo)
- [@rodrigok](https://github.com/rodrigok)
# 2.1.0
`2019-09-27 · 1 · 13 🎉 · 12 🚀 · 22 🐛 · 22 🔍 · 20 👩💻👨💻`

@ -1,3 +1,5 @@
import { Meteor } from 'meteor/meteor';
export const baseURI = (() => {
if (document.baseURI) { return document.baseURI; }
@ -12,3 +14,5 @@ export const baseURI = (() => {
// http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-baseURI
return document.URL;
})();
Meteor.absoluteUrl.defaultOptions = { ...Meteor.absoluteUrl.defaultOptions, rootUrl: baseURI };

@ -1,3 +1,3 @@
{
"version": "2.1.0"
"version": "2.1.1"
}

@ -12,9 +12,8 @@ import { Session } from 'meteor/session';
import { KonchatNotification } from '../app/ui';
import { ChatSubscription } from '../app/models';
import { roomTypes, t } from '../app/utils';
import { baseURI } from '../app/utils/client/lib/baseuri';
import { call, modal } from '../app/ui-utils';
import { roomTypes } from '../app/utils';
import { call } from '../app/ui-utils';
const getRoomById = mem((rid) => call('getRoomById', rid));
@ -213,24 +212,8 @@ FlowRouter.route('/register/:hash', {
FlowRouter.route('/setup-wizard/:step?', {
name: 'setup-wizard',
action: async () => {
const render = async () => {
const { SetupWizard } = await import('./components/setupWizard/SetupWizard');
BlazeLayout.render(await createTemplateForComponent(SetupWizard));
};
try {
await render();
} catch (_) {
Meteor.absoluteUrl.defaultOptions = { ...Meteor.absoluteUrl.defaultOptions, rootUrl: baseURI };
try {
await render();
} catch (_) {
modal.open({
title: t('Error_Site_URL'),
text: t('Error_Site_URL_description'),
confirmButtonText: t('Ok'),
});
}
}
const { SetupWizard } = await import('./components/setupWizard/SetupWizard');
BlazeLayout.render(await createTemplateForComponent(SetupWizard));
},
});

@ -1,7 +1,7 @@
{
"name": "Rocket.Chat",
"description": "The Ultimate Open Source WebChat Platform",
"version": "2.1.0",
"version": "2.1.1",
"author": {
"name": "Rocket.Chat",
"url": "https://rocket.chat/"

@ -19,9 +19,16 @@ Meteor.methods({
callbacks.run('beforeReadMessages', rid, userId);
// TODO: move this calls to an exported function
Subscriptions.setAsReadByRoomIdAndUserId(rid, userId);
const userSubscription = Subscriptions.findOneByRoomIdAndUserId(rid, userId, { fields: { ls: 1 } });
if (!userSubscription) {
throw new Meteor.Error('error-invalid-subscription', 'Invalid subscription', {
method: 'readMessages',
});
}
Subscriptions.setAsReadByRoomIdAndUserId(rid, userId);
Meteor.defer(() => {
callbacks.run('afterReadMessages', rid, { userId, lastSeen: userSubscription.ls });
});

@ -1,4 +1,5 @@
import { getCredentials, api, request, credentials } from '../../data/api-data.js';
import { createRoom } from '../../data/rooms.helper';
describe('[Subscriptions]', function() {
this.retries(0);
@ -63,11 +64,38 @@ describe('[Subscriptions]', function() {
});
describe('[/subscriptions.read]', () => {
let testChannel;
it('create a channel', (done) => {
createRoom({ type: 'c', name: `channel.test.${ Date.now() }` })
.end((err, res) => {
testChannel = res.body.channel;
done();
});
});
let testGroup;
it('create a group', (done) => {
createRoom({ type: 'p', name: `channel.test.${ Date.now() }` })
.end((err, res) => {
testGroup = res.body.group;
done();
});
});
let testDM;
it('create a DM', (done) => {
createRoom({ type: 'd', username: 'rocket.cat' })
.end((err, res) => {
testDM = res.body.room;
done();
});
});
it('should mark public channels as read', (done) => {
request.post(api('subscriptions.read'))
.set(credentials)
.send({
rid: 'foobar123-somechannel',
rid: testChannel._id,
})
.expect(200)
.expect((res) => {
@ -80,7 +108,7 @@ describe('[Subscriptions]', function() {
request.post(api('subscriptions.read'))
.set(credentials)
.send({
rid: 'foobar123-somegroup',
rid: testGroup._id,
})
.expect(200)
.expect((res) => {
@ -93,7 +121,7 @@ describe('[Subscriptions]', function() {
request.post(api('subscriptions.read'))
.set(credentials)
.send({
rid: 'foobar123-somedm',
rid: testDM._id,
})
.expect(200)
.expect((res) => {
@ -102,6 +130,48 @@ describe('[Subscriptions]', function() {
.end(done);
});
it('should fail on mark inexistent public channel as read', (done) => {
request.post(api('subscriptions.read'))
.set(credentials)
.send({
rid: 'foobar123-somechannel',
})
.expect(400)
.expect((res) => {
expect(res.body).to.have.property('success', false);
expect(res.body).to.have.property('error');
})
.end(done);
});
it('should fail on mark inexistent group as read', (done) => {
request.post(api('subscriptions.read'))
.set(credentials)
.send({
rid: 'foobar123-somegroup',
})
.expect(400)
.expect((res) => {
expect(res.body).to.have.property('success', false);
expect(res.body).to.have.property('error');
})
.end(done);
});
it('should fail on mark inexistent DM as read', (done) => {
request.post(api('subscriptions.read'))
.set(credentials)
.send({
rid: 'foobar123-somedm',
})
.expect(400)
.expect((res) => {
expect(res.body).to.have.property('success', false);
expect(res.body).to.have.property('error');
})
.end(done);
});
it('should fail on invalid params', (done) => {
request.post(api('subscriptions.read'))
.set(credentials)

Loading…
Cancel
Save