Skip to content

Prefetch data for file when onscreen

Justin Boyson requested to merge jdb/preload-diff-file into master

What does this MR do?

Relates to: #26693 (closed)

This MR quietly prefetches data for a diff file once it is visible onscreen. The idea is to make expanding diffs more responsive. Since some larger files can take several seconds to be fetched the user will be stuck waiting for a loading screen until the data is available.

Screenshots

Before with loading icon:

Screen_Recording_2020-03-01_at_11.37.53_PM

After no loading icon:

Screen_Recording_2020-03-01_at_11.40.27_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

One concern I have is the potential increased load on gitlab.com from extra "unnecessary" requests. This MR optimistically fetches data for files that may not be clicked on, therefore the data request is unnecessary. I lack the tools to determine how impactful this might be.

Merge request reports