Reinitialize redux after importing a backup

This commit is contained in:
Scott Nonnenberg 2024-08-27 00:26:21 +10:00 committed by GitHub
parent 19e0eb4444
commit abdef4847a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 437 additions and 264 deletions

View file

@ -14,7 +14,6 @@ import { DataWriter } from '../../sql/Client';
import { type AciString, generateAci } from '../../types/ServiceId';
import { ReadStatus } from '../../messages/MessageReadStatus';
import { SeenStatus } from '../../MessageSeenStatus';
import { loadCallsHistory } from '../../services/callHistoryLoader';
import { setupBasics, asymmetricRoundtripHarness } from './helpers';
import {
AUDIO_MP3,
@ -31,6 +30,7 @@ import { isVoiceMessage, type AttachmentType } from '../../types/Attachment';
import { strictAssert } from '../../util/assert';
import { SignalService } from '../../protobuf';
import { getRandomBytes } from '../../Crypto';
import { loadAll } from '../../services/allLoaders';
const CONTACT_A = generateAci();
@ -51,7 +51,7 @@ describe('backup/attachments', () => {
{ systemGivenName: 'CONTACT_A' }
);
await loadCallsHistory();
await loadAll();
sandbox = sinon.createSandbox();
const getAbsoluteAttachmentPath = sandbox.stub(

View file

@ -12,7 +12,6 @@ import type { MessageAttributesType } from '../../model-types';
import type { GroupV2ChangeType } from '../../groups';
import { getRandomBytes } from '../../Crypto';
import * as Bytes from '../../Bytes';
import { loadCallsHistory } from '../../services/callHistoryLoader';
import { strictAssert } from '../../util/assert';
import { DurationInSeconds } from '../../util/durations';
import {
@ -24,6 +23,7 @@ import {
} from './helpers';
import { ReadStatus } from '../../messages/MessageReadStatus';
import { SeenStatus } from '../../MessageSeenStatus';
import { loadAll } from '../../services/allLoaders';
// Note: this should be kept up to date with GroupV2Change.stories.tsx, to
// maintain the comprehensive set of GroupV2 notifications we need to handle
@ -114,7 +114,7 @@ describe('backup/groupv2/notifications', () => {
name: 'Rock Enthusiasts',
});
await loadCallsHistory();
await loadAll();
});
afterEach(async () => {
await DataWriter.removeAll();

View file

@ -13,7 +13,6 @@ import * as Bytes from '../../Bytes';
import { generateAci } from '../../types/ServiceId';
import { ReadStatus } from '../../messages/MessageReadStatus';
import { SeenStatus } from '../../MessageSeenStatus';
import { loadCallsHistory } from '../../services/callHistoryLoader';
import { ID_V1_LENGTH } from '../../groups';
import { DurationInSeconds, WEEK } from '../../util/durations';
import {
@ -22,6 +21,7 @@ import {
symmetricRoundtripHarness,
OUR_ACI,
} from './helpers';
import { loadAll } from '../../services/allLoaders';
const CONTACT_A = generateAci();
const CONTACT_B = generateAci();
@ -67,7 +67,7 @@ describe('backup/bubble messages', () => {
}
);
await loadCallsHistory();
await loadAll();
});
it('roundtrips incoming edited message', async () => {

View file

@ -14,7 +14,6 @@ import * as Bytes from '../../Bytes';
import { getRandomBytes } from '../../Crypto';
import { DataReader, DataWriter } from '../../sql/Client';
import { generateAci } from '../../types/ServiceId';
import { loadCallsHistory } from '../../services/callHistoryLoader';
import { setupBasics, symmetricRoundtripHarness } from './helpers';
import {
AdhocCallStatus,
@ -30,6 +29,7 @@ import { fromAdminKeyBytes } from '../../util/callLinks';
import { ReadStatus } from '../../messages/MessageReadStatus';
import { SeenStatus } from '../../MessageSeenStatus';
import { deriveGroupID, deriveGroupSecretParams } from '../../util/zkgroup';
import { loadAll } from '../../services/allLoaders';
const CONTACT_A = generateAci();
const GROUP_MASTER_KEY = getRandomBytes(32);
@ -78,7 +78,7 @@ describe('backup/calling', () => {
await DataWriter.insertCallLink(callLink);
await loadCallsHistory();
await loadAll();
});
after(async () => {
await DataWriter.removeAll();
@ -99,7 +99,7 @@ describe('backup/calling', () => {
timestamp: now,
};
await DataWriter.saveCallHistory(callHistory);
await loadCallsHistory();
await loadAll();
const messageUnseen: MessageAttributesType = {
id: generateGuid(),
@ -146,7 +146,7 @@ describe('backup/calling', () => {
timestamp: now,
};
await DataWriter.saveCallHistory(callHistory);
await loadCallsHistory();
await loadAll();
const messageUnseen: MessageAttributesType = {
id: generateGuid(),
@ -231,7 +231,7 @@ describe('backup/calling', () => {
timestamp: now,
};
await DataWriter.saveCallHistory(callHistory);
await loadCallsHistory();
await loadAll();
await symmetricRoundtripHarness([]);
@ -255,7 +255,7 @@ describe('backup/calling', () => {
timestamp: now,
};
await DataWriter.saveCallHistory(callHistory);
await loadCallsHistory();
await loadAll();
await symmetricRoundtripHarness([]);

View file

@ -18,13 +18,13 @@ import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseE
import { DurationInSeconds } from '../../util/durations';
import { ReadStatus } from '../../messages/MessageReadStatus';
import { SeenStatus } from '../../MessageSeenStatus';
import { loadCallsHistory } from '../../services/callHistoryLoader';
import {
setupBasics,
asymmetricRoundtripHarness,
symmetricRoundtripHarness,
OUR_ACI,
} from './helpers';
import { loadAll } from '../../services/allLoaders';
const CONTACT_A = generateAci();
const GROUP_ID = Bytes.toBase64(getRandomBytes(32));
@ -56,7 +56,7 @@ describe('backup/non-bubble messages', () => {
}
);
await loadCallsHistory();
await loadAll();
});
it('roundtrips END_SESSION simple update', async () => {