Skip to content

search streaming: remove preview from event API

Administrator requested to merge backend-dry-run/cc/remove-preview into main

Created by: camdencheek

This PR removes line previews from search result events streamed to the client.

Preview is only used client-side behind a dev-only flag that uses it as an alternative to using the highlighted code. The dev-only flag appears to be pretty broken, so I removed it under the assumption that it's not used. In either case, I don't think a dev-only flag is reason enough to justify sending the match contents every time.

This PR goes as far as removing references to Preview in client-side code (only used in types, tests and the dev feature), and removing it from the frontend -> client API. Further work can be done to remove it from the backend LineMatch and all downstream producers of the preview (such as in searcher). This further work will likely be the more valuable, since we currently pay the overhead of serialization for these line matches even when they're never sent to the client because the display limit is hit.

As a ballpark number on how much difference this makes, for the search repo:github.com/sourcegraph/sourcegraph$ todo(, the stream request now transfers 57KB versus the 696KB on main for a 91% reduction.

Progresses #23982 (closed)

Merge request reports

Loading