chore: refactor notifications and re-enable vault tests (#2532)
* chore: refactor notifications and re-enable vault tests * fix message in error expected
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/models": "workspace:*",
|
||||
"@standardnotes/responses": "workspace:*",
|
||||
"@standardnotes/utils": "workspace:*",
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@electron/remote": "^2.0.9",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/electron-clear-data": "1.1.1",
|
||||
"@standardnotes/web": "workspace:*",
|
||||
"axios": "^1.1.3",
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/models": "workspace:*",
|
||||
"@standardnotes/responses": "workspace:*",
|
||||
"@standardnotes/sncrypto-common": "workspace:*",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"reflect-metadata": "^0.1.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/features": "workspace:*",
|
||||
"@standardnotes/responses": "workspace:*",
|
||||
"@standardnotes/sncrypto-common": "workspace:^",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"dependencies": {
|
||||
"@standardnotes/api": "workspace:^",
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/encryption": "workspace:^",
|
||||
"@standardnotes/features": "workspace:^",
|
||||
"@standardnotes/files": "workspace:^",
|
||||
|
||||
@@ -105,7 +105,7 @@ export class SharedVaultService
|
||||
switch (event.eventPayload.props.type.value) {
|
||||
case NotificationType.TYPES.SelfRemovedFromSharedVault: {
|
||||
const vault = this._getVault.execute<SharedVaultListingInterface>({
|
||||
sharedVaultUuid: event.eventPayload.props.sharedVaultUuid.value,
|
||||
sharedVaultUuid: event.eventPayload.props.primaryIdentifier.value,
|
||||
})
|
||||
if (!vault.isFailed()) {
|
||||
await this._deleteThirdPartyVault.execute(vault.getValue())
|
||||
@@ -113,11 +113,11 @@ export class SharedVaultService
|
||||
break
|
||||
}
|
||||
case NotificationType.TYPES.UserRemovedFromSharedVault: {
|
||||
this.vaultUsers.invalidateVaultUsersCache(event.eventPayload.props.sharedVaultUuid.value).catch(console.error)
|
||||
this.vaultUsers.invalidateVaultUsersCache(event.eventPayload.props.primaryIdentifier.value).catch(console.error)
|
||||
break
|
||||
}
|
||||
case NotificationType.TYPES.SharedVaultItemRemoved: {
|
||||
const item = this.items.findItem((event.eventPayload.props.itemUuid as Uuid).value)
|
||||
const item = this.items.findItem((event.eventPayload.props.secondaryIdentifier as Uuid).value)
|
||||
if (item) {
|
||||
void this._discardItemsLocally.execute([item])
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export class SharedVaultService
|
||||
case NotificationType.TYPES.SharedVaultFileRemoved:
|
||||
case NotificationType.TYPES.SharedVaultFileUploaded: {
|
||||
const vaultOrError = this._getVault.execute<SharedVaultListingInterface>({
|
||||
sharedVaultUuid: event.eventPayload.props.sharedVaultUuid.value,
|
||||
sharedVaultUuid: event.eventPayload.props.primaryIdentifier.value,
|
||||
})
|
||||
if (!vaultOrError.isFailed()) {
|
||||
await this._syncLocalVaultsWithRemoteSharedVaults.execute([vaultOrError.getValue()])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export const VaultTests = {
|
||||
enabled: false,
|
||||
enabled: true,
|
||||
exclusive: false,
|
||||
files: [
|
||||
'vaults/vaults.test.js',
|
||||
|
||||
@@ -59,7 +59,7 @@ describe('vault key management', function () {
|
||||
|
||||
await Factory.expectThrowsAsync(
|
||||
() => context.vaults.removeItemFromVault(item),
|
||||
'Cannot find latest version of item to get vault for',
|
||||
'Cannot find vault to remove item from',
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"@babel/preset-env": "*",
|
||||
"@standardnotes/api": "workspace:*",
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/domain-events": "^2.122.0",
|
||||
"@standardnotes/encryption": "workspace:*",
|
||||
"@standardnotes/features": "workspace:*",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/common": "^1.50.0",
|
||||
"@standardnotes/domain-core": "^1.32.0",
|
||||
"@standardnotes/domain-core": "^1.33.1",
|
||||
"@standardnotes/features": "workspace:^",
|
||||
"@standardnotes/filepicker": "workspace:^",
|
||||
"@standardnotes/models": "workspace:^",
|
||||
|
||||
Reference in New Issue
Block a user