Compare commits

..

5 Commits

Author SHA1 Message Date
standardci c22c5e4584 chore(release): publish new version
- @standardnotes/home-server@1.13.46
 - @standardnotes/syncing-server@1.78.9
2023-08-11 08:46:28 +00:00
Karol Sójko ac3646836c tmp: disable decorating with associations on revisions 2023-08-11 10:40:03 +02:00
standardci 7a31ab75d6 chore(release): publish new version
- @standardnotes/home-server@1.13.45
 - @standardnotes/syncing-server@1.78.8
2023-08-11 08:23:28 +00:00
Karol Sójko c49dc35ab5 tmp: disable shared vaults 2023-08-11 10:15:55 +02:00
Karol Sójko 06cedd11d8 tmp: ci 2023-08-11 10:15:55 +02:00
12 changed files with 36 additions and 33 deletions
+7 -7
View File
@@ -95,20 +95,20 @@ jobs:
- name: Test
run: yarn test
e2e:
needs: build
name: E2E
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
secrets: inherit
# e2e:
# needs: build
# name: E2E
# uses: standardnotes/server/.github/workflows/common-e2e.yml@main
# secrets: inherit
publish-self-hosting:
needs: [ test, lint, e2e ]
needs: [ test, lint ]
name: Publish Self Hosting Docker Image
uses: standardnotes/server/.github/workflows/common-self-hosting.yml@main
secrets: inherit
publish-services:
needs: [ test, lint, e2e ]
needs: [ test, lint ]
runs-on: ubuntu-latest
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.13.46](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.13.45...@standardnotes/home-server@1.13.46) (2023-08-11)
**Note:** Version bump only for package @standardnotes/home-server
## [1.13.45](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.13.44...@standardnotes/home-server@1.13.45) (2023-08-11)
**Note:** Version bump only for package @standardnotes/home-server
## [1.13.44](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.13.43...@standardnotes/home-server@1.13.44) (2023-08-11)
**Note:** Version bump only for package @standardnotes/home-server
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/home-server",
"version": "1.13.44",
"version": "1.13.46",
"engines": {
"node": ">=18.0.0 <21.0.0"
},
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.78.9](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.78.8...@standardnotes/syncing-server@1.78.9) (2023-08-11)
**Note:** Version bump only for package @standardnotes/syncing-server
## [1.78.8](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.78.7...@standardnotes/syncing-server@1.78.8) (2023-08-11)
**Note:** Version bump only for package @standardnotes/syncing-server
## [1.78.7](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.78.6...@standardnotes/syncing-server@1.78.7) (2023-08-11)
**Note:** Version bump only for package @standardnotes/syncing-server
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/syncing-server",
"version": "1.78.7",
"version": "1.78.9",
"engines": {
"node": ">=18.0.0 <21.0.0"
},
@@ -541,7 +541,6 @@ export class ContainerConfigLoader {
.toConstantValue(
new GetItems(
container.get(TYPES.Sync_ItemRepository),
container.get(TYPES.Sync_SharedVaultUserRepository),
container.get(TYPES.Sync_CONTENT_SIZE_TRANSFER_LIMIT),
container.get(TYPES.Sync_ItemTransferCalculator),
container.get(TYPES.Sync_Timer),
@@ -24,7 +24,7 @@ export class ItemRevisionCreationRequestedEventHandler implements DomainEventHan
}
const itemUuid = itemUuidOrError.getValue()
const item = await this.itemRepository.findByUuid(itemUuid)
const item = await this.itemRepository.findByUuid(itemUuid, true)
if (item === null) {
return
}
@@ -17,7 +17,7 @@ export interface ItemRepositoryInterface {
findDatesForComputingIntegrityHash(userUuid: string): Promise<Array<{ updated_at_timestamp: number }>>
findItemsForComputingIntegrityPayloads(userUuid: string): Promise<ExtendedIntegrityPayload[]>
findByUuidAndUserUuid(uuid: string, userUuid: string): Promise<Item | null>
findByUuid(uuid: Uuid): Promise<Item | null>
findByUuid(uuid: Uuid, noAssociations: boolean): Promise<Item | null>
remove(item: Item): Promise<void>
save(item: Item): Promise<void>
markItemsAsDeleted(itemUuids: Array<string>, updatedAtTimestamp: number): Promise<void>
@@ -16,14 +16,7 @@ describe('GetItems', () => {
let sharedVaultUserRepository: SharedVaultUserRepositoryInterface
const createUseCase = () =>
new GetItems(
itemRepository,
sharedVaultUserRepository,
contentSizeTransferLimit,
itemTransferCalculator,
timer,
maxItemsSyncLimit,
)
new GetItems(itemRepository, contentSizeTransferLimit, itemTransferCalculator, timer, maxItemsSyncLimit)
beforeEach(() => {
item = Item.create({
@@ -7,7 +7,6 @@ import { ItemQuery } from '../../../Item/ItemQuery'
import { ItemRepositoryInterface } from '../../../Item/ItemRepositoryInterface'
import { ItemTransferCalculatorInterface } from '../../../Item/ItemTransferCalculatorInterface'
import { GetItemsDTO } from './GetItemsDTO'
import { SharedVaultUserRepositoryInterface } from '../../../SharedVault/User/SharedVaultUserRepositoryInterface'
export class GetItems implements UseCaseInterface<GetItemsResult> {
private readonly DEFAULT_ITEMS_LIMIT = 150
@@ -15,7 +14,6 @@ export class GetItems implements UseCaseInterface<GetItemsResult> {
constructor(
private itemRepository: ItemRepositoryInterface,
private sharedVaultUserRepository: SharedVaultUserRepositoryInterface,
private contentSizeTransferLimit: number,
private itemTransferCalculator: ItemTransferCalculatorInterface,
private timer: TimerInterface,
@@ -39,13 +37,6 @@ export class GetItems implements UseCaseInterface<GetItemsResult> {
const limit = dto.limit === undefined || dto.limit < 1 ? this.DEFAULT_ITEMS_LIMIT : dto.limit
const upperBoundLimit = limit < this.maxItemsSyncLimit ? limit : this.maxItemsSyncLimit
const sharedVaultUsers = await this.sharedVaultUserRepository.findByUserUuid(userUuid)
const userSharedVaultUuids = sharedVaultUsers.map((sharedVaultUser) => sharedVaultUser.props.sharedVaultUuid.value)
const exclusiveSharedVaultUuids = dto.sharedVaultUuids
? dto.sharedVaultUuids.filter((sharedVaultUuid) => userSharedVaultUuids.includes(sharedVaultUuid))
: undefined
const itemQuery: ItemQuery = {
userUuid: userUuid.value,
lastSyncTime: lastSyncTime ?? undefined,
@@ -55,8 +46,8 @@ export class GetItems implements UseCaseInterface<GetItemsResult> {
sortBy: 'updated_at_timestamp',
sortOrder: 'ASC',
limit: upperBoundLimit,
includeSharedVaultUuids: !dto.sharedVaultUuids ? userSharedVaultUuids : undefined,
exclusiveSharedVaultUuids,
includeSharedVaultUuids: undefined,
exclusiveSharedVaultUuids: undefined,
}
const itemUuidsToFetch = await this.itemTransferCalculator.computeItemUuidsToFetch(
@@ -42,7 +42,7 @@ export class SaveItems implements UseCaseInterface<SaveItemsResult> {
}
const itemUuid = itemUuidOrError.getValue()
const existingItem = await this.itemRepository.findByUuid(itemUuid)
const existingItem = await this.itemRepository.findByUuid(itemUuid, false)
if (dto.readOnlyAccess) {
conflicts.push({
@@ -77,7 +77,7 @@ export class TypeORMItemRepository implements ItemRepositoryInterface {
.execute()
}
async findByUuid(uuid: Uuid): Promise<Item | null> {
async findByUuid(uuid: Uuid, noAssociations: boolean): Promise<Item | null> {
const persistence = await this.ormRepository
.createQueryBuilder('item')
.where('item.uuid = :uuid', {
@@ -92,6 +92,10 @@ export class TypeORMItemRepository implements ItemRepositoryInterface {
try {
const item = this.mapper.toDomain(persistence)
if (noAssociations) {
return item
}
await this.decorateItemWithAssociations(item)
return item