Skip to content

Commit 523d12e

Browse files
authored
Merge pull request #311 from intersystems/overwrite-server-popup
Don't show Failed to Import popup after overwriting the file on server once
2 parents 3d000b3 + 6d56765 commit 523d12e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- Support for git submodules in package manager-aware setting (#305)
1212
- Web UI's 'More ...' view shows longer branch names (#294)
1313
- Deletion of files in locked environment is now suppressed (#302)
14+
- Failed to import file VS Code popup no longer shows up after overwriting file on server once (#264)
1415

1516
## [2.3.0] - 2023-12-06
1617

cls/SourceControl/Git/Extension.cls

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,21 @@ Method OnBeforeLoad(InternalName As %String, verbose As %Boolean) As %Status
210210
/// Called before Studio checks for the timestamp of an item.
211211
Method OnBeforeTimestamp(InternalName As %String)
212212
{
213+
set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(InternalName)
214+
if $IsObject($Get(%request)) {
215+
set clientServerHash = ##class(%Atelier.REST).GetClientServerHash()
216+
if (clientServerHash '= "") {
217+
// suppress load / timestamp update if file on server was modified an extremely short time ago
218+
set file = ##class(SourceControl.Git.Utils).FullExternalName(InternalName)
219+
if (file '= "") {
220+
set lastModifiedTime = ##class(%Library.File).GetFileDateModified(file)
221+
set diff = $System.SQL.Functions.DATEDIFF("ms",lastModifiedTime,$h)
222+
if (diff < 1000) {
223+
quit
224+
}
225+
}
226+
}
227+
}
213228
quit ..OnBeforeLoad(InternalName,0)
214229
}
215230

@@ -351,4 +366,3 @@ Method AddToSourceControl(InternalName As %String, Description As %String = "")
351366
}
352367

353368
}
354-

0 commit comments

Comments
 (0)