I was wondering if core should provide some utility functions specially regarding ajax requests. In general, there is no control on how ajax requests are submitted, leading to some issues such as https://github.com/owncloud/core/pull/25080 and https://github.com/owncloud/core/pull/25903 .
There is one in files_externals (https://github.com/owncloud/core/blob/master/apps/files_external/js/rollingqueue.js) to run a list of requests limiting the maximum number of requests that are run at the same time, which might be useful to run a big number of requests in a more rational manner. It might need some improvements to handle a large amount of requests, but it's the starting point. We should take into consideration to make something similar (probably an improved version) available for core.
There could be another utility to handle the requests in a kind of priority queue manner. When a request comes in, if it belongs to the queue being run it will be launched immediately, but if not it will be queued to be run later. This could be used as read / write locks or could provide serialization of Ajax requests.
I think those are a couple of nice utilities that can be reused in core and in any other app, and can provide an advanced management of requests and also provide a simple interface to use those utilities.