diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ce8cbb9..609f3585 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support for git submodules in package manager-aware setting (#305) - Web UI's 'More ...' view shows longer branch names (#294) - Deletion of files in locked environment is now suppressed (#302) +- Failed to import file VS Code popup no longer shows up after overwriting file on server once (#264) ## [2.3.0] - 2023-12-06 diff --git a/cls/SourceControl/Git/Extension.cls b/cls/SourceControl/Git/Extension.cls index 1674fcc1..c89e3365 100644 --- a/cls/SourceControl/Git/Extension.cls +++ b/cls/SourceControl/Git/Extension.cls @@ -210,6 +210,21 @@ Method OnBeforeLoad(InternalName As %String, verbose As %Boolean) As %Status /// Called before Studio checks for the timestamp of an item. Method OnBeforeTimestamp(InternalName As %String) { + set context = ##class(SourceControl.Git.PackageManagerContext).ForInternalName(InternalName) + if $IsObject($Get(%request)) { + set clientServerHash = ##class(%Atelier.REST).GetClientServerHash() + if (clientServerHash '= "") { + // suppress load / timestamp update if file on server was modified an extremely short time ago + set file = ##class(SourceControl.Git.Utils).FullExternalName(InternalName) + if (file '= "") { + set lastModifiedTime = ##class(%Library.File).GetFileDateModified(file) + set diff = $System.SQL.Functions.DATEDIFF("ms",lastModifiedTime,$h) + if (diff < 1000) { + quit + } + } + } + } quit ..OnBeforeLoad(InternalName,0) } @@ -351,4 +366,3 @@ Method AddToSourceControl(InternalName As %String, Description As %String = "") } } -