.
This commit is contained in:
parent
d799a1da0c
commit
24a8def394
4 changed files with 7 additions and 3 deletions
|
|
@ -301,6 +301,11 @@ export class Database {
|
||||||
);
|
);
|
||||||
|
|
||||||
let newDocument = this.getLatestDocumentByRelativePath(newRelativePath);
|
let newDocument = this.getLatestDocumentByRelativePath(newRelativePath);
|
||||||
|
if (newDocument !== undefined && !newDocument.isDeleted) {
|
||||||
|
throw new Error(
|
||||||
|
`Document already exists at new location: ${newRelativePath}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// It's either an invalid state of newDocument is pending deletion and we have
|
// It's either an invalid state of newDocument is pending deletion and we have
|
||||||
// to wait for it to complete.
|
// to wait for it to complete.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import { Syncer } from "../sync-operations/syncer";
|
|
||||||
import { Settings } from "../persistence/settings";
|
import { Settings } from "../persistence/settings";
|
||||||
import { Logger } from "../tracing/logger";
|
import { Logger } from "../tracing/logger";
|
||||||
import { createPromise } from "../utils/create-promise";
|
import { createPromise } from "../utils/create-promise";
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export function hash(content: Uint8Array): string {
|
||||||
result = (result << 5) - result + content[i];
|
result = (result << 5) - result + content[i];
|
||||||
result |= 0; // Convert to 32bit integer
|
result |= 0; // Convert to 32bit integer
|
||||||
}
|
}
|
||||||
return Math.abs(result).toString(16);
|
return Math.abs(result).toString(16).padStart(8, "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EMPTY_HASH = hash(new Uint8Array(0));
|
export const EMPTY_HASH = hash(new Uint8Array(0));
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ async function runTest({
|
||||||
async function runTests(): Promise<void> {
|
async function runTests(): Promise<void> {
|
||||||
const agentCounts = [2, 8];
|
const agentCounts = [2, 8];
|
||||||
const jitterScaleInSeconds = [0.5, 0, 2];
|
const jitterScaleInSeconds = [0.5, 0, 2];
|
||||||
const concurrencies = [16, 1];
|
const concurrencies = [1];
|
||||||
const iterations = [50, 200];
|
const iterations = [50, 200];
|
||||||
const doDeletes = [true, false];
|
const doDeletes = [true, false];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue