chore: refetch subscription when prefs menu opens (#2360)
This commit is contained in:
@@ -66,15 +66,13 @@ import {
|
||||
HttpErrorResponse,
|
||||
HttpSuccessResponse,
|
||||
isErrorResponse,
|
||||
ValetTokenOperation,
|
||||
MoveFileResponse,
|
||||
ValetTokenOperation,
|
||||
} from '@standardnotes/responses'
|
||||
import { LegacySession, MapperInterface, Session, SessionToken } from '@standardnotes/domain-core'
|
||||
import { HttpServiceInterface } from '@standardnotes/api'
|
||||
import { SNRootKeyParams } from '@standardnotes/encryption'
|
||||
|
||||
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
|
||||
|
||||
import { isUrlFirstParty, TRUSTED_FEATURE_HOSTS } from '@Lib/Hosts'
|
||||
import { Paths } from './Paths'
|
||||
import { DiskStorageService } from '../Storage/DiskStorageService'
|
||||
|
||||
@@ -11,7 +11,7 @@ jest.mock('@standardnotes/features', () => ({
|
||||
}))
|
||||
|
||||
import { FindNativeFeature } from '@standardnotes/features'
|
||||
import { Subscription } from '@standardnotes/security'
|
||||
import { Subscription } from '@standardnotes/responses'
|
||||
|
||||
describe('GetFeatureStatusUseCase', () => {
|
||||
let items: jest.Mocked<ItemManagerInterface>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AnyFeatureDescription, FeatureIdentifier, FindNativeFeature } from '@standardnotes/features'
|
||||
import { DecryptedItemInterface } from '@standardnotes/models'
|
||||
import { Subscription } from '@standardnotes/security'
|
||||
import { Subscription } from '@standardnotes/responses'
|
||||
import { FeatureStatus, ItemManagerInterface } from '@standardnotes/services'
|
||||
import { convertTimestampToMilliseconds } from '@standardnotes/utils'
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ describe('files', function () {
|
||||
await setup({ fakeCrypto: true, subscription: true })
|
||||
|
||||
const remoteIdentifier = Utils.generateUuid()
|
||||
const token = await application.apiService.createUserFileValetToken(remoteIdentifier, 'write')
|
||||
const token = await application.apiService.createUserFileValetToken(remoteIdentifier, ValetTokenOperation.Write)
|
||||
|
||||
expect(token.length).to.be.above(0)
|
||||
})
|
||||
@@ -60,7 +60,10 @@ describe('files', function () {
|
||||
await setup({ fakeCrypto: true, subscription: false })
|
||||
|
||||
const remoteIdentifier = Utils.generateUuid()
|
||||
const tokenOrError = await application.apiService.createUserFileValetToken(remoteIdentifier, 'write')
|
||||
const tokenOrError = await application.apiService.createUserFileValetToken(
|
||||
remoteIdentifier,
|
||||
ValetTokenOperation.Write,
|
||||
)
|
||||
|
||||
expect(isClientDisplayableError(tokenOrError)).to.equal(true)
|
||||
})
|
||||
@@ -76,7 +79,10 @@ describe('files', function () {
|
||||
})
|
||||
|
||||
const remoteIdentifier = Utils.generateUuid()
|
||||
const tokenOrError = await application.apiService.createUserFileValetToken(remoteIdentifier, 'write')
|
||||
const tokenOrError = await application.apiService.createUserFileValetToken(
|
||||
remoteIdentifier,
|
||||
ValetTokenOperation.Write,
|
||||
)
|
||||
|
||||
expect(isClientDisplayableError(tokenOrError)).to.equal(true)
|
||||
})
|
||||
@@ -84,12 +90,18 @@ describe('files', function () {
|
||||
it('creating two upload sessions successively should succeed', async function () {
|
||||
await setup({ fakeCrypto: true, subscription: true })
|
||||
|
||||
const firstToken = await application.apiService.createUserFileValetToken(Utils.generateUuid(), 'write')
|
||||
const firstToken = await application.apiService.createUserFileValetToken(
|
||||
Utils.generateUuid(),
|
||||
ValetTokenOperation.Write,
|
||||
)
|
||||
const firstSession = await application.apiService.startUploadSession(firstToken, 'user')
|
||||
|
||||
expect(firstSession.uploadId).to.be.ok
|
||||
|
||||
const secondToken = await application.apiService.createUserFileValetToken(Utils.generateUuid(), 'write')
|
||||
const secondToken = await application.apiService.createUserFileValetToken(
|
||||
Utils.generateUuid(),
|
||||
ValetTokenOperation.Write,
|
||||
)
|
||||
const secondSession = await application.apiService.startUploadSession(secondToken, 'user')
|
||||
|
||||
expect(secondSession.uploadId).to.be.ok
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
"@standardnotes/files": "workspace:*",
|
||||
"@standardnotes/models": "workspace:*",
|
||||
"@standardnotes/responses": "workspace:*",
|
||||
"@standardnotes/security": "^1.7.6",
|
||||
"@standardnotes/services": "workspace:*",
|
||||
"@standardnotes/settings": "^1.20.0",
|
||||
"@standardnotes/sncrypto-common": "workspace:*",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const CircularDependencyPlugin = require('circular-dependency-plugin');
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const CircularDependencyPlugin = require('circular-dependency-plugin')
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
@@ -57,4 +57,4 @@ module.exports = {
|
||||
cwd: process.cwd(),
|
||||
}),
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user