Page 1 of 1

API gets old latest version info compared to vault

Posted: Mon Dec 28, 2009 12:41 pm
by stanyork
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)

Re: API gets old latest version info compared to vault

Posted: Tue Dec 29, 2009 8:26 am
by shannon
Try calling ServerOperations.client.ClientInstance.UpdateKnownChanges_RefreshKnown(true).

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