Fetch latest group data on unblock of a group

This commit is contained in:
Scott Nonnenberg 2022-06-20 11:55:34 -07:00 committed by GitHub
parent 7dd9cabbbd
commit d547ef362e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -971,6 +971,8 @@ export class ConversationModel extends window.Backbone
if (!viaStorageServiceSync) {
this.captureChange('unblock');
}
this.fetchLatestGroupV2Data({ force: true });
}
return unblocked;

View File

@ -2,8 +2,11 @@
// SPDX-License-Identifier: AGPL-3.0-only
import { debounce } from 'lodash';
import type { MessageModel } from '../models/messages';
import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary';
import { sleep } from '../util/sleep';
import { SECOND } from '../util/durations';
class ExpiringMessagesDeletionService {
public update: typeof this.checkExpiringMessages;
@ -60,9 +63,15 @@ class ExpiringMessagesDeletionService {
'destroyExpiredMessages: Error deleting expired messages',
error && error.stack ? error.stack : error
);
window.SignalContext.log.info(
'destroyExpiredMessages: Waiting 30 seconds before trying again'
);
await sleep(30 * SECOND);
}
window.SignalContext.log.info('destroyExpiredMessages: complete');
window.SignalContext.log.info(
'destroyExpiredMessages: done, scheduling another check'
);
this.update();
}