Skip to content

Commit 61c6832

Browse files
committed
lock changed as desired
1 parent 92c5751 commit 61c6832

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
### Fixed
2525
- Modifications to local repo files are now synced with IRIS (#153)
2626
- Menu items names are properly translated from internal name in VSCode, Management Portal (#372)
27+
- Now has proper locking behavior in `##class(SourceControl.Git.WebUIDriver).HandleRequest()`(#385)
2728

2829
## [2.3.1] - 2024-04-30
2930

cls/SourceControl/Git/WebUIDriver.cls

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Class SourceControl.Git.WebUIDriver
33

44
ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Output handled As %Boolean = 0, Output %data As %Stream.Object)
55
{
6-
do %session.Unlock()
76
// Make sure we capture any stray output
87
set buffer = ##class(SourceControl.Git.Util.Buffer).%New()
98
do buffer.BeginCaptureOutput()
@@ -13,6 +12,7 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
1312
#dim %request as %CSP.Request
1413
set pathStart = $piece(pagePath,"/",2)
1514
if pathStart = "api" {
15+
do %session.Unlock()
1616
set handled = 1
1717
set %data = ##class(%Stream.FileCharacter).%New()
1818
if $extract(pagePath,6,*) = "userinfo" {
@@ -42,6 +42,7 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
4242
SimpleHTTPRequestHandler.do_GET(self)
4343
*/
4444
if (pathStart = "git") {
45+
do %session.Unlock()
4546
if $piece(pagePath,"/",3) = "cat-file" {
4647
set blob = $piece(pagePath,"/",4)
4748
set name = $Piece(pagePath,"/",*)
@@ -107,6 +108,10 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
107108
}
108109
set readOnlyCommands = $listbuild("branch","tag","log","ls-files","ls-tree","show","status","diff")
109110
set baseCommand = $Piece(args(1)," ")
111+
112+
if '$listfind(readOnlyCommands,baseCommand) {
113+
do %session.Unlock()
114+
}
110115

111116
set gitArgs($increment(gitArgs)) = "color.ui=true"
112117

0 commit comments

Comments
 (0)