Ver Fonte

Remove WebClientService.immediateChunksPending (#633)

This has been superseded by the explicit message acknowledgement.
Lennart Grahl há 6 anos atrás
pai
commit
ea00f2814e
2 ficheiros alterados com 2 adições e 26 exclusões
  1. 0 10
      src/controllers/status.ts
  2. 2 16
      src/services/webclient.ts

+ 0 - 10
src/controllers/status.ts

@@ -293,16 +293,6 @@ export class StatusController {
                 };
             }
 
-            // ... if there are one or more cached chunks that require immediate
-            //     sending.
-            const immediateChunksPending = this.webClientService.immediateChunksPending;
-            if (immediateChunksPending > 0) {
-                return {
-                    send: true,
-                    reason: `${immediateChunksPending} chunks that require acknowledgement`,
-                };
-            }
-
             // ... otherwise, don't push!
             return {
                 send: false,

+ 2 - 16
src/services/webclient.ts

@@ -348,20 +348,6 @@ export class WebClientService {
         return this.typingInstance;
     }
 
-    /**
-     * Return the amount of chunks cached from a previous connection that
-     * require immediate sending.
-     */
-    get immediateChunksPending(): number {
-        // TODO: Apply the chunk **push** blacklist instead of the chunk cache
-        //       blacklist!
-        if (this.previousChunkCache === null) {
-            return 0;
-        } else {
-            return this.previousChunkCache.chunks.length;
-        }
-    }
-
     /**
      * Return the amount of unacknowledged wire messages.
      */
@@ -757,7 +743,7 @@ export class WebClientService {
         this.$log.debug(`Chunk cache pruned, acknowledged: ${result.acknowledged}, left: ${result.left}, size: ` +
             `${size} -> ${this.previousChunkCache.byteLength}`);
         if (this.config.MSG_DEBUGGING) {
-            this.$log.debug(`Chunks that require acknowledgement: ${this.immediateChunksPending}`);
+            this.$log.debug(`Chunks that require acknowledgement: ${this.previousChunkCache.chunks.length}`);
         }
 
         // Transfer the cache (filters chunks which should not be retransmitted)
@@ -3772,7 +3758,7 @@ export class WebClientService {
             throw new Error(`Cannot send chunk, not supported by task: ${this.chosenTask}`);
         }
         const shouldQueue = canQueue && this.previousChunkCache !== null;
-        let chunkCache;
+        let chunkCache: ChunkCache;
 
         // Enqueue in the chunk cache that is pending to be transferred and
         // send a wakeup push.