richdocuments
richdocuments copied to clipboard
Avoid updating storage stats on open locally
When opening locally the storage stats fetching of the files app might fail with a NS_BINDING_ABORTED error on firefox as the window.location change will trigger a page navigation attempt so the browser would kill the request. This leads to an error that users see.
Can easily be reproduced with the following patch:
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php
index 285857c9a19..7a1fe74fd15 100644
--- a/apps/files/lib/Controller/ApiController.php
+++ b/apps/files/lib/Controller/ApiController.php
@@ -268,6 +268,7 @@ class ApiController extends Controller {
*/
public function getStorageStats($dir = '/'): JSONResponse {
$storageInfo = \OC_Helper::getStorageInfo($dir ?: '/');
+ sleep(5);
return new JSONResponse(['message' => 'ok', 'data' => $storageInfo]);
}