Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 508428

Summary: Running 'git log' on an untracked file makes Orion load forever
Product: [ECD] Orion Reporter: Remy Suen <remy.suen>
Component: GitAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: steve_northover
Version: 12.0   
Target Milestone: 14.0   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Remy Suen CLA 2016-11-30 04:53:23 EST
1. Create an untracked file.
2. Select it > Open context menu > Open Related > Git Log
3. Now you will see Orion spin forever.

Note that there is nothing in the browser console.

This happens on both orion.eclipse.org and OrionHub.
Comment 1 Remy Suen CLA 2017-02-04 06:09:28 EST
I spent some time today debugging this and I finally got to the bottom of it.

While we can most certainly fix this particular problem, I feel like maybe there is something more we can do in our Deferred API to handle this kind of thing. The fact that nothing even gets logged in the console is disconcerting in my opinion...

TypeError: Cannot read property 'Name' of undefined
    at GitCommitListModel.getId (http://localhost:8081/orion/git/widgets/gitCommitList.js:361:32)
    at ExplorerNavHandler.getSelectionIds (http://localhost:8081/orion/explorers/explorerNavHandler.js:481:25)
    at GitCommitListRenderer.storeSelections (http://localhost:8081/orion/explorers/explorer.js:660:54)
    at ExplorerNavHandler.setSelection (http://localhost:8081/orion/explorers/explorerNavHandler.js:310:28)
    at GitCommitListExplorer.select (http://localhost:8081/orion/explorers/explorer.js:270:16)
    at http://localhost:8081/orion/git/gitRepositoryExplorer.js:747:16
    at Array.forEach (native)
    at GitRepositoryExplorer.<anonymous> (http://localhost:8081/orion/git/gitRepositoryExplorer.js:746:19)
    at settleDeferred (http://localhost:8081/orion/Deferred.js:70:28)
    at notify (http://localhost:8081/orion/Deferred.js:144:18)

FYI Steve since this is another bug that will lead the user to stare at the spinning splash screen forever much like bug 508142.
Comment 2 Steve Northover CLA 2017-02-05 07:58:15 EST
Remy, do you want to fix the particular problem?

Question: Is this another case of code not providing an error handler when using the deferred API?
Comment 3 Remy Suen CLA 2017-02-06 08:12:10 EST
In case anyone's trying this offline (I doubt anyone is), you can't reproduce this if you're offline due to interactions with other Git service calls.

(In reply to Steve Northover from comment #2)
> Question: Is this another case of code not providing an error handler when
> using the deferred API?

It doesn't seem to be that straightforward. I (think I) assigned error handlers to print to the console but nothing's happening so the exception's gone off somewhere else I think.
Comment 4 Remy Suen CLA 2017-02-08 04:40:46 EST
(In reply to Steve Northover from comment #2)
> Remy, do you want to fix the particular problem?

This particular problem is now fixed.

https://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=c655064fa82ed3b83452f5f8afce6c6a69c7e9a4

> Question: Is this another case of code not providing an error handler when
> using the deferred API?

However, this other issue should probably be addressed in a separate bug.