@@ -2220,9 +2220,9 @@ function cleanUpOldOpengroupsOnStart() {
2220
2220
return ;
2221
2221
}
2222
2222
console . info ( `Count of v2 opengroup convos to clean: ${ v2ConvosIds . length } ` ) ;
2223
- // For each open group, if it has more than 2000 messages, we remove all the messages
2224
- // older than 6 months. So this does not limit the size of open group history to 2000
2225
- // messages but to 6 months.
2223
+ // For each open group, if it has more than 10000 messages, we remove all the messages
2224
+ // older than 12 months. So this does not limit the size of open group history to 10000
2225
+ // messages but to 12 months.
2226
2226
//
2227
2227
// This is the only way we can clean up conversations objects from users which just
2228
2228
// sent messages a while ago and with whom we never interacted. This is only for open
@@ -2233,7 +2233,7 @@ function cleanUpOldOpengroupsOnStart() {
2233
2233
// Another fix would be to not cache all the conversations in the redux store, but it
2234
2234
// ain't going to happen any time soon as it would a pretty big change of the way we
2235
2235
// do things and would break a lot of the app.
2236
- const maxMessagePerOpengroupConvo = 2000 ;
2236
+ const maxMessagePerOpengroupConvo = 10000 ;
2237
2237
2238
2238
// first remove very old messages for each opengroups
2239
2239
const db = assertGlobalInstance ( ) ;
@@ -2244,7 +2244,8 @@ function cleanUpOldOpengroupsOnStart() {
2244
2244
if ( messagesInConvoBefore >= maxMessagePerOpengroupConvo ) {
2245
2245
const minute = 1000 * 60 ;
2246
2246
const sixMonths = minute * 60 * 24 * 30 * 6 ;
2247
- const limitTimestamp = Date . now ( ) - sixMonths ;
2247
+ const twelveMonths = sixMonths * 2 ;
2248
+ const limitTimestamp = Date . now ( ) - twelveMonths ;
2248
2249
const countToRemove = assertGlobalInstance ( )
2249
2250
. prepare (
2250
2251
`SELECT count(*) from ${ MESSAGES_TABLE } WHERE serverTimestamp <= $serverTimestamp AND conversationId = $conversationId;`
0 commit comments