Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d335f2e
build: update electron
vitonsky Sep 29, 2026
5543be9
docs: add instruction for debugging
vitonsky Sep 29, 2026
77cb530
perf: delay auto sync for next Idle
vitonsky Sep 29, 2026
20fde1b
test: organize files controller tests
vitonsky Sep 30, 2026
6aebf49
perf: upload file by chunks
vitonsky Sep 30, 2026
ba4b039
chore: ensure only one session per file
vitonsky Sep 30, 2026
d89b558
refactor: save chunks in fs with no buffering
vitonsky Sep 30, 2026
ad06a05
chore: hide tmp files
vitonsky Oct 1, 2026
a28af51
chore: limit filenames to create
vitonsky Oct 1, 2026
e848f74
chore: ignore special files
vitonsky Oct 1, 2026
d92d2c0
test: write cases
vitonsky Oct 1, 2026
3c72cf7
chore: restore backup file
vitonsky Oct 1, 2026
c53615e
chore: always restore
vitonsky Oct 1, 2026
cc01f55
chore: delete tmp files
vitonsky Oct 1, 2026
b1fc0e0
chore: handle write in directory
vitonsky Oct 1, 2026
12a2aa6
test: schedule via timeout in test environment
vitonsky Oct 1, 2026
1abfb5e
fix: remove backup files even if file is missed
vitonsky Oct 1, 2026
e9bfd52
fix: ensure rooted directory is under root
vitonsky Oct 1, 2026
5d402f3
refactor: use classes to express files storage
vitonsky Oct 1, 2026
8725967
chore: check session is not aborted after async ops
vitonsky Oct 1, 2026
12c8771
chore: normalize paths
vitonsky Oct 2, 2026
14910d7
fix: use mutex
vitonsky Oct 2, 2026
6919bf3
chore: don't throw error for abort calls
vitonsky Oct 2, 2026
0462dc2
chore: cleanup code
vitonsky Oct 2, 2026
c5adcb1
fix: handle stream errors
vitonsky Oct 2, 2026
803a81f
fix: remove mutex by usage counters
vitonsky Oct 2, 2026
b2f77f3
chore: retain cancelled session errors
vitonsky Oct 2, 2026
2f0181b
fix: check resolved paths
vitonsky Oct 2, 2026
bfa8257
chore: set deadline
vitonsky Oct 2, 2026
e90aa86
feat: support file streaming
vitonsky Oct 3, 2026
701e723
chore: remove buffer resizing
vitonsky Oct 3, 2026
70f7a51
fix: always close reader session
vitonsky Oct 5, 2026
b193162
chore: remove unused encryption interface
vitonsky Oct 5, 2026
f0d018f
fix: return nothing for directory fetching
vitonsky Oct 5, 2026
565a6fc
fix: proxy only string keys
vitonsky Oct 5, 2026
a8b9281
chore: remove unused method
vitonsky Oct 6, 2026
cb7277c
fix: update files listing for windows
vitonsky Oct 6, 2026
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
6 changes: 6 additions & 0 deletions docs/debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Debugging in browser

To run app in browser mode:
- run `npm run serve --workspace app`
- go to http://localhost:8080/window-main.html
- open console and enable IDB storage via command `localStorage.storageType = 'idb'`
110 changes: 43 additions & 67 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"copy-webpack-plugin": "^13.0.1",
"cross-env": "^10.1.0",
"css-loader": "^7.1.3",
"electron": "^39.8.2",
"electron": "^44.4.5",
"electron-devtools-installer": "^4.0.0",
"fork-ts-checker-webpack-plugin": "^9.1.0",
"html-webpack-plugin": "^5.6.6",
Expand Down
7 changes: 7 additions & 0 deletions packages/app/src/__tests__/utils/fs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-disable @typescript-eslint/no-base-to-string */
import { vol } from 'memfs';

export const readdir = (path: string) =>
vol
.readdirSync(path, { recursive: true })
.sort((a, b) => String(a).localeCompare(String(b)));
20 changes: 17 additions & 3 deletions packages/app/src/core/database/ManagedDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ export type Options = {
};
};

const requestRunOnIdle = (cb: () => void, deadline: number) => {
if (typeof globalThis.requestIdleCallback === 'function') {
globalThis.requestIdleCallback(cb, { timeout: deadline });
return;
}

setTimeout(cb, 0);
};

/**
* Class to manage database data synchronization
*/
Expand All @@ -61,9 +70,14 @@ export class ManagedDatabase<T> implements IManagedDatabase<T> {
this.dbFile = dbFile;

// Auto sync changes
this.debouncedSync = debounce(this.sync, {
wait: sync.delay,
});
this.debouncedSync = debounce(
() => {
requestRunOnIdle(() => this.sync(), sync.deadline);
},
{
wait: sync.delay,
},
);

this.cleanups.push(dbContainer.onChanged.watch(this.debouncedSync));
}
Expand Down
Loading
Loading