tnesbitt210 / interactive-smartlog-issues

12 stars 0 forks source link

Extension or plugin is unresponsive on load more branches #6

Open jcjp opened 8 months ago

jcjp commented 8 months ago

Description

Extension or plugin is unresponsive after clicking the button load more branches twice. Oldest branch shown is in 2 months, after that it would either infinite load, hide the button or show a modal where visual studio code is stuck.

Initial load:

Initial

After loading more branches twice:

Tail branches

Developer tools:

Developer tools

Visual studio modal:

Modal

Additional details

Exact error & trace

Remove some details for brevity, for the specific branch it's my branch with -backup.

Environment / OS:

Debug Info:

commitsError:

Error: `git rev-parse <specific-branch>` returned empty
    at ro.revParse (...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:525327)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:538:9)
    at process.processTimers (node:internal/timers:512:7)
    at async Ru.getCommitInfosOnBranch (...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:571791)
    at async Promise.all (index 19)
    at async Ru.getCommitInfos (...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:570143)
    at async Ru.getResultAsync (...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:572602)
    at async Promise.all (index 1)
    at async ...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:563229

commitTreesLength: 29

uncommittedChangesLength: 0

outputChannelContents:

Setup analytics, session:  dafd...
Operating System: win32 10.0.22631
IGL Version: 0.0.77
Loading repo info...
establish client connection for <location>
[track] ClientConnection  
Loading repo info...
Loaded repo info
Cached repo info
Loaded repo info
Cached repo info
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
[track] InitialFetchSmartlogCommits  {"numCommits":11,"numPublicCommits":9,"numBranches":10,"watchmanInstalled":false,"brewInstalled":false}
[track] CommitTreesLoaded  
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
[track] LoadMoreCommits  {"daysToFetch":60}
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
Loading commits success
Sending commits to client
Fetching commits...
[track] LoadMoreCommits  {"daysToFetch":"Infinity"}
Loading commits failure
Sending commits to client
Fetching commits...
[track] TopLevelErrorShown CommitsFetchError 
[error] TopLevelErrorShown CommitsFetchError Error: `git rev-parse <specific-branch>` returned empty
    at ro.revParse (...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:525327)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:538:9)
    at process.processTimers (node:internal/timers:512:7)
    at async Ru.getCommitInfosOnBranch (...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:571791)
    at async Promise.all (index 19)
    at async Ru.getCommitInfos (...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:570143)
    at async Ru.getResultAsync (...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:572602)
    at async Promise.all (index 1)
    at async ...interactive-smartlog.interactive-smartlog-0.0.77\dist\extension.js:2:563229
tnesbitt210 commented 8 months ago

Thanks so much for this report @jcjp ! I wonder if this same rev-parse error could be causing some crashes that others have reported to me. For context, git rev-parse translates git references (like branches) into hash values.

I've got a few questions that should help me figure out where to focus my debugging:

  1. When you execute git rev-parse <specific-branch> manually (in your command line), what's the output? Is it an error (if so, what's the error)? Is it a hash? Is there no output at all?
  2. Same as question 1, but for the command git rev-parse refs/heads/<specific-branch> ?
  3. How old is the branch? (you can use git log <specific-branch> to find the time of its most recent commit)
  4. Is there interesting/unique about the branch this is happening for? Some examples of that might be "interesting":
    • The branch name has special characters (if so, what are those characters?)
    • The branch is a remote branch
    • The branch was created with git checkout --orphan
    • The branch shares its name with another reference in the repo (like a tag, which can be found via git tag)
jcjp commented 8 months ago

Here are some of the results of the command you mentioned:

  1. git rev-parse <specific-branch> returns a hash
  2. git rev-parse refs/heads/<specific-branch> returns the same hash similar to the from previous command
  3. git log <specific-branch> it's latest commit is on March 19, 2024
  4. a. The only thing unique is we use / and - e.g. sample/name-of-branch b. Local only already deleted remotely c. We don't use git checkout --orphan but I think this is branched out from another branch vs from our main branch d. No it's not reference in a git tag we only have one tag at the moment I usually add -backup or -v2 to make it unique
tnesbitt210 commented 8 months ago

Ok, I just pushed v0.0.78. Previously , I was using an npm module called simple-git to execute rev-parse, but now I'm executing it manually, and logging the output if rev-parse doesn't output a valid hash.

