chore: display shared vault file usage (#2399)

* chore: display shared vault file usage

* fix: specs

* fix: reshape filtering result

* fix: resolving invalid server items

* fix: get revisions specs

* fix: processing issue

* fix: tests

---------

Co-authored-by: Mo <mo@standardnotes.com>
This commit is contained in:
Karol Sójko
2023-08-11 08:59:16 +02:00
committed by GitHub
parent 05f3672526
commit 5bca53736b
87 changed files with 505 additions and 169 deletions

View File

@@ -1,4 +1,3 @@
import FakeWebCrypto from './fake_web_crypto.js'
import { AppContext } from './AppContext.js'
import { VaultsContext } from './VaultsContext.js'
@@ -303,8 +302,10 @@ export function tomorrow() {
return new Date(new Date().setDate(new Date().getDate() + 1))
}
export async function sleep(seconds, reason) {
console.log('[Factory] Sleeping for reason', reason)
export async function sleep(seconds, reason, dontLog = false) {
if (!dontLog) {
console.log('[Factory] Sleeping for reason', reason)
}
return Utils.sleep(seconds)
}

View File

@@ -74,7 +74,7 @@ describe('payload', () => {
content_type: ContentType.TYPES.Note,
content: '000:somebase64string',
}),
'Unrecognized protocol version 000',
'EncryptedPayload constructor versionResult is failed',
)
})

View File

@@ -113,7 +113,7 @@ describe('online syncing', function () {
for (let i = 0; i < syncCount; i++) {
application.sync.sync(syncOptions)
await Factory.sleep(0.01)
await Factory.sleep(0.01, undefined, true)
}
await promise
expect(promise).to.be.fulfilled
@@ -958,6 +958,11 @@ describe('online syncing', function () {
},
})
context.anticipateConsoleError(
'Error decrypting payload',
'The encrypted payload above is not a valid encrypted payload.',
)
await application.sync.handleSuccessServerResponse({ payloadsSavedOrSaving: [], options: {} }, response)
expect(application.payloads.findOne(invalidPayload.uuid)).to.not.be.ok