vscode-codeql
vscode-codeql copied to clipboard
Implement streaming for compare view
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
toand at most 1,000fromresults 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.