[go: up one dir, main page]

Skip to content

Frontend loads all logs_tree entries even when list of tree entries is paginated

When a repository tree has thousands of files/subdirectories, the frontend will continually try to load all logs_tree data until it finishes. As seen in https://gitlab.com/gitlab-org/gitlab/blob/792e349390327fa11721e2f744cafec3b05f51f4/app/assets/javascripts/repository/log_tree.js#L60, if the More-Logs-Offset HTTP header is present, the frontend will try to attempt to load in batches of 25, which can amount to hundreds of requests:

image

There is a Show more button, but this implies that not all contents have been loaded in the first place!

image

@iamphill As the last person who touched that code 2 years ago, do you know if it was intentional to load the entire tree into display? @sming-gitlab Is there an easy way to short-circuit this and only load more if Show more is clicked?

This came out of research in gitaly#3445 (closed).

Edited by Stan Hu