commit
c9d7a86a27
11 changed files with 32 additions and 14 deletions
8
backend/Cargo.lock
generated
8
backend/Cargo.lock
generated
|
|
@ -1479,7 +1479,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "reconcile"
|
||||
version = "0.0.18"
|
||||
version = "0.0.19"
|
||||
dependencies = [
|
||||
"insta",
|
||||
"pretty_assertions",
|
||||
|
|
@ -1489,7 +1489,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "reconcile-fuzz"
|
||||
version = "0.0.18"
|
||||
version = "0.0.19"
|
||||
dependencies = [
|
||||
"libfuzzer-sys",
|
||||
"reconcile",
|
||||
|
|
@ -2104,7 +2104,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sync_lib"
|
||||
version = "0.0.18"
|
||||
version = "0.0.19"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"console_error_panic_hook",
|
||||
|
|
@ -2117,7 +2117,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sync_server"
|
||||
version = "0.0.18"
|
||||
version = "0.0.19"
|
||||
dependencies = [
|
||||
"aide",
|
||||
"anyhow",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "reconcile-fuzz"
|
||||
version = "0.0.18"
|
||||
version = "0.0.19"
|
||||
publish = false
|
||||
edition = "2021"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "reconcile"
|
||||
version = "0.0.18"
|
||||
version = "0.0.19"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "sync_lib"
|
||||
version = "0.0.18"
|
||||
version = "0.0.19"
|
||||
authors = ["Andras Schmelczer <andras@schmelczer.dev>"]
|
||||
edition = "2018"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "sync_server"
|
||||
version = "0.0.18"
|
||||
version = "0.0.19"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "vault-link",
|
||||
"name": "VaultLink",
|
||||
"version": "0.0.18",
|
||||
"version": "0.0.19",
|
||||
"minAppVersion": "0.0.0",
|
||||
"description": "Self-hosted synchronization and collaboration for your Vault.",
|
||||
"author": "Andras Schmelczer",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "vault-link",
|
||||
"name": "VaultLink",
|
||||
"version": "0.0.18",
|
||||
"version": "0.0.19",
|
||||
"minAppVersion": "0.0.0",
|
||||
"description": "Self-hosted synchronization and collaboration for your Vault.",
|
||||
"author": "Andras Schmelczer",
|
||||
|
|
|
|||
6
plugin/package-lock.json
generated
6
plugin/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "vault-link-obsidian-plugin",
|
||||
"version": "0.0.18",
|
||||
"version": "0.0.19",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "vault-link-obsidian-plugin",
|
||||
"version": "0.0.18",
|
||||
"version": "0.0.19",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
},
|
||||
"../backend/sync_lib/pkg": {
|
||||
"name": "sync_lib",
|
||||
"version": "0.0.18",
|
||||
"version": "0.0.19",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vault-link-obsidian-plugin",
|
||||
"version": "0.0.18",
|
||||
"version": "0.0.19",
|
||||
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -9,28 +9,40 @@ export class ObsidianFileOperations implements FileOperations {
|
|||
|
||||
public async listAllFiles(): Promise<RelativePath[]> {
|
||||
console.log("before getFiles");
|
||||
await sleep(1000);
|
||||
|
||||
const files = this.vault.getFiles();
|
||||
console.log("after getFiles");
|
||||
await sleep(1000);
|
||||
|
||||
console.log(files);
|
||||
return files.map((file) => file.path);
|
||||
}
|
||||
|
||||
public async read(path: RelativePath): Promise<Uint8Array> {
|
||||
console.log("before readBinary");
|
||||
await sleep(1000);
|
||||
|
||||
const result = new Uint8Array(
|
||||
await this.vault.adapter.readBinary(normalizePath(path))
|
||||
);
|
||||
console.log("after readBinary");
|
||||
await sleep(1000);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async getModificationTime(path: RelativePath): Promise<Date> {
|
||||
console.log("before stat");
|
||||
await sleep(1000);
|
||||
|
||||
const file = await this.vault.adapter.stat(normalizePath(path));
|
||||
if (!file) {
|
||||
throw new Error(`File not found: ${path}`);
|
||||
}
|
||||
console.log("after stat");
|
||||
await sleep(1000);
|
||||
|
||||
return new Date(file.mtime);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -300,13 +300,17 @@ export class Syncer {
|
|||
`Document metadata not found for ${relativePath}. This implies a corrupt local database. Consider resetting the plugin's sync history.`
|
||||
);
|
||||
}
|
||||
await sleep(1000);
|
||||
console.log("about to read", relativePath);
|
||||
await sleep(1000);
|
||||
|
||||
const contentBytes = await this.operations.read(relativePath);
|
||||
console.log("has read", relativePath);
|
||||
await sleep(1000);
|
||||
|
||||
let contentHash = hash(contentBytes);
|
||||
console.log("has hashed", relativePath);
|
||||
await sleep(1000);
|
||||
|
||||
if (
|
||||
localMetadata.hash === contentHash &&
|
||||
|
|
@ -322,6 +326,7 @@ export class Syncer {
|
|||
}
|
||||
|
||||
console.log("about to send", relativePath);
|
||||
await sleep(1000);
|
||||
|
||||
const response = await this.syncService.put({
|
||||
documentId: localMetadata.documentId,
|
||||
|
|
@ -332,6 +337,7 @@ export class Syncer {
|
|||
});
|
||||
|
||||
console.log("has sent", relativePath);
|
||||
await sleep(1000);
|
||||
|
||||
this.history.addHistoryEntry({
|
||||
status: SyncStatus.SUCCESS,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue