Compare commits

...
29 changed files with 154 additions and 28 deletions
+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.20.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/api
## [1.20.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/api
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.20.6",
"version": "1.20.7",
"engines": {
"node": ">=16.0.0 <17.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.
## [3.100.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/desktop
## [3.100.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/desktop
## [3.100.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**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.100.9",
"version": "3.100.11",
"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.19.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/encryption
## [1.19.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/encryption
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.19.14",
"version": "1.19.15",
"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.25.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.25.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/filepicker
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.25.14",
"version": "1.25.15",
"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.12.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/files
## [1.12.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/files
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.12.14",
"version": "1.12.15",
"engines": {
"node": ">=16.0.0 <17.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.
## [3.46.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/mobile
## [3.46.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/mobile
## [3.46.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.46.19",
"version": "3.46.21",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.37.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
### Bug Fixes
* **snjs:** keep apply payload timestamp when using keep base conflict strategy ([#2031](https://github.com/standardnotes/app/issues/2031)) ([87f8669](https://github.com/standardnotes/app/commit/87f86693a67a36972f0e44a883b18a7129c36893))
## [1.37.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/models
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.37.3",
"version": "1.37.4",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -99,4 +99,22 @@ describe('conflict delta', () => {
expect(delta.getConflictStrategy()).toBe(ConflictStrategy.KeepApply)
})
it('if keep base strategy, always use the apply payloads updated_at_timestamp', () => {
const basePayload = createDecryptedItemsKey('123', 'secret', 2)
const baseCollection = createBaseCollection(basePayload)
const applyPayload = createDecryptedItemsKey('123', 'other secret', 1)
const delta = new ConflictDelta(baseCollection, basePayload, applyPayload, historyMap)
expect(delta.getConflictStrategy()).toBe(ConflictStrategy.KeepBaseDuplicateApply)
const result = delta.result()
expect(result.emits).toHaveLength(1)
expect(result.emits[0].updated_at_timestamp).toEqual(applyPayload.updated_at_timestamp)
})
})
@@ -1,4 +1,4 @@
import { greaterOfTwoDates, uniqCombineObjArrays } from '@standardnotes/utils'
import { uniqCombineObjArrays } from '@standardnotes/utils'
import { ImmutablePayloadCollection } from '../Collection/Payload/ImmutablePayloadCollection'
import { CreateDecryptedItemFromPayload, CreateItemFromPayload } from '../../Utilities/Item/ItemGenerator'
import { HistoryMap, historyMapFunctions } from '../History/HistoryMap'
@@ -114,9 +114,9 @@ export class ConflictDelta {
}
private handleKeepBaseStrategy(): SyncResolvedPayload[] {
const updatedAt = greaterOfTwoDates(this.basePayload.serverUpdatedAt, this.applyPayload.serverUpdatedAt)
const updatedAt = this.applyPayload.serverUpdatedAt
const updatedAtTimestamp = Math.max(this.basePayload.updated_at_timestamp, this.applyPayload.updated_at_timestamp)
const updatedAtTimestamp = this.applyPayload.updated_at_timestamp
const leftPayload = this.basePayload.copyAsSyncResolved(
{
@@ -146,9 +146,9 @@ export class ConflictDelta {
}
private handleKeepBaseDuplicateApplyStrategy(): SyncResolvedPayload[] {
const updatedAt = greaterOfTwoDates(this.basePayload.serverUpdatedAt, this.applyPayload.serverUpdatedAt)
const updatedAt = this.applyPayload.serverUpdatedAt
const updatedAtTimestamp = Math.max(this.basePayload.updated_at_timestamp, this.applyPayload.updated_at_timestamp)
const updatedAtTimestamp = this.applyPayload.updated_at_timestamp
const leftPayload = this.basePayload.copyAsSyncResolved(
{
@@ -201,9 +201,9 @@ export class ConflictDelta {
'content_type',
])
const updatedAt = greaterOfTwoDates(this.basePayload.serverUpdatedAt, this.applyPayload.serverUpdatedAt)
const updatedAt = this.applyPayload.serverUpdatedAt
const updatedAtTimestamp = Math.max(this.basePayload.updated_at_timestamp, this.applyPayload.updated_at_timestamp)
const updatedAtTimestamp = this.applyPayload.updated_at_timestamp
const payload = this.basePayload.copyAsSyncResolved(
{
+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.3.247](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.246](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.245](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.3.245",
"version": "1.3.247",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+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.45.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/services
## [1.45.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
**Note:** Version bump only for package @standardnotes/services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.45.4",
"version": "1.45.5",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.151.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
### Bug Fixes
* **snjs:** keep apply payload timestamp when using keep base conflict strategy ([#2031](https://github.com/standardnotes/app/issues/2031)) ([87f8669](https://github.com/standardnotes/app/commit/87f86693a67a36972f0e44a883b18a7129c36893))
## [2.151.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
### Bug Fixes
@@ -885,6 +885,38 @@ describe('online conflict handling', function () {
await this.sharedFinalAssertions()
})
it('conflict where server updated_at_timestamp is less than base updated_at should not result in infinite loop', async function () {
/**
* While this shouldn't happen, I've seen this happen locally where a single UserPrefs object has a timestamp of A
* on the server, and A + 10 on the client side. Somehow the client had a newer timestamp than the server. The
* server rejects any change if the timestamp is not exactly equal. When we use the KeepBase strategy during conflict
* resolution, we keep the base item, but give it the timestamp of the server item, so that the server accepts it.
* However, RemoteDataConflict would only take the server's timestamp if it was greater than the base's timestamp.
* Because this was not the case, the client kept sending up its own base timestamp and the server kept rejecting it,
* and it never resolved. The fix made here was to take the server's timestamp no matter what, even if it is less than client's.
*/
const note = await Factory.createSyncedNote(this.application)
this.expectedItemCount++
/** First modify the item without saving so that our local contents digress from the server's */
await this.application.mutator.changeItem(note, (mutator) => {
mutator.title = `${Math.random()}`
})
const modified = note.payload.copy({
updated_at_timestamp: note.payload.updated_at_timestamp + 1,
content: {
...note.content,
title: Math.random(),
},
dirty: true,
})
this.expectedItemCount++
await this.application.itemManager.emitItemFromPayload(modified)
await this.application.sync.sync()
expect(this.application.itemManager.getDisplayableNotes().length).to.equal(2)
await this.sharedFinalAssertions()
})
it('conflicting should not over resolve', async function () {
/**
* Before refactoring to use dirtyIndex instead of dirtiedDate, sometimes an item could be dirtied
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.151.5",
"version": "2.151.6",
"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.13.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.13.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.13.16",
"version": "1.13.17",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.101.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-18)
**Note:** Version bump only for package @standardnotes/web
# [3.101.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
### Features
* click saving indicator to toggle visibility ([#2028](https://github.com/standardnotes/app/issues/2028)) ([f793673](https://github.com/standardnotes/app/commit/f7936738759d4c2aa9d5a4a370649a20d758d3f9))
## [3.100.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-11-17)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.100.8",
"version": "3.101.1",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
@@ -1,9 +1,10 @@
import { ElementIds } from '@/Constants/ElementIDs'
import { PrefDefaults } from '@/Constants/PrefDefaults'
import { classNames } from '@/Utils/ConcatenateClassNames'
import { ReactNode, useState } from 'react'
import { ReactNode, useCallback, useState } from 'react'
import { IconType, PrefKey } from '@standardnotes/snjs'
import Icon from '../Icon/Icon'
import { useApplication } from '../ApplicationView/ApplicationProvider'
export type NoteStatus = {
type: 'saving' | 'saved' | 'error'
@@ -42,7 +43,8 @@ const IndicatorWithTooltip = ({
id={ElementIds.NoteStatusTooltip}
className={classNames(
isTooltipVisible ? '' : 'hidden',
'absolute top-full right-0 min-w-[90vw] translate-x-2 translate-y-1 select-none rounded border border-border bg-default py-1.5 px-3 text-left peer-hover:block peer-focus:block md:min-w-max',
'absolute top-full right-0 min-w-[90vw] translate-x-2 translate-y-1 select-none rounded border border-border',
'bg-default py-1.5 px-3 text-left peer-hover:block peer-focus:block md:min-w-max',
)}
>
{children}
@@ -61,11 +63,15 @@ const NoteStatusIndicator = ({
syncTakingTooLong,
updateSavingIndicator = PrefDefaults[PrefKey.UpdateSavingStatusIndicator],
}: Props) => {
const application = useApplication()
const [isTooltipVisible, setIsTooltipVisible] = useState(false)
const onClick = () => setIsTooltipVisible((show) => !show)
const onBlur = () => setIsTooltipVisible(false)
const toggleShowPreference = useCallback(() => {
void application.setPreference(PrefKey.UpdateSavingStatusIndicator, !updateSavingIndicator)
}, [application, updateSavingIndicator])
if (updateSavingIndicator && !status) {
return null
}
@@ -74,7 +80,7 @@ const NoteStatusIndicator = ({
return (
<IndicatorWithTooltip
className="bg-danger text-danger-contrast"
onClick={onClick}
onClick={toggleShowPreference}
onBlur={onBlur}
icon="warning"
isTooltipVisible={isTooltipVisible}
@@ -89,7 +95,7 @@ const NoteStatusIndicator = ({
return (
<IndicatorWithTooltip
className="bg-warning text-warning-contrast"
onClick={onClick}
onClick={toggleShowPreference}
onBlur={onBlur}
icon={status && status.type === 'saving' ? 'sync' : 'warning'}
isTooltipVisible={isTooltipVisible}
@@ -113,7 +119,7 @@ const NoteStatusIndicator = ({
status.type === 'saving' && 'bg-contrast',
status.type === 'saved' && 'bg-success text-success-contrast',
)}
onClick={onClick}
onClick={toggleShowPreference}
onBlur={onBlur}
icon={status.type === 'saving' ? 'sync' : 'check'}
animateIcon={status.type === 'saving'}
@@ -128,13 +134,13 @@ const NoteStatusIndicator = ({
return (
<IndicatorWithTooltip
className="bg-contrast text-passive-1"
onClick={onClick}
onClick={toggleShowPreference}
onBlur={onBlur}
icon="info"
isTooltipVisible={isTooltipVisible}
>
<div className="text-sm font-bold">Note status updates are disabled</div>
<div className="mt-0.5">They can be re-enabled in the Preferences under General &gt; Tools</div>
<div className="mt-0.5">Click to enable.</div>
</IndicatorWithTooltip>
)
}
@@ -23,8 +23,8 @@ const General: FunctionComponent<Props> = ({ viewControllerManager, application,
<Persistence application={application} />
<PlaintextDefaults application={application} />
<Defaults application={application} />
<SmartViews application={application} featuresController={viewControllerManager.featuresController} />
<Tools application={application} />
<SmartViews application={application} featuresController={viewControllerManager.featuresController} />
<LabsPane application={application} />
<Advanced
application={application}