mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-01 15:02:31 +00:00
Fixed:
- Fixed mishandling of removing duplicated queue on processing - Dependency importing
This commit is contained in:
@@ -28,6 +28,10 @@ export {
|
|||||||
request,
|
request,
|
||||||
getLanguage,
|
getLanguage,
|
||||||
ButtonComponent,
|
ButtonComponent,
|
||||||
|
TextComponent,
|
||||||
|
ToggleComponent,
|
||||||
|
DropdownComponent,
|
||||||
|
ValueComponent,
|
||||||
} from "obsidian";
|
} from "obsidian";
|
||||||
export type {
|
export type {
|
||||||
DataWriteOptions,
|
DataWriteOptions,
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ export class ReplicateResultProcessor {
|
|||||||
return;
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
// Remove from processing queue
|
// Remove from processing queue
|
||||||
this._processingChanges = this._processingChanges.filter((e) => e === change);
|
this._processingChanges = this._processingChanges.filter((e) => e !== change);
|
||||||
this.triggerTakeSnapshot();
|
this.triggerTakeSnapshot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { TFile, TFolder, type ListedFiles } from "obsidian";
|
import { TFile, TFolder, type ListedFiles } from "@/deps.ts";
|
||||||
import { SerializedFileAccess } from "./storageLib/SerializedFileAccess";
|
import { SerializedFileAccess } from "./storageLib/SerializedFileAccess";
|
||||||
import { AbstractObsidianModule } from "../AbstractObsidianModule.ts";
|
import { AbstractObsidianModule } from "../AbstractObsidianModule.ts";
|
||||||
import { LOG_LEVEL_INFO, LOG_LEVEL_VERBOSE } from "octagonal-wheels/common/logger";
|
import { LOG_LEVEL_INFO, LOG_LEVEL_VERBOSE } from "octagonal-wheels/common/logger";
|
||||||
|
|||||||
@@ -497,7 +497,7 @@ export class StorageEventManagerObsidian extends StorageEventManager {
|
|||||||
if (fei.type == "CREATE" || fei.type == "CHANGED") {
|
if (fei.type == "CREATE" || fei.type == "CHANGED") {
|
||||||
// 3.2. If true, set the queue, and wait for the waiting, or until timeout
|
// 3.2. If true, set the queue, and wait for the waiting, or until timeout
|
||||||
// (since is copied from previous waiting if exists to limit the maximum wait time)
|
// (since is copied from previous waiting if exists to limit the maximum wait time)
|
||||||
console.warn(`Since:`, previous?.since);
|
// console.warn(`Since:`, previous?.since);
|
||||||
const info = this._addWaiting(waitingKey, fei, previous?.since);
|
const info = this._addWaiting(waitingKey, fei, previous?.since);
|
||||||
waitPromise = info.canProceed.promise;
|
waitPromise = info.canProceed.promise;
|
||||||
} else if (fei.type == "DELETE") {
|
} else if (fei.type == "DELETE") {
|
||||||
@@ -531,7 +531,7 @@ export class StorageEventManagerObsidian extends StorageEventManager {
|
|||||||
"storage-event-manager-snapshot"
|
"storage-event-manager-snapshot"
|
||||||
);
|
);
|
||||||
if (snapShot && Array.isArray(snapShot) && snapShot.length > 0) {
|
if (snapShot && Array.isArray(snapShot) && snapShot.length > 0) {
|
||||||
console.warn(`Restoring snapshot: ${snapShot.length} items`);
|
// console.warn(`Restoring snapshot: ${snapShot.length} items`);
|
||||||
Logger(`Restoring storage operation snapshot: ${snapShot.length} items`, LOG_LEVEL_VERBOSE);
|
Logger(`Restoring storage operation snapshot: ${snapShot.length} items`, LOG_LEVEL_VERBOSE);
|
||||||
// Restore the snapshot
|
// Restore the snapshot
|
||||||
// Note: Mark all items as skipBatchWait to prevent apply the off-line batch saving.
|
// Note: Mark all items as skipBatchWait to prevent apply the off-line batch saving.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { LOG_LEVEL_INFO, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "octagonal-w
|
|||||||
import { eventHub } from "../../common/events";
|
import { eventHub } from "../../common/events";
|
||||||
import { getWebCrypto } from "../../lib/src/mods.ts";
|
import { getWebCrypto } from "../../lib/src/mods.ts";
|
||||||
import { uint8ArrayToHexString } from "octagonal-wheels/binary/hex";
|
import { uint8ArrayToHexString } from "octagonal-wheels/binary/hex";
|
||||||
import { parseYaml, requestUrl, stringifyYaml } from "obsidian";
|
import { parseYaml, requestUrl, stringifyYaml } from "@/deps.ts";
|
||||||
import type { FilePath } from "../../lib/src/common/types.ts";
|
import type { FilePath } from "../../lib/src/common/types.ts";
|
||||||
import { scheduleTask } from "octagonal-wheels/concurrency/task";
|
import { scheduleTask } from "octagonal-wheels/concurrency/task";
|
||||||
import { getFileRegExp } from "../../lib/src/common/utils.ts";
|
import { getFileRegExp } from "../../lib/src/common/utils.ts";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
ButtonComponent,
|
ButtonComponent,
|
||||||
type TextAreaComponent,
|
type TextAreaComponent,
|
||||||
type ValueComponent,
|
type ValueComponent,
|
||||||
} from "obsidian";
|
} from "@/deps.ts";
|
||||||
import { unique } from "octagonal-wheels/collection";
|
import { unique } from "octagonal-wheels/collection";
|
||||||
import {
|
import {
|
||||||
LEVEL_ADVANCED,
|
LEVEL_ADVANCED,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { App } from "obsidian";
|
import { App } from "@/deps.ts";
|
||||||
import ObsidianLiveSyncPlugin from "@/main";
|
import ObsidianLiveSyncPlugin from "@/main";
|
||||||
import { DEFAULT_SETTINGS, type ObsidianLiveSyncSettings } from "@/lib/src/common/types";
|
import { DEFAULT_SETTINGS, type ObsidianLiveSyncSettings } from "@/lib/src/common/types";
|
||||||
import { LOG_LEVEL_VERBOSE, setGlobalLogFunction } from "@lib/common/logger";
|
import { LOG_LEVEL_VERBOSE, setGlobalLogFunction } from "@lib/common/logger";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { beforeAll, describe, expect, it, test } from "vitest";
|
import { beforeAll, describe, expect, it, test } from "vitest";
|
||||||
import { generateHarness, waitForIdle, waitForReady, type LiveSyncHarness } from "../harness/harness";
|
import { generateHarness, waitForIdle, waitForReady, type LiveSyncHarness } from "../harness/harness";
|
||||||
import { TFile } from "obsidian";
|
import { TFile } from "@/deps.ts";
|
||||||
import { DEFAULT_SETTINGS, type FilePath, type ObsidianLiveSyncSettings } from "@/lib/src/common/types";
|
import { DEFAULT_SETTINGS, type FilePath, type ObsidianLiveSyncSettings } from "@/lib/src/common/types";
|
||||||
import { isDocContentSame, readContent } from "@/lib/src/common/utils";
|
import { isDocContentSame, readContent } from "@/lib/src/common/utils";
|
||||||
import { DummyFileSourceInisialised, generateBinaryFile, generateFile, init } from "../utils/dummyfile";
|
import { DummyFileSourceInisialised, generateBinaryFile, generateFile, init } from "../utils/dummyfile";
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { checkStoredFileInDB, testFileRead, testFileWrite } from "./db_common";
|
|||||||
import { delay } from "@/lib/src/common/utils";
|
import { delay } from "@/lib/src/common/utils";
|
||||||
import { commands } from "vitest/browser";
|
import { commands } from "vitest/browser";
|
||||||
import { closeReplication, performReplication, prepareRemote } from "./sync_common";
|
import { closeReplication, performReplication, prepareRemote } from "./sync_common";
|
||||||
import type { DataWriteOptions } from "obsidian";
|
import type { DataWriteOptions } from "@/deps.ts";
|
||||||
|
|
||||||
type MTimedDataWriteOptions = DataWriteOptions & { mtime: number };
|
type MTimedDataWriteOptions = DataWriteOptions & { mtime: number };
|
||||||
export type TestOptions = {
|
export type TestOptions = {
|
||||||
|
|||||||
Reference in New Issue
Block a user