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

Bug 515530

Summary: [node] Tagging a commit with an existing tag name causes two responses to be sent back
Product: [ECD] Orion Reporter: Grant Gayed <grant_gayed>
Component: NodeAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: remy.suen
Version: unspecified   
Target Milestone: 15.0   
Hardware: All   
OS: All   
Whiteboard:

Description Grant Gayed CLA 2017-04-20 11:37:39 EDT
On the Git page try to tag a commit twice with the identical tag name.  The first one works but the second displays:

Uncaught Exception:
Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:344:11)
    at setResponseNoCache (/Users/grantgayed/Desktop/Orion.app/Contents/Resources/app.asar/lib/api.js:91:7)
    at writeResponse (/Users/grantgayed/Desktop/Orion.app/Contents/Resources/app.asar/lib/api.js:80:4)
    at /Users/grantgayed/Desktop/Orion.app/Contents/Resources/app.asar/lib/git/commit.js:956:3
    at tryCallOne (/Users/grantgayed/Desktop/Orion.app/Contents/Resources/app.asar/node_modules/nodegit/node_modules/promisify-node/node_modules/nodegit-promise/lib/core.js:37:12)
    at /Users/grantgayed/Desktop/Orion.app/Contents/Resources/app.asar/node_modules/nodegit/node_modules/promisify-node/node_modules/nodegit-promise/lib/core.js:103:15
    at flush (/Users/grantgayed/Desktop/Orion.app/Contents/Resources/app.asar/node_modules/nodegit/node_modules/promisify-node/node_modules/nodegit-promise/node_modules/asap/raw.js:50:29)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
Comment 1 Grant Gayed CLA 2017-04-20 11:39:24 EDT
The comment 0 trace is from Electron.  The error is not as in-your-face at orion.eclipse.org but is still there.
Comment 2 Grant Gayed CLA 2017-04-20 13:55:50 EDT
(In reply to Grant Gayed from comment #1)

Actually it's worse, it apparently brings down the server.
Comment 3 Remy Suen CLA 2017-04-20 17:28:13 EDT
Reproduced on Windows 10. Based on the code, I think this has been broken for a long time.

https://github.com/eclipse/orion.client/commit/f21c2625b2e23849d09dc516dbf14ab4fef6fcd1
Comment 4 Remy Suen CLA 2017-04-21 06:37:50 EDT
Fix pushed to master.

https://github.com/eclipse/orion.client/commit/8ca95b92dc5c3ca8023b2c046aceb120902b7d97

Thanks for reporting this crash, Grant! :)
Comment 5 Grant Gayed CLA 2017-04-21 10:07:21 EDT
@remy Thanks for the fix!