Asch/test #2
12 changed files with 29 additions and 17 deletions
8
backend/Cargo.lock
generated
8
backend/Cargo.lock
generated
|
|
@ -1479,7 +1479,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reconcile"
|
name = "reconcile"
|
||||||
version = "0.0.17"
|
version = "0.0.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"insta",
|
"insta",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
|
|
@ -1489,7 +1489,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reconcile-fuzz"
|
name = "reconcile-fuzz"
|
||||||
version = "0.0.17"
|
version = "0.0.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libfuzzer-sys",
|
"libfuzzer-sys",
|
||||||
"reconcile",
|
"reconcile",
|
||||||
|
|
@ -2104,7 +2104,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sync_lib"
|
name = "sync_lib"
|
||||||
version = "0.0.17"
|
version = "0.0.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"console_error_panic_hook",
|
"console_error_panic_hook",
|
||||||
|
|
@ -2117,7 +2117,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sync_server"
|
name = "sync_server"
|
||||||
version = "0.0.17"
|
version = "0.0.18"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aide",
|
"aide",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "reconcile-fuzz"
|
name = "reconcile-fuzz"
|
||||||
version = "0.0.17"
|
version = "0.0.18"
|
||||||
publish = false
|
publish = false
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "reconcile"
|
name = "reconcile"
|
||||||
version = "0.0.17"
|
version = "0.0.18"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sync_lib"
|
name = "sync_lib"
|
||||||
version = "0.0.17"
|
version = "0.0.18"
|
||||||
authors = ["Andras Schmelczer <andras@schmelczer.dev>"]
|
authors = ["Andras Schmelczer <andras@schmelczer.dev>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sync_server"
|
name = "sync_server"
|
||||||
version = "0.0.17"
|
version = "0.0.18"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "vault-link",
|
"id": "vault-link",
|
||||||
"name": "VaultLink",
|
"name": "VaultLink",
|
||||||
"version": "0.0.17",
|
"version": "0.0.18",
|
||||||
"minAppVersion": "0.0.0",
|
"minAppVersion": "0.0.0",
|
||||||
"description": "Self-hosted synchronization and collaboration for your Vault.",
|
"description": "Self-hosted synchronization and collaboration for your Vault.",
|
||||||
"author": "Andras Schmelczer",
|
"author": "Andras Schmelczer",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "vault-link",
|
"id": "vault-link",
|
||||||
"name": "VaultLink",
|
"name": "VaultLink",
|
||||||
"version": "0.0.17",
|
"version": "0.0.18",
|
||||||
"minAppVersion": "0.0.0",
|
"minAppVersion": "0.0.0",
|
||||||
"description": "Self-hosted synchronization and collaboration for your Vault.",
|
"description": "Self-hosted synchronization and collaboration for your Vault.",
|
||||||
"author": "Andras Schmelczer",
|
"author": "Andras Schmelczer",
|
||||||
|
|
|
||||||
6
plugin/package-lock.json
generated
6
plugin/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "vault-link-obsidian-plugin",
|
"name": "vault-link-obsidian-plugin",
|
||||||
"version": "0.0.17",
|
"version": "0.0.18",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "vault-link-obsidian-plugin",
|
"name": "vault-link-obsidian-plugin",
|
||||||
"version": "0.0.17",
|
"version": "0.0.18",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
},
|
},
|
||||||
"../backend/sync_lib/pkg": {
|
"../backend/sync_lib/pkg": {
|
||||||
"name": "sync_lib",
|
"name": "sync_lib",
|
||||||
"version": "0.0.17",
|
"version": "0.0.18",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "vault-link-obsidian-plugin",
|
"name": "vault-link-obsidian-plugin",
|
||||||
"version": "0.0.17",
|
"version": "0.0.18",
|
||||||
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
|
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,10 @@ export class ObsidianFileEventHandler implements FileEventHandler {
|
||||||
|
|
||||||
public async onModify(file: TAbstractFile): Promise<void> {
|
public async onModify(file: TAbstractFile): Promise<void> {
|
||||||
if (file instanceof TFile) {
|
if (file instanceof TFile) {
|
||||||
|
if (file.basename.startsWith("console-log.iPhone")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.getInstance().info(`File modified: ${file.path}`);
|
Logger.getInstance().info(`File modified: ${file.path}`);
|
||||||
|
|
||||||
await this.syncer.syncLocallyUpdatedFile({
|
await this.syncer.syncLocallyUpdatedFile({
|
||||||
|
|
|
||||||
|
|
@ -8,21 +8,29 @@ export class ObsidianFileOperations implements FileOperations {
|
||||||
public constructor(private readonly vault: Vault) {}
|
public constructor(private readonly vault: Vault) {}
|
||||||
|
|
||||||
public async listAllFiles(): Promise<RelativePath[]> {
|
public async listAllFiles(): Promise<RelativePath[]> {
|
||||||
|
console.log("before getFiles");
|
||||||
const files = this.vault.getFiles();
|
const files = this.vault.getFiles();
|
||||||
|
console.log("after getFiles");
|
||||||
|
console.log(files);
|
||||||
return files.map((file) => file.path);
|
return files.map((file) => file.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async read(path: RelativePath): Promise<Uint8Array> {
|
public async read(path: RelativePath): Promise<Uint8Array> {
|
||||||
return new Uint8Array(
|
console.log("before readBinary");
|
||||||
|
const result = new Uint8Array(
|
||||||
await this.vault.adapter.readBinary(normalizePath(path))
|
await this.vault.adapter.readBinary(normalizePath(path))
|
||||||
);
|
);
|
||||||
|
console.log("after readBinary");
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getModificationTime(path: RelativePath): Promise<Date> {
|
public async getModificationTime(path: RelativePath): Promise<Date> {
|
||||||
|
console.log("before stat");
|
||||||
const file = await this.vault.adapter.stat(normalizePath(path));
|
const file = await this.vault.adapter.stat(normalizePath(path));
|
||||||
if (!file) {
|
if (!file) {
|
||||||
throw new Error(`File not found: ${path}`);
|
throw new Error(`File not found: ${path}`);
|
||||||
}
|
}
|
||||||
|
console.log("after stat");
|
||||||
return new Date(file.mtime);
|
return new Date(file.mtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ export class SyncService {
|
||||||
|
|
||||||
Logger.getInstance().debug(
|
Logger.getInstance().debug(
|
||||||
`Created document ${JSON.stringify(
|
`Created document ${JSON.stringify(
|
||||||
response.data.relativePath
|
response.data
|
||||||
)} with id ${response.data.documentId}`
|
)} with id ${response.data.documentId}`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ export class SyncService {
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.getInstance().debug(
|
Logger.getInstance().debug(
|
||||||
`Updated document ${response.data.relativePath} with id ${response.data.documentId}`
|
`Updated document ${JSON.stringify(response.data)} with id ${response.data.documentId}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return response.data;
|
return response.data;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue