Skip to content

Commit

Permalink
chore!: e2ee mention setting update (#33419)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocostadev authored Oct 15, 2024
1 parent 204272c commit 11a47b6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-hats-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": major
---

Changes End-to-end encryption default setting to enable mention in encrypted messages
2 changes: 1 addition & 1 deletion apps/meteor/server/settings/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const createE2ESettings = () =>
enableQuery: { _id: 'E2E_Enable', value: true },
});

await this.add('E2E_Enabled_Mentions', false, {
await this.add('E2E_Enabled_Mentions', true, {
type: 'boolean',
public: true,
enableQuery: { _id: 'E2E_Enable', value: true },
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/server/startup/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ import './v307';
import './v308';
import './v309';
import './v310';
import './v311';

export * from './xrun';
21 changes: 21 additions & 0 deletions apps/meteor/server/startup/migrations/v311.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Settings } from '@rocket.chat/models';

import { addMigration } from '../../lib/migrations';

addMigration({
version: 311,
name: 'Update default behavior of E2E_Enabled_Mentions setting, to allow mentions in encrypted messages by default.',
async up() {
await Settings.updateOne(
{
_id: 'E2E_Enabled_Mentions',
},
{
$set: {
value: true,
packageValue: true,
},
},
);
},
});
2 changes: 0 additions & 2 deletions apps/meteor/tests/e2e/e2e-encryption.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,11 @@ test.describe.serial('e2e-encryption', () => {

test.beforeAll(async ({ api }) => {
expect((await api.post('/settings/E2E_Allow_Unencrypted_Messages', { value: true })).status()).toBe(200);
expect((await api.post('/settings/E2E_Enabled_Mentions', { value: true })).status()).toBe(200);
});

test.afterAll(async ({ api }) => {
expect((await api.post('/settings/E2E_Enable', { value: false })).status()).toBe(200);
expect((await api.post('/settings/E2E_Allow_Unencrypted_Messages', { value: false })).status()).toBe(200);
expect((await api.post('/settings/E2E_Enabled_Mentions', { value: false })).status()).toBe(200);
});

test('expect create a private channel encrypted and send an encrypted message', async ({ page }) => {
Expand Down

0 comments on commit 11a47b6

Please sign in to comment.