diff --git a/core/core.js b/core/core.js index f8aada0a..8261aa13 100644 --- a/core/core.js +++ b/core/core.js @@ -498,13 +498,17 @@ async function blobHandler(request, response, blobId, uri) { (credentials.permissions.administration && user == 'core'))) { var database = new Database(user); var apps = new Set(); + let apps_original = database.get('apps'); try { - apps = new Set(JSON.parse(database.get('apps'))); + apps = new Set(JSON.parse(apps_original)); } catch { } if (!apps.has(appName)) { apps.add(appName); - database.set('apps', JSON.stringify([...apps])); + } + apps = JSON.stringify([...apps].sort()); + if (apps != apps_original) { + database.set('apps', apps); } database.set('path:' + appName, newBlobId); } else {