Merge "ActiveUsersPager: Fix ordering and return 0-action users"
[lhc/web/wiklou.git] / resources / src / startup / mediawiki.js
index 65cf316..28f57db 100644 (file)
                         * @param {string[]} batch
                         */
                        function batchRequest( batch ) {
-                               var reqBase, splits, maxQueryLength, b, bSource, bGroup,
+                               var reqBase, splits, b, bSource, bGroup,
                                        source, group, i, modules, sourceLoadScript,
                                        currReqBase, currReqBaseLength, moduleMap, currReqModules, l,
                                        lastDotIndex, prefix, suffix, bytesAdded;
                                        lang: mw.config.get( 'wgUserLanguage' ),
                                        debug: mw.config.get( 'debug' )
                                };
-                               maxQueryLength = mw.config.get( 'wgResourceLoaderMaxQueryLength', 2000 );
 
                                // Split module list by source and by group.
                                splits = Object.create( null );
                                                                modules[ i ].length + 3; // '%7C'.length == 3
 
                                                        // If the url would become too long, create a new one, but don't create empty requests
-                                                       if ( maxQueryLength > 0 && currReqModules.length && l + bytesAdded > maxQueryLength ) {
+                                                       if ( currReqModules.length && l + bytesAdded > mw.loader.maxQueryLength ) {
                                                                // Dispatch what we've got...
                                                                doRequest();
                                                                // .. and start again.
                                                                moduleMap = Object.create( null );
                                                                currReqModules = [];
 
-                                                               mw.track( 'resourceloader.splitRequest', { maxQueryLength: maxQueryLength } );
+                                                               mw.track( 'resourceloader.splitRequest', { maxQueryLength: mw.loader.maxQueryLength } );
                                                        }
                                                        if ( !moduleMap[ prefix ] ) {
                                                                moduleMap[ prefix ] = [];
                                 */
                                moduleRegistry: registry,
 
+                               /**
+                                * Exposed for testing and debugging only.
+                                *
+                                * @see #batchRequest
+                                * @property
+                                * @private
+                                */
+                               maxQueryLength: $VARS.maxQueryLength,
+
                                /**
                                 * @inheritdoc #newStyleTag
                                 * @method
                                                                return;
                                                        }
                                                } catch ( e ) {
-                                                       mw.trackError( 'resourceloader.exception', {
-                                                               exception: e,
-                                                               source: 'store-localstorage-init'
-                                                       } );
+                                                       // Perhaps localStorage was disabled by the user, or got corrupted.
+                                                       // See point 3 and 4 below. (T195647)
                                                }
 
                                                // If we get here, one of four things happened: