You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-27 23:28:38 +02:00
All: Fixes #5051: Fixed error that could prevent a revision from being created, and that would prevent the revision service from processing the rest of the notes
This commit is contained in:
@ -17,7 +17,7 @@ import FileApiDriverJoplinServer from '../file-api-driver-joplinServer';
|
||||
import OneDriveApi from '../onedrive-api';
|
||||
import SyncTargetOneDrive from '../SyncTargetOneDrive';
|
||||
import JoplinDatabase from '../JoplinDatabase';
|
||||
const fs = require('fs-extra');
|
||||
import * as fs from 'fs-extra';
|
||||
const { DatabaseDriverNode } = require('../database-driver-node.js');
|
||||
import Folder from '../models/Folder';
|
||||
import Note from '../models/Note';
|
||||
@ -101,8 +101,8 @@ const supportDir = `${oldTestDir}/support`;
|
||||
const dataDir = `${oldTestDir}/test data/${suiteName_}`;
|
||||
const profileDir = `${dataDir}/profile`;
|
||||
|
||||
fs.mkdirpSync(logDir, 0o755);
|
||||
fs.mkdirpSync(baseTempDir, 0o755);
|
||||
fs.mkdirpSync(logDir);
|
||||
fs.mkdirpSync(baseTempDir);
|
||||
fs.mkdirpSync(dataDir);
|
||||
fs.mkdirpSync(profileDir);
|
||||
|
||||
@ -392,10 +392,10 @@ async function setupDatabaseAndSynchronizer(id: number, options: any = null) {
|
||||
DecryptionWorker.instance_ = null;
|
||||
|
||||
await fs.remove(resourceDir(id));
|
||||
await fs.mkdirp(resourceDir(id), 0o755);
|
||||
await fs.mkdirp(resourceDir(id));
|
||||
|
||||
await fs.remove(pluginDir(id));
|
||||
await fs.mkdirp(pluginDir(id), 0o755);
|
||||
await fs.mkdirp(pluginDir(id));
|
||||
|
||||
if (!synchronizers_[id]) {
|
||||
const SyncTargetClass = SyncTargetRegistry.classById(syncTargetId_);
|
||||
@ -512,7 +512,7 @@ async function initFileApi() {
|
||||
let fileApi = null;
|
||||
if (syncTargetId_ == SyncTargetRegistry.nameToId('filesystem')) {
|
||||
fs.removeSync(syncDir);
|
||||
fs.mkdirpSync(syncDir, 0o755);
|
||||
fs.mkdirpSync(syncDir);
|
||||
fileApi = new FileApi(syncDir, new FileApiDriverLocal());
|
||||
} else if (syncTargetId_ == SyncTargetRegistry.nameToId('memory')) {
|
||||
fileApi = new FileApi('/root', new FileApiDriverMemory());
|
||||
@ -788,6 +788,21 @@ async function waitForFolderCount(count: number) {
|
||||
}
|
||||
}
|
||||
|
||||
let naughtyStrings_: string[] = null;
|
||||
export async function naughtyStrings() {
|
||||
if (naughtyStrings_) return naughtyStrings_;
|
||||
const t = await fs.readFile(`${supportDir}/big-list-of-naughty-strings.txt`, 'utf8');
|
||||
const lines = t.split('\n');
|
||||
naughtyStrings_ = [];
|
||||
for (const line of lines) {
|
||||
const trimmed = line.trim();
|
||||
if (!trimmed) continue;
|
||||
if (trimmed.indexOf('#') === 0) continue;
|
||||
naughtyStrings_.push(line);
|
||||
}
|
||||
return naughtyStrings_;
|
||||
}
|
||||
|
||||
// TODO: Update for Jest
|
||||
|
||||
// function mockDate(year, month, day, tick) {
|
||||
|
Reference in New Issue
Block a user