Compare commits

...
31 changed files with 130 additions and 54 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.1.119](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.118](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**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.118",
"version": "1.1.119",
"private": true,
"scripts": {
"build-mv2": "yarn clean && webpack --config ./webpack.config.prod.js",
+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.
## [3.108.50](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
### Bug Fixes
* handle bad access when accessing paths ([#2375](https://github.com/standardnotes/app/issues/2375)) ([804a39d](https://github.com/standardnotes/app/commit/804a39dabc595579aba3643ef6d6ef0c10263f9c))
## [3.108.49](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/desktop
-9
View File
@@ -1,10 +1,7 @@
import { MessageType } from '../test/TestIpcMessage'
import { Store } from './javascripts/Main/Store/Store'
import { StoreKeys } from './javascripts/Main/Store/StoreKeys'
import { Paths, Urls } from './javascripts/Main/Types/Paths'
import { UpdateState } from './javascripts/Main/UpdateManager'
import { handleTestMessage } from './javascripts/Main/Utils/Testing'
import { isTesting } from './javascripts/Main/Utils/Utils'
import { WindowState } from './javascripts/Main/Window'
export class AppState {
@@ -27,12 +24,6 @@ export class AppState {
this.store.set(StoreKeys.LastRunVersion, this.version)
this.updates = new UpdateState(this)
if (isTesting()) {
handleTestMessage(MessageType.AppStateCall, (method, ...args) => {
;(this as any)[method](...args)
})
}
}
public isRunningVersionForFirstTime(): boolean {
+22 -19
View File
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { app, ipcMain, shell } from 'electron'
import log from 'electron-log'
import fs from 'fs-extra'
@@ -9,8 +10,6 @@ import { Store } from './javascripts/Main/Store/Store'
import { StoreKeys } from './javascripts/Main/Store/StoreKeys'
import { isSnap } from './javascripts/Main/Types/Constants'
import { Paths } from './javascripts/Main/Types/Paths'
import { setupTesting } from './javascripts/Main/Utils/Testing'
import { isTesting } from './javascripts/Main/Utils/Utils'
import { CommandLineArgs } from './javascripts/Shared/CommandLineArgs'
enableExperimentalFeaturesForFileAccessFix()
@@ -39,10 +38,6 @@ if (userDataPathIndex > 0) {
migrateSnapStorage()
}
if (isTesting()) {
setupTesting()
}
log.transports.file.level = 'info'
process.on('uncaughtException', (err) => {
@@ -96,8 +91,12 @@ function migrateSnapStorage() {
fs.moveSync(fullFilePath, path.join(dest, fileName), {
overwrite: false,
})
} catch (error: any) {
console.error(`Migration: error occured while moving ${fullFilePath} to ${dest}:`, error?.message ?? error)
} catch (error) {
console.error(
`Migration: error occured while moving ${fullFilePath} to ${dest}:`,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(error as any)?.message ?? error,
)
}
}
@@ -110,18 +109,22 @@ function migrateSnapStorage() {
* Backups location has not been altered by the user. Move it to the
* user documents directory
*/
console.log(`Migration: moving ${store.data.backupsLocation} to ${Paths.documentsDir}`)
const newLocation = path.join(Paths.documentsDir, path.basename(store.data.backupsLocation))
try {
fs.copySync(store.data.backupsLocation, newLocation)
} catch (error: any) {
console.error(
`Migration: error occured while moving ${store.data.backupsLocation} to ${Paths.documentsDir}:`,
error?.message ?? error,
)
const documentsDir = Paths.documentsDir
console.log(`Migration: moving ${store.data.backupsLocation} to ${documentsDir}`)
if (documentsDir) {
const newLocation = path.join(documentsDir, path.basename(store.data.backupsLocation))
try {
fs.copySync(store.data.backupsLocation, newLocation)
} catch (error) {
console.error(
`Migration: error occured while moving ${store.data.backupsLocation} to ${documentsDir}:`,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(error as any)?.message ?? error,
)
}
store.set(StoreKeys.LegacyTextBackupsLocation, newLocation)
console.log('Migration: finished moving backups directory.')
}
store.set(StoreKeys.LegacyTextBackupsLocation, newLocation)
console.log('Migration: finished moving backups directory.')
}
}
}
@@ -88,7 +88,7 @@ export class FilesBackupManager implements FileBackupsDevice {
return value === true
}
async getUserDocumentsDirectory(): Promise<string> {
async getUserDocumentsDirectory(): Promise<string | undefined> {
return Paths.documentsDir
}
@@ -103,7 +103,12 @@ export class FilesBackupManager implements FileBackupsDevice {
}
const LegacyTextBackupsDirectory = 'Standard Notes Backups'
return path.join(Paths.homeDir, LegacyTextBackupsDirectory)
const homeDir = Paths.homeDir
if (homeDir) {
return path.join(homeDir, LegacyTextBackupsDirectory)
}
return undefined
}
private getFileBackupsMappingFilePath(backupsLocation: string): string {
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { compareVersions } from 'compare-versions'
import log from 'electron-log'
import fs from 'fs'
@@ -247,7 +247,7 @@ export class RemoteBridge implements CrossProcessBridge {
return this.fileBackups.migrateLegacyFileBackupsToNewStructure(newPath)
}
getUserDocumentsDirectory(): Promise<string> {
getUserDocumentsDirectory(): Promise<string | undefined> {
return this.fileBackups.getUserDocumentsDirectory()
}
@@ -36,11 +36,19 @@ export const Paths = {
get userDataDir(): string {
return app.getPath('userData')
},
get homeDir(): string {
return app.getPath('home')
get homeDir(): string | undefined {
try {
return app.getPath('home')
} catch (error) {
return undefined
}
},
get documentsDir(): string {
return app.getPath('documents')
get documentsDir(): string | undefined {
try {
return app.getPath('documents')
} catch (error) {
return undefined
}
},
get tempDir(): string {
return app.getPath('temp')
@@ -152,7 +152,7 @@ export class DesktopDevice extends WebOrDesktopDevice implements DesktopDeviceIn
return this.remoteBridge.wasLegacyTextBackupsExplicitlyDisabled()
}
getUserDocumentsDirectory(): Promise<string> {
getUserDocumentsDirectory(): Promise<string | undefined> {
return this.remoteBridge.getUserDocumentsDirectory()
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.108.49",
"version": "3.108.50",
"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.28.67](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.66](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/filepicker
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.28.66",
"version": "1.28.67",
"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.
## [1.16.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
### Bug Fixes
* handle bad access when accessing paths ([#2375](https://github.com/standardnotes/app/issues/2375)) ([804a39d](https://github.com/standardnotes/app/commit/804a39dabc595579aba3643ef6d6ef0c10263f9c))
## [1.16.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/files
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.16.12",
"version": "1.16.13",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -49,7 +49,7 @@ interface PlaintextBackupsMethods {
interface TextBackupsMethods {
getTextBackupsCount(location: string): Promise<number>
saveTextBackupData(location: string, data: string): Promise<void>
getUserDocumentsDirectory(): Promise<string>
getUserDocumentsDirectory(): Promise<string | undefined>
}
interface LegacyBackupsMethods {
+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.
## [3.56.30](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/mobile
## [3.56.29](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/mobile
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.56.29",
"version": "3.56.30",
"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.4.402](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.401](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.401",
"version": "1.4.402",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+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.63.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
### Bug Fixes
* handle bad access when accessing paths ([#2375](https://github.com/standardnotes/app/issues/2375)) ([804a39d](https://github.com/standardnotes/app/commit/804a39dabc595579aba3643ef6d6ef0c10263f9c))
## [1.63.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.63.14",
"version": "1.63.15",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -160,14 +160,21 @@ export class FilesBackupService
}
private async automaticallyEnableTextBackupsIfPreferenceNotSet(): Promise<void> {
if (this.storage.getValue(StorageKey.TextBackupsEnabled) == undefined) {
this.storage.setValue(StorageKey.TextBackupsEnabled, true)
const location = await this.device.joinPaths(
await this.device.getUserDocumentsDirectory(),
await this.prependWorkspacePathForPath(TextBackupsDirectoryName),
)
this.storage.setValue(StorageKey.TextBackupsLocation, location)
if (this.storage.getValue(StorageKey.TextBackupsEnabled) != undefined) {
return
}
this.storage.setValue(StorageKey.TextBackupsEnabled, true)
const documentsDir = await this.device.getUserDocumentsDirectory()
if (!documentsDir) {
return
}
const location = await this.device.joinPaths(
documentsDir,
await this.prependWorkspacePathForPath(TextBackupsDirectoryName),
)
this.storage.setValue(StorageKey.TextBackupsLocation, location)
}
openAllDirectoriesContainingBackupFiles(): void {
@@ -170,6 +170,9 @@ export class HomeServerService
let location = await this.getHomeServerDataLocation()
if (!location) {
const documentsDirectory = await this.desktopDevice.getUserDocumentsDirectory()
if (!documentsDirectory) {
return
}
location = `${documentsDirectory}/${this.HOME_SERVER_DATA_DIRECTORY_NAME}`
}
+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.
## [2.202.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/snjs
## [2.202.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/snjs
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.202.18",
"version": "2.202.19",
"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.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.28.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/ui-services
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.28.16",
"version": "1.28.17",
"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.
## [3.167.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/web
## [3.167.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)
**Note:** Version bump only for package @standardnotes/web
+11
View File
@@ -1,5 +1,16 @@
{
"versions": [
{
"version": "3.167.17",
"title": "[3.167.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)",
"date": null,
"body": "**Note:** Version bump only for package @standardnotes/web",
"parsed": {
"_": [
"Note: Version bump only for package @standardnotes/web"
]
}
},
{
"version": "3.167.16",
"title": "[3.167.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2023-07-27)",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.167.16",
"version": "3.167.17",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes",