API gets old latest version info compared to vault

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
stanyork
Posts: 21
Joined: Thu Apr 30, 2009 5:09 pm

API gets old latest version info compared to vault

Post by stanyork » Mon Dec 28, 2009 12:41 pm

Scenario:
1) Small program connects to vault server and stays open (ServerOperations.Login)
2) File is checked out, modified, checked in using Visual Studio 2008 Vault enhanced client
3) Small program is given path to local file, gets vault item and inspects LatestVersion

F5 in Vault UI, of course, refreshes the display and shows the updated latest version.
If I end the small program and restart it (causing a fresh login/connect) - the value is then up-to-date
I presume I am missing a call to update the API cache.
Could it be ServerOperations.client.ClientInstance.AutoChangeScanEnabled ? I could find no doc.
I am hopeful that this API call will be faster than always disconnecting and reconnecting.

Code to get latest version is currently:

Code: Select all

Dim itemFound As VaultClientFile
itemFound = RepositoryUtil.FindVaultFileAtReposOrLocalPath(fn)
msgbox(itemFound.GetFileProperties.LatestVersion.tostring)

shannon

Re: API gets old latest version info compared to vault

Post by shannon » Tue Dec 29, 2009 8:26 am

Try calling ServerOperations.client.ClientInstance.UpdateKnownChanges_RefreshKnown(true).

If that doesn't seem to be catching everything, try calling UpdateKnownChanges_All(true) instead.

Post Reply