Parent directory continues loading after navigating to child directory
Summary
When a repository contains a directory that has many sub-directories, the sub-directories are loaded in batches of 25 while viewing the tree in the browser. If you click into one of those sub-directories before all the sub-directories have finished loading, the UI continues loading the parent directory and does not show you the proper contents of the sub-directory.
The workaround is to allow everything to fully load before clicking into a sub-directory.
Potentially related to #211366 (closed)
Steps to reproduce
- Have a directory in a repository containing many sub-folders.
- Navigate to the large folder in the tree within the browser.
- Before the large folder fully loads, click any of the sub-folders.
- The parent directory contents are displayed.
Example Project
@kevenhughes was able to replicate for me with this project: https://gitlab.com/kevenhughes/fibz
- Click on folder "foo" https://gitlab.com/kevenhughes/fibz/-/tree/master/foo
- Before it finishes loading click on any sub-folder.
What is the current bug behavior?
The tree view continues displaying the parent directory contents as they load despite the fact you've navigated to a sub-folder.
What is the expected correct behavior?
The parent directory stops loading, and the contents of the sub-folder are displayed when you click on it.
Relevant logs and/or screenshots
None available
Output of checks
This bug happens on GitLab.com
None available for self-managed.
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)