Skip to content

Commit

Permalink
chore: bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Nov 29, 2024
1 parent a6ddcf6 commit 7e2e5e4
Show file tree
Hide file tree
Showing 10 changed files with 962 additions and 101 deletions.
988 changes: 917 additions & 71 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@filen/desktop",
"version": "3.0.35",
"buildNumber": 335,
"version": "3.0.36",
"buildNumber": 336,
"description": "Filen Desktop Client",
"author": "Filen Cloud Dienste UG (haftungsbeschränkt) <[email protected]>",
"main": "dist/index.js",
Expand Down Expand Up @@ -65,12 +65,12 @@
"yaml": "^2.6.0"
},
"dependencies": {
"@filen/network-drive": "^0.9.36",
"@filen/s3": "^0.2.46",
"@filen/sdk": "^0.1.187",
"@filen/sync": "^0.1.84",
"@filen/network-drive": "^0.9.38",
"@filen/s3": "^0.2.47",
"@filen/sdk": "^0.1.189",
"@filen/sync": "^0.1.90",
"@filen/web": "^0.1.71",
"@filen/webdav": "^0.2.61",
"@filen/webdav": "^0.2.63",
"axios": "^0.28.1",
"cors": "^2.8.5",
"electron-updater": "^6.4.0-alpha.1",
Expand Down
2 changes: 0 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export const DISALLOWED_SYNC_DIRS = [
"C:\\Windows",
"C:\\Program Files",
"C:\\Program Files (x86)",
`C:\\Users\\${process.env.USER ?? "User"}\\AppData\\Local`,
`C:\\Users\\${process.env.USER ?? "User"}\\AppData\\LocalLow`,
"C:\\Temp",
"C:\\Windows\\Temp",
"/System",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ export class FilenDesktop {

this.logger.log("info", "Starting sync and http inside worker")

this.worker.invoke("restartHTTP").catch(err => {
this.logger.log("error", err, "http.start")
this.logger.log("error", err)
})
// this.worker.invoke("restartHTTP").catch(err => {
// this.logger.log("error", err, "http.start")
// this.logger.log("error", err)
// })

this.worker.invoke("restartSync").catch(err => {
this.logger.log("error", err, "sync.start")
Expand Down
10 changes: 9 additions & 1 deletion src/ipc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ export class IPC {
},
syncConfig: {
...config.syncConfig,
dbPath: pathModule.join(app.getPath("userData"), "sync")
dbPath: pathModule.join(app.getPath("userData"), "sync"),
syncPairs: config.syncConfig.syncPairs.map(pair => ({
...pair,
requireConfirmationOnLargeDeletion: true
}))
}
}

Expand Down Expand Up @@ -944,6 +948,10 @@ export class IPC {
await this.desktop.worker.invoke("syncUpdatePairs", params)
})

ipcMain.handle("syncUpdateConfirmDeletion", async (_, params) => {
await this.desktop.worker.invoke("syncUpdateConfirmDeletion", params)
})

ipcMain.handle("isAllowedToSyncDirectory", async (_, path: string) => {
try {
const normalizedPath = pathModule.normalize(path)
Expand Down
7 changes: 6 additions & 1 deletion src/lib/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export class Status {
{
label: "Filen",
type: "normal",
icon: getTrayIcon(this.trayState),
icon: getTrayIcon({
isSyncing: false,
warningCount: 0,
notificationCount: 0,
errorCount: 0
}),
enabled: false
},
{
Expand Down
4 changes: 3 additions & 1 deletion src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export type DesktopAPI = {
isPathSyncedByICloud: (path: string) => Promise<boolean>
setMinimizeToTray: (minimizeToTray: boolean) => Promise<void>
setStartMinimized: (startMinimized: boolean) => Promise<void>
syncUpdateConfirmDeletion: (params: { uuid: string; result: "delete" | "restart" }) => Promise<void>
}

if (env.isBrowser || env.isElectron) {
Expand Down Expand Up @@ -224,6 +225,7 @@ if (env.isBrowser || env.isElectron) {
tryingToSyncDesktop: path => ipcRenderer.invoke("tryingToSyncDesktop", path),
isPathSyncedByICloud: path => ipcRenderer.invoke("isPathSyncedByICloud", path),
setMinimizeToTray: minimizeToTray => ipcRenderer.invoke("setMinimizeToTray", minimizeToTray),
setStartMinimized: startMinimized => ipcRenderer.invoke("setStartMinimized", startMinimized)
setStartMinimized: startMinimized => ipcRenderer.invoke("setStartMinimized", startMinimized),
syncUpdateConfirmDeletion: params => ipcRenderer.invoke("syncUpdateConfirmDeletion", params)
} satisfies DesktopAPI)
}
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export type WorkerInvokeChannel =
| "networkDriveStats"
| "syncUpdatePairs"
| "getLocalDirectoryItemCount"
| "syncUpdateConfirmDeletion"

export type WorkerMessage =
| {
Expand Down
9 changes: 4 additions & 5 deletions src/worker/networkDrive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,16 @@ export class NetworkDrive {
filenLogsPath()
])

const cachePath = pathModule.join(desktopConfig.networkDriveConfig.localDirPath, "cache")

this.networkDrive = new FilenNetworkDrive({
sdk,
mountPoint: desktopConfig.networkDriveConfig.mountPoint,
cachePath: desktopConfig.networkDriveConfig.cachePath
? pathModule.join(desktopConfig.networkDriveConfig.cachePath, "filenCache")
: pathModule.join(desktopConfig.networkDriveConfig.localDirPath, "cache"),
logFilePath: pathModule.join(logDir, "rclone.log"),
readOnly: desktopConfig.networkDriveConfig.readOnly,
cacheSize: desktopConfig.networkDriveConfig.cacheSizeInGi,
tryToInstallDependenciesOnStart: true,
disableLogging: false
disableLogging: false,
cachePath
})

await this.networkDrive.start()
Expand Down
20 changes: 11 additions & 9 deletions src/worker/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ export class Worker {

public async networkDriveAvailableCacheSize(): Promise<number> {
const desktopConfig = await this.waitForConfig()
const cachePath = desktopConfig.networkDriveConfig.cachePath
? pathModule.join(desktopConfig.networkDriveConfig.cachePath, "filenCache")
: pathModule.join(desktopConfig.networkDriveConfig.localDirPath, "cache")
const cachePath = pathModule.join(desktopConfig.networkDriveConfig.localDirPath, "cache")

await fs.ensureDir(cachePath)

Expand All @@ -114,9 +112,7 @@ export class Worker {

public async networkDriveCacheSize(): Promise<number> {
const desktopConfig = await this.waitForConfig()
const cachePath = desktopConfig.networkDriveConfig.cachePath
? pathModule.join(desktopConfig.networkDriveConfig.cachePath, "filenCache", "vfs")
: pathModule.join(desktopConfig.networkDriveConfig.localDirPath, "cache", "vfs")
const cachePath = pathModule.join(desktopConfig.networkDriveConfig.localDirPath, "cache", "vfs")

if (!(await fs.exists(cachePath))) {
return 0
Expand All @@ -142,9 +138,7 @@ export class Worker {

public async networkDriveCleanupCache(): Promise<void> {
const desktopConfig = await this.waitForConfig()
const cachePath = desktopConfig.networkDriveConfig.cachePath
? pathModule.join(desktopConfig.networkDriveConfig.cachePath, "filenCache")
: pathModule.join(desktopConfig.networkDriveConfig.localDirPath, "cache")
const cachePath = pathModule.join(desktopConfig.networkDriveConfig.localDirPath, "cache")

await fs.rm(cachePath, {
force: true,
Expand Down Expand Up @@ -481,6 +475,14 @@ export class Worker {
} catch (e) {
this.invokeError(message.data.id, message.data.channel, e instanceof Error ? e : new Error(JSON.stringify(e)))
}
} else if (message.data.channel === "syncUpdateConfirmDeletion") {
if (this.sync.active && this.sync.sync) {
const { uuid, result } = message.data.data

this.sync.sync.confirmDeletion(uuid, result)
}

this.invokeResponse(message.data.id, message.data.channel)
} else {
this.invokeError(message.data.id, message.data.channel, new Error(`Channel ${message.data.channel} not found.`))
}
Expand Down

0 comments on commit 7e2e5e4

Please sign in to comment.