Compare commits

...

4 Commits

Author SHA1 Message Date
vorotamoroz
748d031b36 bump 2023-02-21 09:13:19 +09:00
vorotamoroz
dbe77718c8 Urgent:
- The modified document will be reflected in the storage now.
2023-02-21 09:12:14 +09:00
vorotamoroz
f334974cc3 bump 2023-02-20 17:58:14 +09:00
vorotamoroz
8f2ae437c6 Fixed:
- Now reading error will be reported.
2023-02-20 17:54:57 +09:00
6 changed files with 35 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
{
"id": "obsidian-livesync",
"name": "Self-hosted LiveSync",
"version": "0.17.24",
"version": "0.17.26",
"minAppVersion": "0.9.12",
"description": "Community implementation of self-hosted livesync. Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.",
"author": "vorotamoroz",

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "obsidian-livesync",
"version": "0.17.24",
"version": "0.17.26",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "obsidian-livesync",
"version": "0.17.24",
"version": "0.17.26",
"license": "MIT",
"dependencies": {
"diff-match-patch": "^1.0.5",

View File

@@ -1,6 +1,6 @@
{
"name": "obsidian-livesync",
"version": "0.17.24",
"version": "0.17.26",
"description": "Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.",
"main": "main.js",
"type": "module",

Submodule src/lib updated: e4d825ae13...fbb3fcd8b4

View File

@@ -1399,7 +1399,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
}
return;
}
const localMtime = ~~(file?.stat?.mtime || 0 / 1000);
const localMtime = ~~((file?.stat?.mtime || 0) / 1000);
const docMtime = ~~(docEntry.mtime / 1000);
const doc = await this.localDatabase.getDBEntry(pathSrc, { rev: docEntry._rev });
@@ -2714,7 +2714,13 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
Logger(`Reading : ${file.path}`, LOG_LEVEL.VERBOSE);
const contentBin = await this.app.vault.readBinary(file);
Logger(`Processing: ${file.path}`, LOG_LEVEL.VERBOSE);
content = await arrayBufferToBase64(contentBin);
try {
content = await arrayBufferToBase64(contentBin);
} catch (ex) {
Logger(`The file ${file.path} could not be encoded`);
Logger(ex, LOG_LEVEL.VERBOSE);
return false;
}
datatype = "newnote";
} else {
content = await this.app.vault.read(file);
@@ -2722,7 +2728,14 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
}
} else {
if (cache instanceof ArrayBuffer) {
content = await arrayBufferToBase64(cache);
Logger(`Processing: ${file.path}`, LOG_LEVEL.VERBOSE);
try {
content = await arrayBufferToBase64(cache);
} catch (ex) {
Logger(`The file ${file.path} could not be encoded`);
Logger(ex, LOG_LEVEL.VERBOSE);
return false;
}
datatype = "newnote"
} else {
content = cache;
@@ -3071,7 +3084,14 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
async storeInternalFileToDatabase(file: InternalFileInfo, forceWrite = false) {
const id = filename2idInternalMetadata(path2id(file.path));
const contentBin = await this.app.vault.adapter.readBinary(file.path);
const content = await arrayBufferToBase64(contentBin);
let content: string[];
try {
content = await arrayBufferToBase64(contentBin);
} catch (ex) {
Logger(`The file ${file.path} could not be encoded`);
Logger(ex, LOG_LEVEL.VERBOSE);
return false;
}
const mtime = file.mtime;
return await runWithLock("file-" + id, false, async () => {
try {

View File

@@ -63,5 +63,11 @@
- No longer error caused at plug-in being loaded.
- Improved:
- Caching chunks are now limited in total size of cached chunks.
- 0.17.25
- Fixed:
- Now reading error will be reported.
- 0.17.26
- Fixed(Urgent):
- The modified document will be reflected in the storage now.
... To continue on to `updates_old.md`.