Compare commits

...
27 changed files with 160 additions and 52 deletions
+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.1.383](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-06)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.382](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-05)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.381](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-04)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.380](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-03)
**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.380",
"version": "1.1.383",
"private": true,
"scripts": {
"build-mv2": "yarn clean && webpack --config ./webpack.config.prod.js",
+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.
## [3.108.321](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-06)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.320](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-05)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.319](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-04)
**Note:** Version bump only for package @standardnotes/desktop
## [3.108.318](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-03)
**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.108.318",
"version": "3.108.321",
"license": "AGPL-3.0",
"author": "Standard Notes.",
"private": true,
+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.
## [3.58.42](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-06)
**Note:** Version bump only for package @standardnotes/mobile
## [3.58.41](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-05)
**Note:** Version bump only for package @standardnotes/mobile
## [3.58.40](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-04)
**Note:** Version bump only for package @standardnotes/mobile
## [3.58.39](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-03)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.58.39",
"version": "3.58.42",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.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.4.677](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-06)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.676](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-05)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.675](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-04)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.674](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-03)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.674",
"version": "1.4.677",
"license": "AGPL-3.0",
"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.67.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-05)
**Note:** Version bump only for package @standardnotes/services
## [1.67.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-02)
**Note:** Version bump only for package @standardnotes/services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.67.9",
"version": "1.67.10",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -56,4 +56,5 @@ export enum ApplicationEvent {
/** Called when the app first launches and after first sync request made after sign in */
CompletedInitialSync = 'Application:CompletedInitialSync',
DidPurchaseSubscription = 'Application:DidPurchaseSubscription',
SyncTooManyRequests = 'Application:SyncTooManyRequests',
}
@@ -33,6 +33,7 @@ export enum SyncEvent {
ReceivedSharedVaultInvites = 'received-shared-vault-invites',
ReceivedNotifications = 'received-user-events',
ReceivedAsymmetricMessages = 'received-asymmetric-messages',
TooManyRequests = 'too-many-requests',
}
export type SyncEventReceivedRemoteSharedVaultsData = SharedVaultServerHash[]
+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.
## [2.204.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-06)
### Bug Fixes
* Fixes issue where self-hosted accounts may not have loaded correct server ([acd20dc](https://github.com/standardnotes/app/commit/acd20dcc70f4f84f07fbbd75fedcea459c22681c))
## [2.204.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-05)
**Note:** Version bump only for package @standardnotes/snjs
## [2.204.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-02)
**Note:** Version bump only for package @standardnotes/snjs
@@ -1529,7 +1529,6 @@ export class Dependencies {
this.get<HttpService>(TYPES.HttpService),
this.get<DiskStorageService>(TYPES.DiskStorageService),
this.options.defaultHost,
this.options.identifier,
this.get<InMemoryStore>(TYPES.InMemoryStore),
this.get<PureCryptoInterface>(TYPES.Crypto),
this.get<SessionStorageMapper>(TYPES.SessionStorageMapper),
+1
View File
@@ -16,6 +16,7 @@ const map: Record<string, ApplicationEvent> = {
[SyncEvent.DatabaseReadError]: ApplicationEvent.LocalDatabaseReadError,
[SyncEvent.DatabaseWriteError]: ApplicationEvent.LocalDatabaseWriteError,
[SyncEvent.DownloadFirstSyncCompleted]: ApplicationEvent.CompletedInitialSync,
[SyncEvent.TooManyRequests]: ApplicationEvent.SyncTooManyRequests,
}
export function applicationEventForSyncEvent(syncEvent: SyncEvent): ApplicationEvent | undefined {
@@ -1,27 +0,0 @@
import { ApplicationStage, StorageKey } from '@standardnotes/services'
import { Migration } from '@Lib/Migrations/Migration'
export class Migration2_204_8 extends Migration {
static override version(): string {
return '2.204.8'
}
protected registerStageHandlers(): void {
this.registerStageHandler(ApplicationStage.Launched_10, async () => {
await this.migrateHostKeyStoredToWorkspaceIdentified()
this.markDone()
})
}
private async migrateHostKeyStoredToWorkspaceIdentified(): Promise<void> {
const existingHostKeyValue = this.services.storageService.getValue<string | undefined>(StorageKey.ServerHost)
if (existingHostKeyValue === undefined) {
return
}
this.services.storageService.setValue(`${StorageKey.ServerHost}:${this.services.identifier}`, existingHostKeyValue)
await this.services.storageService.removeValue(StorageKey.ServerHost)
}
}
+2 -5
View File
@@ -106,7 +106,6 @@ export class LegacyApiService
private httpService: HttpServiceInterface,
private storageService: DiskStorageService,
private host: string,
private workspaceIdentifier: string,
private inMemoryStore: KeyValueStoreInterface<string>,
private crypto: PureCryptoInterface,
private sessionStorageMapper: MapperInterface<Session, Record<string, unknown>>,
@@ -143,16 +142,14 @@ export class LegacyApiService
}
public loadHost(): string {
const storedValue = this.storageService.getValue<string | undefined>(
`${StorageKey.ServerHost}:${this.workspaceIdentifier}`,
)
const storedValue = this.storageService.getValue<string | undefined>(StorageKey.ServerHost)
this.host = storedValue || this.host
return this.host
}
public async setHost(host: string): Promise<void> {
this.host = host
this.storageService.setValue(`${StorageKey.ServerHost}:${this.workspaceIdentifier}`, host)
this.storageService.setValue(StorageKey.ServerHost, host)
}
public getHost(): string {
@@ -169,7 +169,7 @@ export class SessionManager
}
}
const serverHost = this.storage.getValue<string | undefined>(`${StorageKey.ServerHost}:${this.workspaceIdentifier}`)
const serverHost = this.storage.getValue<string | undefined>(StorageKey.ServerHost)
if (serverHost) {
void this.apiService.setHost(serverHost)
this.httpService.setHost(serverHost)
@@ -100,6 +100,7 @@ import { ContentType } from '@standardnotes/domain-core'
const DEFAULT_MAJOR_CHANGE_THRESHOLD = 15
const INVALID_SESSION_RESPONSE_STATUS = 401
const TOO_MANY_REQUESTS_RESPONSE_STATUS = 429
const DEFAULT_AUTO_SYNC_INTERVAL = 30_000
/** Content types appearing first are always mapped first */
@@ -1000,6 +1001,10 @@ export class SyncService
void this.notifyEvent(SyncEvent.InvalidSession)
}
if (response.status === TOO_MANY_REQUESTS_RESPONSE_STATUS) {
void this.notifyEvent(SyncEvent.TooManyRequests)
}
this.opStatus?.setError(response.error)
void this.notifyEvent(SyncEvent.SyncError, response)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.204.11",
"version": "2.204.13",
"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.35.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-05)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.35.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-03)
**Note:** Version bump only for package @standardnotes/ui-services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.35.16",
"version": "1.35.17",
"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.
## [3.183.42](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-06)
**Note:** Version bump only for package @standardnotes/web
## [3.183.41](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-05)
**Note:** Version bump only for package @standardnotes/web
## [3.183.40](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-04)
**Note:** Version bump only for package @standardnotes/web
## [3.183.39](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-03)
**Note:** Version bump only for package @standardnotes/web
+33
View File
@@ -1,5 +1,38 @@
{
"versions": [
{
"version": "3.183.42",
"title": "[3.183.42](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-06)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.183.41",
"title": "[3.183.41](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-05)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.183.40",
"title": "[3.183.40](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-04)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.183.39",
"title": "[3.183.39](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2024-01-03)",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.183.39",
"version": "3.183.42",
"license": "AGPL-3.0",
"main": "dist/app.js",
"author": "Standard Notes",
@@ -13,7 +13,7 @@ import { FunctionComponent, useCallback, useEffect, useMemo, useState, lazy, use
import RevisionHistoryModal from '@/Components/RevisionHistoryModal/RevisionHistoryModal'
import PremiumModalProvider from '@/Hooks/usePremiumModal'
import ConfirmSignoutContainer from '@/Components/ConfirmSignoutModal/ConfirmSignoutModal'
import { ToastContainer } from '@standardnotes/toast'
import { addToast, ToastContainer, ToastType } from '@standardnotes/toast'
import FilePreviewModalWrapper from '@/Components/FilePreview/FilePreviewModal'
import FileContextMenuWrapper from '@/Components/FileContextMenu/FileContextMenu'
import PermissionsModalWrapper from '@/Components/PermissionsModal/PermissionsModalWrapper'
@@ -141,6 +141,11 @@ const ApplicationView: FunctionComponent<Props> = ({ application, mainApplicatio
})
.catch(console.error)
}
} else if (eventName === ApplicationEvent.SyncTooManyRequests) {
addToast({
type: ToastType.Error,
message: 'Too many requests. Please try again later.',
})
}
})
@@ -55,6 +55,8 @@ export const PlainEditor = forwardRef<PlainEditorInterface, Props>(
const isAdjustingMobileCursor = useRef(false)
const note = useRef(controller.item)
const [isPendingLocalPropagation, setIsPendingLocalPropagation] = useState(false)
const tabObserverDisposer = useRef<Disposer>()
const mutationObserver = useRef<MutationObserver | null>(null)
@@ -79,27 +81,40 @@ export const PlainEditor = forwardRef<PlainEditorInterface, Props>(
throw Error('Editor received changes for non-current note')
}
if (
isPayloadSourceRetrieved(source) ||
editorText == undefined ||
updatedNote.editorIdentifier !== note.current.editorIdentifier ||
updatedNote.noteType !== note.current.noteType
) {
setEditorText(updatedNote.text)
if (!isPendingLocalPropagation) {
if (
isPayloadSourceRetrieved(source) ||
editorText == undefined ||
updatedNote.editorIdentifier !== note.current.editorIdentifier ||
updatedNote.noteType !== note.current.noteType
) {
setEditorText(updatedNote.text)
}
}
note.current = updatedNote
})
return disposer
}, [controller, editorText, controller.item.uuid, controller.item.editorIdentifier, controller.item.noteType])
}, [
controller,
editorText,
controller.item.uuid,
controller.item.editorIdentifier,
controller.item.noteType,
isPendingLocalPropagation,
])
const onTextAreaChange: ChangeEventHandler<HTMLTextAreaElement> = ({ currentTarget }) => {
const text = currentTarget.value
setEditorText(text)
void controller.saveAndAwaitLocalPropagation({ text: text, isUserModified: true })
setIsPendingLocalPropagation(true)
void controller.saveAndAwaitLocalPropagation({ text: text, isUserModified: true }).then(() => {
setIsPendingLocalPropagation(false)
})
}
const onContentFocus = useCallback(() => {