internal: incomplete vault systems behind feature flag (#2340)

This commit is contained in:
Mo
2023-06-30 09:01:56 -05:00
committed by GitHub
parent d16e401bb9
commit b032eb9c9b
638 changed files with 20321 additions and 4813 deletions

View File

@@ -1,68 +1,79 @@
import { ApplicationStage } from './../Application/ApplicationStage'
export enum ApplicationEvent {
SignedIn = 2,
SignedOut = 3,
SignedIn = 'signed-in',
SignedOut = 'signed-out',
/** When a full, potentially multi-page sync completes */
CompletedFullSync = 5,
CompletedFullSync = 'completed-full-sync',
FailedSync = 6,
HighLatencySync = 7,
EnteredOutOfSync = 8,
ExitedOutOfSync = 9,
FailedSync = 'failed-sync',
HighLatencySync = 'high-latency-sync',
EnteredOutOfSync = 'entered-out-of-sync',
ExitedOutOfSync = 'exited-out-of-sync',
ApplicationStageChanged = 'application-stage-changed',
/**
* The application has finished it `prepareForLaunch` state and is now ready for unlock
* The application has finished its prepareForLaunch state and is now ready for unlock
* Called when the application has initialized and is ready for launch, but before
* the application has been unlocked, if applicable. Use this to do pre-launch
* configuration, but do not attempt to access user data like notes or tags.
*/
Started = 10,
Started = 'started',
/**
* The applicaiton is fully unlocked and ready for i/o
* Called when the application has been fully decrypted and unlocked. Use this to
* to begin streaming data like notes and tags.
*/
Launched = 11,
LocalDataLoaded = 12,
Launched = 'launched',
LocalDataLoaded = 'local-data-loaded',
/**
* When the root key or root key wrapper changes. Includes events like account state
* changes (registering, signing in, changing pw, logging out) and passcode state
* changes (adding, removing, changing).
*/
KeyStatusChanged = 13,
KeyStatusChanged = 'key-status-changed',
MajorDataChange = 14,
CompletedRestart = 15,
LocalDataIncrementalLoad = 16,
SyncStatusChanged = 17,
WillSync = 18,
InvalidSyncSession = 19,
LocalDatabaseReadError = 20,
LocalDatabaseWriteError = 21,
MajorDataChange = 'major-data-change',
CompletedRestart = 'completed-restart',
LocalDataIncrementalLoad = 'local-data-incremental-load',
SyncStatusChanged = 'sync-status-changed',
WillSync = 'will-sync',
InvalidSyncSession = 'invalid-sync-session',
LocalDatabaseReadError = 'local-database-read-error',
LocalDatabaseWriteError = 'local-database-write-error',
/** When a single roundtrip completes with sync, in a potentially multi-page sync request.
* If just a single roundtrip, this event will be triggered, along with CompletedFullSync */
CompletedIncrementalSync = 22,
/**
* When a single roundtrip completes with sync, in a potentially multi-page sync request.
* If just a single roundtrip, this event will be triggered, along with CompletedFullSync
*/
CompletedIncrementalSync = 'completed-incremental-sync',
/**
* The application has loaded all pending migrations (but not run any, except for the base one),
* and consumers may now call `hasPendingMigrations`
* and consumers may now call hasPendingMigrations
*/
MigrationsLoaded = 23,
MigrationsLoaded = 'migrations-loaded',
/** When StorageService is ready to start servicing read/write requests */
StorageReady = 24,
/** When StorageService is ready (but NOT yet decrypted) to start servicing read/write requests */
StorageReady = 'storage-ready',
PreferencesChanged = 'preferences-changed',
UnprotectedSessionBegan = 'unprotected-session-began',
UserRolesChanged = 'user-roles-changed',
FeaturesUpdated = 'features-updated',
UnprotectedSessionExpired = 'unprotected-session-expired',
PreferencesChanged = 25,
UnprotectedSessionBegan = 26,
UserRolesChanged = 27,
FeaturesUpdated = 28,
UnprotectedSessionExpired = 29,
/** Called when the app first launches and after first sync request made after sign in */
CompletedInitialSync = 30,
BiometricsSoftLockEngaged = 31,
BiometricsSoftLockDisengaged = 32,
DidPurchaseSubscription = 33,
CompletedInitialSync = 'completed-initial-sync',
BiometricsSoftLockEngaged = 'biometrics-soft-lock-engaged',
BiometricsSoftLockDisengaged = 'biometrics-soft-lock-disengaged',
DidPurchaseSubscription = 'did-purchase-subscription',
}
export type ApplicationStageChangedEventPayload = {
stage: ApplicationStage
}

View File

@@ -1,3 +1,10 @@
import {
AsymmetricMessageServerHash,
SharedVaultInviteServerHash,
SharedVaultServerHash,
UserEventServerHash,
} from '@standardnotes/responses'
/* istanbul ignore file */
export enum SyncEvent {
/**
@@ -7,8 +14,8 @@ export enum SyncEvent {
*/
SyncCompletedWithAllItemsUploaded = 'SyncCompletedWithAllItemsUploaded',
SyncCompletedWithAllItemsUploadedAndDownloaded = 'SyncCompletedWithAllItemsUploadedAndDownloaded',
SingleRoundTripSyncCompleted = 'SingleRoundTripSyncCompleted',
SyncWillBegin = 'sync:will-begin',
PaginatedSyncRequestCompleted = 'PaginatedSyncRequestCompleted',
SyncDidBeginProcessing = 'sync:did-begin-processing',
DownloadFirstSyncCompleted = 'sync:download-first-completed',
SyncTakingTooLong = 'sync:taking-too-long',
SyncError = 'sync:error',
@@ -22,4 +29,13 @@ export enum SyncEvent {
DatabaseWriteError = 'database-write-error',
DatabaseReadError = 'database-read-error',
SyncRequestsIntegrityCheck = 'sync:requests-integrity-check',
ReceivedRemoteSharedVaults = 'received-shared-vaults',
ReceivedSharedVaultInvites = 'received-shared-vault-invites',
ReceivedUserEvents = 'received-user-events',
ReceivedAsymmetricMessages = 'received-asymmetric-messages',
}
export type SyncEventReceivedRemoteSharedVaultsData = SharedVaultServerHash[]
export type SyncEventReceivedSharedVaultInvitesData = SharedVaultInviteServerHash[]
export type SyncEventReceivedAsymmetricMessagesData = AsymmetricMessageServerHash[]
export type SyncEventReceivedUserEventsData = UserEventServerHash[]