chore: legacy fixes (#2343)

This commit is contained in:
Mo
2023-07-03 08:03:25 -05:00
committed by GitHub
parent 6d5cbcb396
commit d79e7b14b1
14 changed files with 148 additions and 95 deletions

View File

@@ -30,6 +30,7 @@ import { DeinitMode } from './DeinitMode'
import { DeinitSource } from './DeinitSource'
import { UserClientInterface } from '../User/UserClientInterface'
import { SessionsClientInterface } from '../Session/SessionsClientInterface'
import { User } from '@standardnotes/responses'
export interface ApplicationInterface {
deinit(mode: DeinitMode, source: DeinitSource): void
@@ -57,6 +58,8 @@ export interface ApplicationInterface {
contentType: ContentType | ContentType[],
stream: ItemStream<I>,
): () => void
getUser(): User | undefined
hasAccount(): boolean
importData(data: BackupFile, awaitSync?: boolean): Promise<ImportDataReturnType>

View File

@@ -63,7 +63,7 @@ describe('IntegrityService', () => {
uuid: '1-2-3',
},
],
source: 5,
source: "AfterDownloadFirst",
},
type: 'IntegrityCheckCompleted',
},
@@ -90,7 +90,7 @@ describe('IntegrityService', () => {
{
payload: {
rawPayloads: [],
source: 5,
source: "AfterDownloadFirst",
},
type: 'IntegrityCheckCompleted',
},
@@ -140,7 +140,7 @@ describe('IntegrityService', () => {
{
payload: {
rawPayloads: [],
source: 5,
source: "AfterDownloadFirst",
},
type: 'IntegrityCheckCompleted',
},

View File

@@ -4,11 +4,11 @@ export enum SyncMode {
/**
* Performs a standard sync, uploading any dirty items and retrieving items.
*/
Default = 1,
Default = 'Default',
/**
* The first sync for an account, where we first want to download all remote items first
* before uploading any dirty items. This allows a consumer, for example, to download
* all data to see if user has an items key, and if not, only then create a new one.
*/
DownloadFirst = 2,
DownloadFirst = 'DownloadFirst',
}

View File

@@ -1,11 +1,12 @@
/* istanbul ignore file */
export enum SyncSource {
External = 1,
SpawnQueue = 2,
ResolveQueue = 3,
MoreDirtyItems = 4,
AfterDownloadFirst = 5,
IntegrityCheck = 6,
ResolveOutOfSync = 7,
External = 'External',
SpawnQueue = 'SpawnQueue',
ResolveQueue = 'ResolveQueue',
MoreDirtyItems = 'MoreDirtyItems',
DownloadFirst = 'DownloadFirst',
AfterDownloadFirst = 'AfterDownloadFirst',
IntegrityCheck = 'IntegrityCheck',
ResolveOutOfSync = 'ResolveOutOfSync',
}