[BUGFIX] Race-condition while updating extension list
authorSteffen Gebert <steffen.gebert@typo3.org>
Sat, 8 Oct 2011 22:18:16 +0000 (00:18 +0200)
committerSteffen Gebert <steffen.gebert@typo3.org>
Mon, 10 Oct 2011 20:31:29 +0000 (22:31 +0200)
There is a race-condition in the EM while updating the extension list.

If the update takes more than 30 seconds, Ext.Direct reaches its Ajax
timeout and sends the Ajax request (to update the list) again. As the EM
updates the extensions.xml.gz file at the beginning of the update
process, the second request immediately sees that the repository is
already up-to-date and respons this status to the client.

Thus, the user gets a "Repository is already up-to-date" message shown,
although it was not.

Change-Id: I2bc6b83f0951e16b895607025c2d3bad392b9759
Resolves: #30673
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/5641
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Kay Strobach
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/em/res/js/em_repositorylist.js

index d4d1a44..450396b 100644 (file)
@@ -388,6 +388,8 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                        return;
                }
                var record = this.repositoryStore.getAt(index - 1);
+                       // This is hard stuff to do. So increase the timeout for the AJAX request
+               Ext.Ajax.timeout = 900000;
                TYPO3.EM.ExtDirect.repositoryUpdate(index, function(response) {
                        if (!response.success) {
                                if (response.rep == 0) {