Closed alexjg closed 2 years ago
Thanks! I recently changed the logic to load the PR changed files lazily which means that we are no longer going to try to run too many of these jobs at the same time, and therefore we can get rid of this flawed concurrency control.
Issue Description
I'm trying out".
octo.nvim
to review this PR. Calling:Octo review resume
(having already started a review and encountered this bug) opens the PR window fine with a split showing the diff and a quicklist of the other files in the diff. Selecting another file hangs for 5 seconds and then an error saying "Timeout fetchingI did some digging into this. The files are available locally (
pull_request.local_{left | right}
are notnil
inFileEntry:fetch()
) so the fetch logic spawns some Plenary jobs to get the local files viagit show
inutils.get_file_at_commit
. The relevant code is:If there is a
local_last_get_file_job
then we just set the new job as theon_exit_callback
of the current job. I think the logic of thislast_get_file_job
may be wrong. I think if thelast_get_file_job
has already completed when we calland_then
then the next job will never get executed (the on exit callback of the previous job was already executed). If I remove thelocal_last_get_file_job
logic via this diff then the problem goes away:I haven't put in a PR for this because I don't know what the purpose of this logic is, is it to bound concurrency in some manner?