Skip to content

Commit

Permalink
fix: Missing retention's ignoreThreads param for old channels (#33028)
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Aug 17, 2024
1 parent 10fce25 commit 77defb5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-knives-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes an issue where ignore threads parameter were not being affected by retention policy overriding in old channels
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 @@ -38,5 +38,6 @@ import './v301';
import './v303';
import './v304';
import './v305';
import './v306';

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

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

addMigration({
version: 305,
name: 'Adds missing ignoreThreads parameter for old rooms with retention policy overridden',
async up() {
await Rooms.updateMany(
{
'retention.enabled': true,
'retention.overrideGlobal': true,
'retention.ignoreThreads': { $exists: false },
},
{
$set: {
'retention.ignoreThreads': false,
},
},
);
},
});

0 comments on commit 77defb5

Please sign in to comment.