Skip to content

Commit

Permalink
Fetch latest group data on unblock of a group
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Jun 20, 2022
1 parent 7dd9cab commit d547ef3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ts/models/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,8 @@ export class ConversationModel extends window.Backbone
if (!viaStorageServiceSync) {
this.captureChange('unblock');
}

this.fetchLatestGroupV2Data({ force: true });
}

return unblocked;
Expand Down
11 changes: 10 additions & 1 deletion ts/services/expiringMessagesDeletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit d547ef3

Please sign in to comment.