Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show Failed to Import popup after overwriting the file on server once #311

Merged
merged 4 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 15 additions & 1 deletion cls/SourceControl/Git/Extension.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

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

}

Loading