Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/2 3 0 release #523

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "internxt-drive",
"version": "2.2.1",
"version": "2.3.0",
"author": "Internxt <[email protected]>",
"description": "Internxt Drive client UI",
"license": "AGPL-3.0",
Expand Down Expand Up @@ -203,7 +203,7 @@
"detect-port": "^1.3.0",
"dotenv": "^10.0.0",
"dotenv-webpack": "^7.0.3",
"electron": "^25.8.1",
"electron": "^27.3.11",
"electron-builder": "^23.6.0",
"electron-devtools-installer": "^3.2.0",
"electron-notarize": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "internxt-drive",
"version": "2.2.1",
"version": "2.3.0",
"description": "Internxt Drive client UI",
"main": "./dist/main/main.js",
"author": "Internxt <[email protected]>",
Expand Down
27 changes: 17 additions & 10 deletions src/apps/backups/Backups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,10 @@

const { added, deleted } = diff;

const deleteFolder = await this.deleteRemoteFolders(
deleted,
abortController
);
const deleteFolder = this.deleteRemoteFolders(deleted, abortController);

Logger.debug('[BACKUPS] start upload', deleted.length);
const uploadFolder = await this.uploadAndCreateFolder(
const uploadFolder = this.uploadAndCreateFolder(
local.root.path,
added,
remote
Expand Down Expand Up @@ -290,12 +287,22 @@
continue;
}

const folder = await this.simpleFolderCreator.run(
relativePath,
parent.id
);
try {
const folder = await this.simpleFolderCreator.run(

Check warning on line 291 in src/apps/backups/Backups.ts

View workflow job for this annotation

GitHub Actions / 🧪 Lint and test

Unexpected `await` inside a loop
relativePath,
parent.id
);

tree.addFolder(parent, folder);
tree.addFolder(parent, folder);
} catch (error) {
Logger.error('[BACKUPS] Error creating folder', error);
if (error instanceof DriveDesktopError) {
Logger.error('[BACKUPS] Error creating folder', {
cause: error.cause,
});
throw error;
}
}

this.backed++;
BackupsIPCRenderer.send('backups.progress-update', this.backed);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Logger from 'electron-log';
import { ContainerBuilder } from 'diod';
import { FileBatchUpdater } from '../../../../context/local/localFile/application/update/FileBatchUpdater';
import { LocalFileHandler } from '../../../../context/local/localFile/domain/LocalFileUploader';
Expand All @@ -23,6 +24,9 @@
encryptionKey: mnemonic,
});

Logger.info('Registering local file services');
Logger.info('User', user);

builder.register(Environment).useInstance(environment).private();

builder
Expand All @@ -32,7 +36,7 @@
new EnvironmentLocalFileUploader(
c.get(Environment),
user.backupsBucket,
//@ts-ignore

Check warning on line 39 in src/apps/backups/dependency-injection/local/registerLocalFileServices.ts

View workflow job for this annotation

GitHub Actions / 🧪 Lint and test

Do not use "@ts-ignore" because it alters compilation errors
c.get(AuthorizedClients).drive
)
)
Expand Down
2 changes: 1 addition & 1 deletion src/apps/main/analytics/drive-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ ipcMainDrive.on('FILE_DOWNLOAD_ERROR', (_, payload) => {
trackError('Download Error', new Error(error), {
itemType: 'File',
root: '',
from: name,
from: name || 'Unknown',
action: 'Download',
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const backupsConfig = new BackupConfiguration();

export function setupBackupConfig(): BackupConfiguration {
ipcMain.handle('get-backups-interval', () => {
Logger.debug('Getting backup interval', backupsConfig.backupInterval);
return backupsConfig.backupInterval;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ export class BackupScheduler {
return;
}

BackupScheduler.schedule = setTimeout(
() => this.runAndScheduleNext(),
millisecondsToNextBackup
);
BackupScheduler.schedule = setTimeout(() => {
this.runAndScheduleNext();
}, millisecondsToNextBackup);
}

private millisecondsToNextBackup(): number {
Expand All @@ -54,7 +53,10 @@ export class BackupScheduler {
return;
}

BackupScheduler.schedule = setTimeout(() => this.task(), this.interval());
BackupScheduler.schedule = setTimeout(
() => this.runAndScheduleNext(),
this.interval()
);
}

private lastBackupIsSet(): boolean {
Expand Down
6 changes: 5 additions & 1 deletion src/apps/main/device/handlers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Logger from 'electron-log';
import { ipcMain } from 'electron';

import {
Expand Down Expand Up @@ -39,7 +40,10 @@ ipcMain.handle('delete-backups-from-device', (_, v, c?) =>

ipcMain.handle('disable-backup', (_, v) => disableBackup(v));

ipcMain.handle('download-backup', (_, v) => downloadBackup(v));
ipcMain.handle('download-backup', (_, v, fd) => {
Logger.info('Downloading backup', v, fd);
downloadBackup(v, fd);
});

ipcMain.handle('change-backup-path', (_, v) => changeBackupPath(v));

Expand Down
Loading
Loading