diff --git a/CliClient/app/app.js b/CliClient/app/app.js index e0a3554645..7efa2d412d 100644 --- a/CliClient/app/app.js +++ b/CliClient/app/app.js @@ -307,7 +307,7 @@ class Application { let CommandClass = null; try { - CommandClass = require('./command-' + name + '.js'); + CommandClass = require(__dirname + '/command-' + name + '.js'); } catch (error) { let e = new Error('No such command: ' + name); e.type = 'notFound'; diff --git a/CliClient/locales/en_GB.po b/CliClient/locales/en_GB.po index 2b1552612f..3ac444da8e 100644 --- a/CliClient/locales/en_GB.po +++ b/CliClient/locales/en_GB.po @@ -260,9 +260,6 @@ msgstr "" msgid "Starting synchronisation..." msgstr "" -msgid "Done." -msgstr "" - msgid "Cancelling... Please wait." msgstr "" diff --git a/CliClient/locales/fr_FR.po b/CliClient/locales/fr_FR.po index 16b375ab10..f4fd3d9d4f 100644 --- a/CliClient/locales/fr_FR.po +++ b/CliClient/locales/fr_FR.po @@ -289,9 +289,6 @@ msgstr "Impossible d'initialiser la synchronisation." msgid "Starting synchronisation..." msgstr "Commencement de la synchronisation..." -msgid "Done." -msgstr "Terminé." - #, fuzzy msgid "Cancelling... Please wait." msgstr "Annulation..." @@ -621,6 +618,9 @@ msgstr "" msgid "Welcome" msgstr "Bienvenue" +#~ msgid "Done." +#~ msgstr "Terminé." + #~ msgid "" #~ "Please open this URL in your browser to authenticate the application:" #~ msgstr "" diff --git a/CliClient/locales/joplin.pot b/CliClient/locales/joplin.pot index 2b1552612f..3ac444da8e 100644 --- a/CliClient/locales/joplin.pot +++ b/CliClient/locales/joplin.pot @@ -260,9 +260,6 @@ msgstr "" msgid "Starting synchronisation..." msgstr "" -msgid "Done." -msgstr "" - msgid "Cancelling... Please wait." msgstr "" diff --git a/CliClient/package.json b/CliClient/package.json index 9f06b779ba..40874bc207 100644 --- a/CliClient/package.json +++ b/CliClient/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/laurent22/joplin" }, "url": "git://github.com/laurent22/joplin.git", - "version": "0.9.2", + "version": "0.9.5", "bin": { "joplin": "./main.js" }, @@ -38,7 +38,8 @@ "string-to-stream": "^1.1.0", "tcp-port-used": "^0.1.2", "uuid": "^3.0.1", - "yargs-parser": "^7.0.0" + "yargs-parser": "^7.0.0", + "word-wrap": "^1.2.3" }, "devDependencies": { "babel-changed": "^7.0.0", @@ -50,8 +51,7 @@ "babel-preset-es2015": "^6.1.4", "babel-preset-react": "^6.24.1", "gettext-parser": "^1.2.2", - "jasmine": "^2.6.0", - "word-wrap": "^1.2.3" + "jasmine": "^2.6.0" }, "scripts": { "babelbuild": "babel app -d build", diff --git a/CliClient/package.json.md5 b/CliClient/package.json.md5 index 8bf18979cd..0ac822133a 100644 --- a/CliClient/package.json.md5 +++ b/CliClient/package.json.md5 @@ -1 +1 @@ -f38a6c5d97ddbb027b0d6e28d14545c8 \ No newline at end of file +26731ba0d38727c6c362b6d042517888 \ No newline at end of file diff --git a/CliClient/run.sh b/CliClient/run.sh index 99ab605ed9..403269014c 100755 --- a/CliClient/run.sh +++ b/CliClient/run.sh @@ -2,6 +2,6 @@ set -e CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes2 --stack-trace-enabled --log-level debug --env dev "$@" -#bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes import-enex --fuzzy-matching /home/laurent/Desktop/afaire.enex afaire -#bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes import-enex --fuzzy-matching /home/laurent/Desktop/Laurent.enex laurent \ No newline at end of file +#bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --profile ~/Temp/TestNotes2 --stack-trace-enabled --log-level debug --env dev "$@" + +bash $CLIENT_DIR/build.sh && NODE_PATH="$CLIENT_DIR/build/" node build/main.js --stack-trace-enabled --log-level debug "$@" diff --git a/ReactNativeClient/android/app/build.gradle b/ReactNativeClient/android/app/build.gradle index 69b88ef393..425e42d93f 100644 --- a/ReactNativeClient/android/app/build.gradle +++ b/ReactNativeClient/android/app/build.gradle @@ -90,8 +90,8 @@ android { applicationId "net.cozic.joplin" minSdkVersion 16 targetSdkVersion 22 - versionCode 41 - versionName "0.9.28" + versionCode 43 + versionName "0.9.30" ndk { abiFilters "armeabi-v7a", "x86" } diff --git a/ReactNativeClient/lib/file-api-driver-onedrive.js b/ReactNativeClient/lib/file-api-driver-onedrive.js index 9874e5d664..29c261ff82 100644 --- a/ReactNativeClient/lib/file-api-driver-onedrive.js +++ b/ReactNativeClient/lib/file-api-driver-onedrive.js @@ -7,6 +7,7 @@ class FileApiDriverOneDrive { constructor(api) { this.api_ = api; + this.pathCache_ = {}; } api() { @@ -19,7 +20,7 @@ class FileApiDriverOneDrive { itemFilter_() { return { - select: 'name,file,folder,fileSystemInfo', + select: 'name,file,folder,fileSystemInfo,parentReference', } } @@ -173,6 +174,13 @@ class FileApiDriverOneDrive { throw new Error('Not implemented'); } + async pathDetails_(path) { + if (this.pathCache_[path]) return this.pathCache_[path]; + let output = await this.api_.execJson('GET', path); + this.pathCache_[path] = output; + return this.pathCache_[path]; + } + async delta(path, options = null) { let output = { hasMore: false, @@ -180,6 +188,9 @@ class FileApiDriverOneDrive { items: [], }; + let pathDetails = await this.pathDetails_(path); + const pathId = pathDetails.id; + let context = options ? options.context : null; let url = context ? context.nextLink : null; let query = null; @@ -191,7 +202,23 @@ class FileApiDriverOneDrive { } let response = await this.api_.execJson('GET', url, query); - let items = this.makeItems_(response.value); + let items = []; + + // The delta API might return things that happen in subdirectories of the root and we don't want to + // deal with these since all the files we're interested in are at the root (The .resource dir + // is special since it's managed directly by the clients and resources never change - only the + // associated .md file at the root is synced). So in the loop below we check that the parent is + // indeed the root, otherwise the item is skipped. + // (Not sure but it's possible the delta API also returns events for files that are copied outside + // of the app directory and later deleted or modified. We also don't want to deal with + // these files during sync). + + for (let i = 0; i < response.value.length; i++) { + const v = response.value[i]; + if (v.parentReference.id !== pathId) continue; + items.push(this.makeItem_(v)); + } + output.items = output.items.concat(items); let nextLink = null;