From f6633e23f5b8116917073788f3b0c729352eda51 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 4 Dec 2017 23:01:22 +0000 Subject: [PATCH] Minor tweaks --- ReactNativeClient/lib/BaseApplication.js | 5 +++++ ReactNativeClient/lib/onedrive-api.js | 12 ++++++++++++ Tools/git-hooks/pre-commit-sh | 3 +-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ReactNativeClient/lib/BaseApplication.js b/ReactNativeClient/lib/BaseApplication.js index 165ac3fb2..fe9e92280 100644 --- a/ReactNativeClient/lib/BaseApplication.js +++ b/ReactNativeClient/lib/BaseApplication.js @@ -271,6 +271,11 @@ class BaseApplication { } } + // if (action.type === 'NOTE_DELETE') { + // // Update folders if a note is deleted in case the deleted note was a conflict + // await FoldersScreenUtils.refreshFolders(); + // } + if (this.hasGui() && action.type == 'SETTING_UPDATE_ONE' && action.key == 'sync.interval' || action.type == 'SETTING_UPDATE_ALL') { reg.setupRecurrentSync(); } diff --git a/ReactNativeClient/lib/onedrive-api.js b/ReactNativeClient/lib/onedrive-api.js index 247c3da92..87ab05b13 100644 --- a/ReactNativeClient/lib/onedrive-api.js +++ b/ReactNativeClient/lib/onedrive-api.js @@ -212,6 +212,18 @@ class OneDriveApi { // type: 'system', // errno: 'EAGAIN', // code: 'EAGAIN' } + this.logger().info('Got error below - retrying (' + i + ')...'); + this.logger().info(error); + await time.sleep((i + 1) * 3); + continue; + } else if (error && error.error && error.error.code === 'resourceModified') { + // NOTE: not tested, very hard to reproduce and non-informative error message, but can be repeated + + // Error: ETag does not match current item's value + // Code: resourceModified + // Header: {"_headers":{"cache-control":["private"],"transfer-encoding":["chunked"],"content-type":["application/json"],"request-id":["d...ea47"],"client-request-id":["d99...ea47"],"x-ms-ags-diagnostic":["{\"ServerInfo\":{\"DataCenter\":\"North Europe\",\"Slice\":\"SliceA\",\"Ring\":\"2\",\"ScaleUnit\":\"000\",\"Host\":\"AGSFE_IN_13\",\"ADSiteName\":\"DUB\"}}"],"duration":["96.9464"],"date":[],"connection":["close"]}} + // Request: PATCH https://graph.microsoft.com/v1.0/drive/root:/Apps/JoplinDev/f56c5601fee94b8085524513bf3e352f.md null "{\"fileSystemInfo\":{\"lastModifiedDateTime\":\"....\"}}" {"headers":{"Content-Type":"application/json","Authorization":"bearer ... + this.logger().info('Got error below - retrying (' + i + ')...'); this.logger().info(error); await time.sleep((i + 1) * 3); diff --git a/Tools/git-hooks/pre-commit-sh b/Tools/git-hooks/pre-commit-sh index c63796f6b..c065f7b7e 100644 --- a/Tools/git-hooks/pre-commit-sh +++ b/Tools/git-hooks/pre-commit-sh @@ -5,8 +5,7 @@ ROOT_DIR="$PWD" # If any README file has been changed, update the website -'README\|build-website' -git status -s | grep ' README\| build-website.js' > /dev/null +git status -s | grep ' README\| build-website.js' > /dev/null 2>&1 readmeStatus=$? if [ $readmeStatus -eq 0 ]; then node "$ROOT_DIR/Tools/build-website.js"