Hopefully it's either fixed, or we get some more information about what's going on based on the updated logging.

jcjp commented 8 months ago

Ok, I just pushed v0.0.78. Previously , I was using an npm module called simple-git to execute rev-parse, but now I'm executing it manually, and logging the output if rev-parse doesn't output a valid hash.

Hopefully it's either fixed, or we get some more information about what's going on based on the updated logging.

Okay I updated th extension and tried it, loads faster than before. However after loading 60 days worth of branches / commits no issues at this point. Next would be loading infinity worth of branches / commits I think this is where it hangs up, our branches / commits are more than 4 years worth maybe that's why it's taking too long to process.

I just realized that the rev-parse error is now gone it only shows the {daysToLoad: infinity} if I got it correct. No new errors log on developer tools and also can't get the debug info since it won't allow me to copy the details since it's getting stuck cursor is turning to a disabled cursor.

tnesbitt210 commented 8 months ago

The debug info just grabs logs from the "output" panel. Do you see anything there?

image

jcjp commented 8 months ago

Wil try again and will let you know, unfortunately I can't interact with most of the buttons in visual studio code when it happens. I'll have the debug tab open before I do my testing.

tnesbitt210 commented 8 months ago

Sounds good, and give it a try with 0.0.79. I removed some suspicious code, and I added more logs.

jcjp commented 8 months ago

Okay I was able to look into the output tab, not sure if it's still loading or should it be completed since it already logged this once.

Fetching commits...
Loading commits success
Sending commits to client

But still continues to log the same continously even if the popup / modal from visual code shows up or it gets stuck.

tnesbitt210 commented 7 months ago

log the same continuously

Do you mean that these 3 lines keep logging repeatedly, over and over? If so, that's interesting. How frequently do they repeat? Like once per second? Once per minute? Is it just happening on one specific repo, or is it happening on all repos?

Also... if you don't click "load more branches", then does everything work as expected? Are you able to do things like commit, stage/unstage files, etc?

Thanks again for your help , and I'll look into this in the coming days.

jcjp commented 7 months ago

log the same continuously

Do you mean that these 3 lines keep logging repeatedly, over and over? If so, that's interesting. How frequently do they repeat? Like once per second? Once per minute? Is it just happening on one specific repo, or is it happening on all repos?

Also... if you don't click "load more branches", then does everything work as expected? Are you able to do things like commit, stage/unstage files, etc?

Thanks again for your help , and I'll look into this in the coming days.

Yes those 3 lines keep repeating every second/s it logs those 3. I haven't tried deeply interacting with it like stage or unstage files but I think it works well on the initial loads of the commit. I can try on my other big repos that has a long history of commits let me see if I can find one.

tnesbitt210 commented 7 months ago

Sounds good, thanks. I'd suggest trying on the latest version (v0.0.84), because I made some performance improvements. But I suspect those won't fix the issue.

Right now, I'm actually suspecting that this might be a memory issue. That could explain why VSCode starts freezing up, and why it only happens when you load your entire repo history. I wonder if there's some way to validate that on your end by looking at memory usage?

jcjp commented 7 months ago

Alright updated the extension and tried it on the repo with issues. It loads the commit hash faster but you are correct still loads the three lines continuously as you mentioned. I monitored my RAM usage via Windows key + G (Xbox game bar?) utilization is at 53% and on Taskmanager memory is at 59%. I have 32GB of physical memory.

tnesbitt210 commented 7 months ago

Hey @jcjp , I've put in a lot of performance optimizations over the past couple of weeks. They weren't specifically intended to fix the issue you're having, but I wonder if they might've had an effect.

Can you try version 0.1.4 and let me know if this is still happening? Thanks!

jcjp commented 7 months ago

Hey @jcjp , I've put in a lot of performance optimizations over the past couple of weeks. They weren't specifically intended to fix the issue you're having, but I wonder if they might've had an effect.

Can you try version 0.1.4 and let me know if this is still happening? Thanks!

I tried and still have the same behavior, although this time it shows the modal consistently. I am on version 0.1.5. Does it happen to others or is it only on my side or Windows? To me it only happens when I try to load more than 2 months worth of commits.

tyler-macinnis commented 3 months ago

It happens to me as well, just tried the extension today and same issue.