Check for conversation conflicts before writing

This commit is contained in:
Josh Perez 2021-03-11 20:56:01 -05:00 committed by Josh Perez
parent 58bdf36254
commit 0fd0fac262
5 changed files with 9 additions and 7 deletions

View File

@ -13,7 +13,7 @@ export type ConfigKeyType =
| 'desktop.mandatoryProfileSharing'
| 'desktop.messageRequests'
| 'desktop.storage'
| 'desktop.storageWrite2'
| 'desktop.storageWrite3'
| 'global.groupsv2.maxGroupSize'
| 'global.groupsv2.groupSizeHardLimit';
type ConfigValueType = {

View File

@ -4895,9 +4895,9 @@ export class ConversationModel extends window.Backbone.Model<
// [X] archived
// [X] markedUnread
captureChange(logMessage: string): void {
if (!window.Signal.RemoteConfig.isEnabled('desktop.storageWrite2')) {
if (!window.Signal.RemoteConfig.isEnabled('desktop.storageWrite3')) {
window.log.info(
'conversation.captureChange: Returning early; desktop.storageWrite2 is falsey'
'conversation.captureChange: Returning early; desktop.storageWrite3 is falsey'
);
return;

View File

@ -127,6 +127,8 @@ async function generateManifest(
isNewManifest
);
await window.ConversationController.checkForConflicts();
const ITEM_TYPE = window.textsecure.protobuf.ManifestRecord.Identifier.Type;
const conversationsToUpdate = [];

View File

@ -8,5 +8,5 @@ function isStorageFeatureEnabled(): boolean {
}
export function isStorageWriteFeatureEnabled(): boolean {
return isStorageFeatureEnabled() && isEnabled('desktop.storageWrite2');
return isStorageFeatureEnabled() && isEnabled('desktop.storageWrite3');
}

View File

@ -27,7 +27,7 @@ describe('LeftPaneComposeHelper', () => {
.stub(remoteConfig, 'isEnabled')
.withArgs('desktop.storage')
.returns(true)
.withArgs('desktop.storageWrite2')
.withArgs('desktop.storageWrite3')
.returns(true);
});
@ -143,7 +143,7 @@ describe('LeftPaneComposeHelper', () => {
remoteConfigStub
.withArgs('desktop.storage')
.returns(false)
.withArgs('desktop.storageWrite2')
.withArgs('desktop.storageWrite3')
.returns(false);
assert.isUndefined(
@ -157,7 +157,7 @@ describe('LeftPaneComposeHelper', () => {
remoteConfigStub
.withArgs('desktop.storage')
.returns(true)
.withArgs('desktop.storageWrite2')
.withArgs('desktop.storageWrite3')
.returns(false);
assert.isUndefined(