Compare commits

...
Author SHA1 Message Date
StandardNotes CI 9ca0604352 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
2023-06-27 17:09:34 +00:00
Aman Harwara d3378a704a refactor: fix conflicts view when conflicted copies are already in trash (#2339) 2023-06-27 22:08:46 +05:30
StandardNotes CI f858f31492 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
2023-06-26 15:24:21 +00:00
Aman Harwara dffeb7e710 chore: fix signin menu closing on incorrect mfa 2023-06-26 19:56:00 +05:30
Aman Harwara c378288d6e chore: fix ios height issue 2023-06-26 19:37:49 +05:30
StandardNotes CI 65a09b77d3 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2023-06-26 11:19:38 +00:00
Aman Harwara 24d159f6d8 chore: remove unused code 2023-06-26 16:20:03 +05:30
Aman Harwara 59fbf6f4c3 refactor: readonly note content 2023-06-26 16:12:35 +05:30
StandardNotes CI 28a52cb998 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2023-06-26 10:12:21 +00:00
Mo 7f5041c4a8 chore: check for external request 2023-06-26 04:40:46 -05:00
StandardNotes CI 4b93dc35a8 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2023-06-25 20:42:27 +00:00
Mo bb804fff45 fix: fixes issue where a renewed session would in some cases would not save to disk, causing a reauthentication prompt to occur 2023-06-25 15:12:22 -05:00
46 changed files with 414 additions and 204 deletions
+14
View File
@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.26.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/api
## [1.26.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/api
## [1.26.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
### Bug Fixes
* fixes issue where a renewed session would in some cases would not save to disk, causing a reauthentication prompt to occur ([bb804ff](https://github.com/standardnotes/app/commit/bb804fff45328eef3c66ec3a48dc000c21e37020))
## [1.26.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/api
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.26.13",
"version": "1.26.16",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+8 -7
View File
@@ -99,7 +99,12 @@ export class HttpService implements HttpServiceInterface {
}
async runHttp<T>(httpRequest: HttpRequest): Promise<HttpResponse<T>> {
if (this.inProgressRefreshSessionPromise) {
if (this.__latencySimulatorMs) {
await sleep(this.__latencySimulatorMs, true)
}
const isRefreshRequest = httpRequest.url === joinPaths(this.host, Paths.v1.refreshSession)
if (this.inProgressRefreshSessionPromise && !isRefreshRequest) {
await this.inProgressRefreshSessionPromise
httpRequest.authentication = this.session?.accessToken.value
@@ -107,17 +112,13 @@ export class HttpService implements HttpServiceInterface {
const request = this.createXmlRequest(httpRequest)
if (this.__latencySimulatorMs) {
await sleep(this.__latencySimulatorMs, true)
}
const response = await this.runRequest<T>(request, this.createRequestBody(httpRequest))
if (response.meta) {
if (response.meta && !httpRequest.external) {
this.updateMetaCallback?.(response.meta)
}
if (response.status === HttpStatusCode.ExpiredAccessToken) {
if (response.status === HttpStatusCode.ExpiredAccessToken && !isRefreshRequest && !httpRequest.external) {
if (this.inProgressRefreshSessionPromise) {
await this.inProgressRefreshSessionPromise
} else {
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.55](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.54](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.53](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.52](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.51](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.50](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/clipper
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/clipper",
"description": "Web clipper browser extension for Standard Notes",
"version": "1.1.50",
"version": "1.1.55",
"private": true,
"scripts": {
"build-mv2": "yarn clean && webpack --config ./webpack.config.prod.js",
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.106.64](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/desktop
## [3.106.63](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/desktop
## [3.106.62](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/desktop
## [3.106.61](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/desktop
## [3.106.60](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/desktop
## [3.106.59](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/desktop
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.106.59",
"version": "3.106.64",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.21.42](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.41](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/encryption
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.21.41",
"version": "1.21.42",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.28.51](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.50](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/filepicker
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.28.50",
"version": "1.28.51",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.15.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/files
## [1.15.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/files
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.15.12",
"version": "1.15.13",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.53.64](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/mobile
## [3.53.63](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/mobile
## [3.53.62](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/mobile
## [3.53.61](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/mobile
## [3.53.60](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/mobile
## [3.53.59](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.53.59",
"version": "3.53.64",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.46.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/models
## [1.46.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/models
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.46.2",
"version": "1.46.3",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -17,6 +17,7 @@ export * from './Interfaces/DeletedItem'
export * from './Interfaces/EncryptedItem'
export * from './Interfaces/ItemInterface'
export * from './Interfaces/TypeCheck'
export * from './Interfaces/UnionTypes'
export * from './Mutator/DecryptedItemMutator'
export * from './Mutator/DeleteMutator'
export * from './Mutator/ItemMutator'
@@ -185,10 +185,13 @@ export abstract class Collection<
if (this.isDecryptedElement(element)) {
const conflictOf = element.content.conflict_of
if (conflictOf) {
if (conflictOf && !element.content.trashed) {
this.conflictMap.establishRelationship(conflictOf, element.uuid)
}
const isConflictOfButTrashed = conflictOf && element.content.trashed
const isInConflictMapButIsNotConflictOf =
!conflictOf && this.conflictMap.getInverseRelationships(element.uuid).length > 0
@@ -196,7 +199,7 @@ export abstract class Collection<
this.conflictMap.existsInDirectMap(element.uuid) &&
this.conflictMap.getDirectRelationships(element.uuid).length === 0
if (isInConflictMapButIsNotConflictOf || isInConflictMapButDoesNotHaveConflicts) {
if (isInConflictMapButIsNotConflictOf || isInConflictMapButDoesNotHaveConflicts || isConflictOfButTrashed) {
this.conflictMap.removeFromMap(element.uuid)
}
@@ -6,12 +6,13 @@ import { ItemCollection } from './ItemCollection'
import { FillItemContent, ItemContent } from '../../../Abstract/Content/ItemContent'
describe('item collection', () => {
const createDecryptedPayload = (uuid?: string): DecryptedPayload => {
const createDecryptedPayload = (uuid?: string, content?: Partial<NoteContent>): DecryptedPayload => {
return new DecryptedPayload({
uuid: uuid || String(Math.random()),
content_type: ContentType.Note,
content: FillItemContent<NoteContent>({
title: 'foo',
...content,
}),
...PayloadTimestampDefaults(),
})
@@ -33,4 +34,81 @@ describe('item collection', () => {
expect(collection.all()).toHaveLength(1)
})
it('should not add conflicted copy to conflictMap if trashed', () => {
const collection = new ItemCollection()
const mainItem = new DecryptedItem(createDecryptedPayload())
const nonTrashedConflictedItem = new DecryptedItem(
createDecryptedPayload(undefined, {
conflict_of: mainItem.uuid,
}),
)
const trashedConflictedItem = new DecryptedItem(
createDecryptedPayload(undefined, {
conflict_of: mainItem.uuid,
trashed: true,
}),
)
collection.set([mainItem, nonTrashedConflictedItem, trashedConflictedItem])
expect(collection.conflictMap.existsInDirectMap(mainItem.uuid)).toBe(true)
expect(collection.conflictMap.getDirectRelationships(mainItem.uuid).includes(nonTrashedConflictedItem.uuid)).toBe(
true,
)
expect(collection.conflictMap.getDirectRelationships(mainItem.uuid).includes(trashedConflictedItem.uuid)).toBe(
false,
)
})
it('should remove conflicted copy from conflictMap if not conflicted anymore', () => {
const collection = new ItemCollection()
const mainItem = new DecryptedItem(createDecryptedPayload())
const conflictedItem = new DecryptedItem(
createDecryptedPayload(undefined, {
conflict_of: mainItem.uuid,
}),
)
collection.set([mainItem, conflictedItem])
expect(collection.conflictMap.existsInInverseMap(conflictedItem.uuid)).toBe(true)
const updatedConflictedItem = new DecryptedItem(
conflictedItem.payload.copy({
content: { conflict_of: undefined } as unknown as jest.Mocked<ItemContent>,
}),
)
collection.set(updatedConflictedItem)
expect(collection.conflictMap.existsInInverseMap(conflictedItem.uuid)).toBe(false)
})
it('should remove conflict parent if it has no conflicts anymore', () => {
const collection = new ItemCollection()
const mainItem = new DecryptedItem(createDecryptedPayload())
const conflictedItem = new DecryptedItem(
createDecryptedPayload(undefined, {
conflict_of: mainItem.uuid,
}),
)
collection.set([mainItem, conflictedItem])
expect(collection.conflictMap.existsInDirectMap(mainItem.uuid)).toBe(true)
const updatedConflictedItem = new DecryptedItem(
conflictedItem.payload.copy({
content: { conflict_of: undefined } as unknown as jest.Mocked<ItemContent>,
}),
)
collection.set([updatedConflictedItem, mainItem])
expect(collection.conflictMap.existsInDirectMap(mainItem.uuid)).toBe(false)
})
})
@@ -6,6 +6,7 @@ import { ItemWithTags } from './Search/ItemWithTags'
import { itemMatchesQuery, itemPassesFilters } from './Search/SearchUtilities'
import { ItemFilter, ReferenceLookupCollection, SearchableDecryptedItem } from './Search/Types'
import { FilterDisplayOptions } from './DisplayOptions'
import { SystemViewId } from '../../Syncable/SmartView'
export function computeUnifiedFilterForDisplayOptions(
options: FilterDisplayOptions,
@@ -75,7 +76,10 @@ export function computeFiltersForDisplayOptions(
filters.push((item) => itemMatchesQuery(item, query, collection))
}
if (!viewsPredicate?.keypathIncludesString('conflict_of')) {
if (
!viewsPredicate?.keypathIncludesString('conflict_of') &&
!options.views?.some((v) => v.uuid === SystemViewId.TrashedNotes)
) {
filters.push((item) => !item.conflictOf)
}
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.4.332](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.331](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.330](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.329](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.328](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.327](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.327",
"version": "1.4.332",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.60.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/services
## [1.60.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/services
## [1.60.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/services
## [1.60.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.60.2",
"version": "1.60.5",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -18,6 +18,7 @@ import {
ItemsKeyInterface,
ItemContent,
DecryptedPayload,
AnyItemInterface,
} from '@standardnotes/models'
export interface ItemsClientInterface {
@@ -168,5 +169,6 @@ export interface ItemsClientInterface {
iconString?: string,
): Promise<SmartView>
conflictsOf(uuid: string): AnyItemInterface[]
numberOfNotesWithConflicts(): number
}
+14
View File
@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.169.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/snjs
## [2.169.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/snjs
## [2.169.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
### Bug Fixes
* fixes issue where a renewed session would in some cases would not save to disk, causing a reauthentication prompt to occur ([bb804ff](https://github.com/standardnotes/app/commit/bb804fff45328eef3c66ec3a48dc000c21e37020))
## [2.169.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/snjs
@@ -1415,7 +1415,11 @@ export class ItemManager
})
}
numberOfNotesWithConflicts(): number {
public conflictsOf(uuid: string) {
return this.collection.conflictsOf(uuid)
}
public numberOfNotesWithConflicts(): number {
return this.collection.numberOfItemsWithConflicts()
}
}
+22
View File
@@ -105,6 +105,28 @@ describe('server session', function () {
expect(sessionAfterSync.accessToken.expiresAt).to.be.greaterThan(Date.now())
})
it('should not deadlock while renewing session', async function () {
this.timeout(Factory.TwentySecondTimeout)
await Factory.registerUserToApplication({
application: this.application,
email: this.email,
password: this.password,
})
await sleepUntilSessionExpires(this.application)
// Apply a latency simulation so that ` this.inProgressRefreshSessionPromise = this.refreshSession()` does
// not have the chance to complete before it is assigned to the variable. This test came along with a fix
// where runHttp does not await a pending refreshSession promise if the request being made is itself a refreshSession request.
this.application.httpService.__latencySimulatorMs = 1000
await this.application.sync.sync(syncOptions)
const sessionAfterSync = this.application.apiService.getSession()
expect(sessionAfterSync.accessToken.expiresAt).to.be.greaterThan(Date.now())
})
it('should succeed when a sync request is perfomed after signing into an ephemeral session', async function () {
await Factory.registerUserToApplication({
application: this.application,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.169.2",
"version": "2.169.5",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.26.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.26.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.26.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.26.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/ui-services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.26.17",
"version": "1.26.20",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.162.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)
**Note:** Version bump only for package @standardnotes/web
## [3.162.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/web
## [3.162.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/web
## [3.162.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)
**Note:** Version bump only for package @standardnotes/web
## [3.162.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/web
## [3.162.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)
**Note:** Version bump only for package @standardnotes/web
+55
View File
@@ -1,5 +1,60 @@
{
"versions": [
{
"version": "3.162.7",
"title": "[3.162.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-27)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.162.6",
"title": "[3.162.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.162.5",
"title": "[3.162.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.162.4",
"title": "[3.162.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-26)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.162.3",
"title": "[3.162.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.162.2",
"title": "[3.162.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-06-25)",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.162.2",
"version": "3.162.7",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes",
@@ -236,7 +236,6 @@ const ApplicationView: FunctionComponent<Props> = ({ application, mainApplicatio
<RevisionHistoryModal
application={application}
historyModalController={viewControllerManager.historyModalController}
notesController={viewControllerManager.notesController}
selectionController={viewControllerManager.selectionController}
subscriptionController={viewControllerManager.subscriptionController}
/>
@@ -24,7 +24,7 @@ import Spinner from '../../Spinner/Spinner'
import Switch from '../../Switch/Switch'
import StyledTooltip from '../../StyledTooltip/StyledTooltip'
import { DiffView } from './DiffView'
import { NoteContent } from './NoteContent'
import { ReadonlyNoteContent } from '../ReadonlyNoteContent'
import { ConflictListItem } from './ConflictListItem'
type ConflictAction = 'move-to-trash' | 'delete-permanently'
@@ -315,8 +315,9 @@ const NoteConflictResolutionModal = ({
style={!isMobileScreen ? { gridTemplateColumns: `repeat(${selectedNotes.length}, 1fr)` } : undefined}
>
{selectedNotes.map((note) => (
<NoteContent
<ReadonlyNoteContent
note={note}
content={note.content}
key={note.uuid}
scrollPos={comparisonScrollPos}
shouldSyncScroll={shouldSyncComparisonScroll}
@@ -432,36 +432,11 @@ class NoteView extends AbstractComponent<NoteViewProps, State> {
this.debounceReloadEditorComponent()
})
this.removeNoteStreamObserver = this.application.streamItems<SNNote>(
ContentType.Note,
async ({ inserted, changed, removed }) => {
const insertedOrChanged = inserted.concat(changed)
for (const note of insertedOrChanged) {
if (note.conflictOf === this.note.uuid && !note.trashed) {
this.setState((state) => ({
conflictedNotes: state.conflictedNotes
.filter((conflictedNote) => conflictedNote.uuid !== note.uuid)
.concat([note]),
}))
} else {
this.setState((state) => {
return {
conflictedNotes: state.conflictedNotes.filter((conflictedNote) => conflictedNote.uuid !== note.uuid),
}
})
}
}
for (const note of removed) {
this.setState((state) => {
return {
conflictedNotes: state.conflictedNotes.filter((conflictedNote) => conflictedNote.uuid !== note.uuid),
}
})
}
},
)
this.removeNoteStreamObserver = this.application.streamItems<SNNote>(ContentType.Note, async () => {
this.setState({
conflictedNotes: this.application.items.conflictsOf(this.note.uuid) as SNNote[],
})
})
}
private createComponentViewer(component: SNComponent) {
@@ -1,24 +1,28 @@
import { ContentType, NoteType, SNNote } from '@standardnotes/snjs'
import { ContentType, NoteContent, NoteType, SNNote, classNames } from '@standardnotes/snjs'
import { UIEventHandler, useEffect, useMemo, useRef } from 'react'
import { MutuallyExclusiveMediaQueryBreakpoints, useMediaQuery } from '@/Hooks/useMediaQuery'
import { useApplication } from '../../ApplicationProvider'
import ComponentView from '../../ComponentView/ComponentView'
import { useApplication } from '../ApplicationProvider'
import ComponentView from '../ComponentView/ComponentView'
import { ErrorBoundary } from '@/Utils/ErrorBoundary'
import { BlocksEditor } from '../../SuperEditor/BlocksEditor'
import { BlocksEditorComposer } from '../../SuperEditor/BlocksEditorComposer'
import { BlocksEditor } from '../SuperEditor/BlocksEditor'
import { BlocksEditorComposer } from '../SuperEditor/BlocksEditorComposer'
import { useLinkingController } from '@/Controllers/LinkingControllerProvider'
import LinkedItemBubblesContainer from '../../LinkedItems/LinkedItemBubblesContainer'
import LinkedItemBubblesContainer from '../LinkedItems/LinkedItemBubblesContainer'
export const NoteContent = ({
export const ReadonlyNoteContent = ({
note,
content,
showLinkedItems = true,
scrollPos,
shouldSyncScroll,
onScroll,
}: {
note: SNNote
scrollPos: number
shouldSyncScroll: boolean
onScroll: UIEventHandler
content: NoteContent
showLinkedItems?: boolean
scrollPos?: number
shouldSyncScroll?: boolean
onScroll?: UIEventHandler
}) => {
const application = useApplication()
const linkingController = useLinkingController()
@@ -73,28 +77,30 @@ export const NoteContent = ({
return (
<div className="flex h-full flex-grow flex-col overflow-hidden" ref={containerRef}>
<div className="w-full px-4 pt-4 text-base font-bold">
<div className="title">{note.title}</div>
<div className={classNames('w-full px-4 pt-4 text-base font-bold', componentViewer && 'pb-4')}>
<div className="title">{content.title}</div>
</div>
<LinkedItemBubblesContainer
item={note}
linkingController={linkingController}
readonly
className={{ base: 'mt-2 px-4', withToggle: '!mt-1 !pt-0' }}
isCollapsedByDefault={isMobileScreen}
/>
{showLinkedItems && (
<LinkedItemBubblesContainer
item={note}
linkingController={linkingController}
readonly
className={{ base: 'mt-2 px-4', withToggle: '!mt-1 !pt-0' }}
isCollapsedByDefault={isMobileScreen}
/>
)}
{componentViewer ? (
<div className="component-view">
<ComponentView key={componentViewer.identifier} componentViewer={componentViewer} application={application} />
</div>
) : note?.noteType === NoteType.Super ? (
) : content.noteType === NoteType.Super ? (
<ErrorBoundary>
<div className="w-full flex-grow overflow-hidden overflow-y-auto">
<BlocksEditorComposer readonly initialValue={note.text}>
<BlocksEditorComposer readonly initialValue={content.text}>
<BlocksEditor
readonly
className="blocks-editor relative h-full resize-none p-4 text-base focus:shadow-none focus:outline-none"
spellcheck={note.spellcheck}
spellcheck={content.spellcheck}
onScroll={onScroll}
></BlocksEditor>
</BlocksEditorComposer>
@@ -102,11 +108,11 @@ export const NoteContent = ({
</ErrorBoundary>
) : (
<div className="relative mt-3 min-h-0 flex-grow overflow-hidden">
{note.text.length ? (
{content.text.length ? (
<textarea
readOnly={true}
className="font-editor h-full w-full resize-none border-0 bg-default p-4 pt-0 text-editor text-text"
value={note.text}
value={content.text}
onScroll={onScroll}
/>
) : (
@@ -25,8 +25,8 @@ export const usePopoverCloseOnClickOutside = ({
const isAnchorElement = anchorElement ? anchorElement === event.target || anchorElement.contains(target) : false
const closestPopoverId = target.closest('[data-popover]')?.getAttribute('data-popover')
const isDescendantOfChildPopover = closestPopoverId && childPopovers.has(closestPopoverId)
const isPopoverInModal = popoverElement?.closest('[data-dialog]')
const isDescendantOfModal = isPopoverInModal ? false : !!target.closest('[data-dialog]')
const isPopoverInModal = popoverElement?.closest('[data-dialog], .sk-modal')
const isDescendantOfModal = isPopoverInModal ? false : !!target.closest('[data-dialog], .sk-modal')
if (
!isDescendantOfMenu &&
@@ -1,26 +1,19 @@
import RevisionContentLocked from './RevisionContentLocked'
import SelectedRevisionContent from './SelectedRevisionContent'
import { observer } from 'mobx-react-lite'
import { WebApplication } from '@/Application/WebApplication'
import { NotesController } from '@/Controllers/NotesController/NotesController'
import { SubscriptionController } from '@/Controllers/Subscription/SubscriptionController'
import { NoteHistoryController, RevisionContentState } from '@/Controllers/NoteHistory/NoteHistoryController'
import Spinner from '@/Components/Spinner/Spinner'
import { ReadonlyNoteContent } from '../NoteView/ReadonlyNoteContent'
import { SNNote } from '@standardnotes/snjs'
type Props = {
application: WebApplication
noteHistoryController: NoteHistoryController
notesController: NotesController
note: SNNote
subscriptionController: SubscriptionController
}
const HistoryModalContentPane = ({
application,
noteHistoryController,
notesController,
subscriptionController,
}: Props) => {
const { contentState } = noteHistoryController
const HistoryModalContentPane = ({ noteHistoryController, subscriptionController, note }: Props) => {
const { selectedRevision, contentState } = noteHistoryController
switch (contentState) {
case RevisionContentState.Idle:
@@ -32,13 +25,10 @@ const HistoryModalContentPane = ({
case RevisionContentState.Loading:
return <Spinner className="absolute top-1/2 left-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2" />
case RevisionContentState.Loaded:
return (
<SelectedRevisionContent
application={application}
notesController={notesController}
noteHistoryController={noteHistoryController}
/>
)
if (!selectedRevision) {
return null
}
return <ReadonlyNoteContent note={note} content={selectedRevision.payload.content} showLinkedItems={false} />
case RevisionContentState.NotEntitled:
return <RevisionContentLocked subscriptionController={subscriptionController} />
default:
@@ -15,7 +15,6 @@ import MobileModalHeader from '../Modal/MobileModalHeader'
const HistoryModalDialogContent = ({
application,
dismissModal,
notesController,
subscriptionController,
note,
selectionController,
@@ -89,9 +88,8 @@ const HistoryModalDialogContent = ({
)}
>
<HistoryModalContentPane
application={application}
noteHistoryController={noteHistoryController}
notesController={notesController}
note={note}
subscriptionController={subscriptionController}
/>
</div>
@@ -9,7 +9,6 @@ import { useModalAnimation } from '../Modal/useModalAnimation'
const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps> = ({
application,
historyModalController,
notesController,
selectionController,
subscriptionController,
}) => {
@@ -49,7 +48,6 @@ const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps> = ({
application={application}
dismissModal={historyModalController.dismissModal}
note={historyModalController.note}
notesController={notesController}
selectionController={selectionController}
subscriptionController={subscriptionController}
/>
@@ -1,13 +1,11 @@
import { WebApplication } from '@/Application/WebApplication'
import { HistoryModalController } from '@/Controllers/NoteHistory/HistoryModalController'
import { NotesController } from '@/Controllers/NotesController/NotesController'
import { SelectedItemsController } from '@/Controllers/SelectedItemsController'
import { SubscriptionController } from '@/Controllers/Subscription/SubscriptionController'
import { SNNote } from '@standardnotes/snjs'
type CommonProps = {
application: WebApplication
notesController: NotesController
selectionController: SelectedItemsController
subscriptionController: SubscriptionController
}
@@ -1,93 +0,0 @@
import { WebApplication } from '@/Application/WebApplication'
import { ContentType, NoteType, SNNote } from '@standardnotes/snjs'
import { observer } from 'mobx-react-lite'
import { FunctionComponent, useEffect, useMemo } from 'react'
import ComponentView from '@/Components/ComponentView/ComponentView'
import { NotesController } from '@/Controllers/NotesController/NotesController'
import { NoteHistoryController } from '@/Controllers/NoteHistory/NoteHistoryController'
import { ErrorBoundary } from '@/Utils/ErrorBoundary'
import { BlocksEditor } from '../SuperEditor/BlocksEditor'
import { BlocksEditorComposer } from '../SuperEditor/BlocksEditorComposer'
const ABSOLUTE_CENTER_CLASSNAME = 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2'
type SelectedRevisionContentProps = {
application: WebApplication
noteHistoryController: NoteHistoryController
notesController: NotesController
}
const SelectedRevisionContent: FunctionComponent<SelectedRevisionContentProps> = ({
application,
noteHistoryController,
notesController,
}) => {
const note = notesController.firstSelectedNote
const { selectedRevision } = noteHistoryController
const componentViewer = useMemo(() => {
const editorForCurrentNote = note ? application.componentManager.editorForNote(note) : undefined
if (!editorForCurrentNote) {
return undefined
}
const templateNoteForRevision = application.mutator.createTemplateItem(
ContentType.Note,
selectedRevision?.payload.content,
) as SNNote
const componentViewer = application.componentManager.createComponentViewer(editorForCurrentNote)
componentViewer.setReadonly(true)
componentViewer.lockReadonly = true
componentViewer.overrideContextItem = templateNoteForRevision
return componentViewer
}, [application.componentManager, application.mutator, note, selectedRevision?.payload.content])
useEffect(() => {
return () => {
if (componentViewer) {
application.componentManager.destroyComponentViewer(componentViewer)
}
}
}, [application, componentViewer])
return (
<div className="flex h-full flex-col overflow-hidden">
<div className="w-full p-4 text-base font-bold">
<div className="title">{selectedRevision?.payload.content.title}</div>
</div>
{componentViewer ? (
<div className="component-view">
<ComponentView key={componentViewer.identifier} componentViewer={componentViewer} application={application} />
</div>
) : note?.noteType === NoteType.Super ? (
<ErrorBoundary>
<div className="w-full flex-grow overflow-hidden overflow-y-auto">
<BlocksEditorComposer readonly initialValue={selectedRevision?.payload.content.text}>
<BlocksEditor
readonly
className="blocks-editor relative h-full resize-none p-4 text-base focus:shadow-none focus:outline-none"
spellcheck={note.spellcheck}
></BlocksEditor>
</BlocksEditorComposer>
</div>
</ErrorBoundary>
) : (
<div className="relative min-h-0 flex-grow overflow-hidden">
{selectedRevision?.payload.content.text.length ? (
<textarea
readOnly={true}
className="font-editor h-full w-full resize-none border-0 bg-default p-4 pt-0 text-editor text-text"
value={selectedRevision?.payload.content.text}
/>
) : (
<div className={`text-passive-0 ${ABSOLUTE_CENTER_CLASSNAME}`}>Empty note.</div>
)}
</div>
)}
</div>
)
}
export default observer(SelectedRevisionContent)
@@ -8,8 +8,8 @@ export const setCustomViewportHeight = (height: number, suffix: 'px' | 'vh', for
log(LoggingDomain.Viewport, `setCustomViewportHeight: ${value}`)
document.body.style.height = value
document.documentElement.style.setProperty('--ios-viewport-height', value)
document.body.style.height = 'var(--ios-viewport-height)'
if (forceTriggerResizeEvent) {
window.dispatchEvent(new Event('resize'))