vscode-codeql icon indicating copy to clipboard operation
vscode-codeql copied to clipboard

Implement streaming for compare view

Open koesie10 opened this issue 1 year ago • 0 comments

This implements streaming for the compare view to avoid a crash when the total JSON.stringified size of the comparison is larger than 1GB (i.e. the Node.js string limit). It does this as follows:

  • All results are chunked into 1,000 results per message. This means we'll send at most 1,000 to and at most 1,000 from results in 1 message (i.e. 2,000 actual results).
  • We'll send a "setup" message to tell the webview that we're starting a streaming result. This also contains a chunk.
  • We'll then send as many "add results" messages as necessary to send all results.
  • We'll send a "complete" message to tell the webview that we're done.

The 1,000 results per message is just a safe estimate where we should never run into the string limit. However, I can't really test this.

koesie10 avatar Oct 22 '24 12:10 koesie10