Get Latest API command failing

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

Moderator: SourceGear

Post Reply
HenryEI
Posts: 8
Joined: Fri Dec 16, 2016 12:44 pm

Get Latest API command failing

Post by HenryEI » Tue Oct 03, 2017 3:02 pm

While preforming a Get Latest command using the Vault API, some of my users are having errors where the first version of the block is retrieved as opposed to the current/latest version. This is causing errors with my program. I am not sure why this is only happening to some users.

This is what I am using, please let me know if it is correct.

Code: Select all

GetOperations.ProcessCommandGet(
    new string[] { vaultFile },
    new GetOptions()
    {
        Merge = MergeType.OverwriteWorkingCopy,
        MakeWritable = MakeWritableType.MakeAllFilesWritable
    });
Is there some settings in Vault that individual users may have set which is causing this?

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Get Latest API command failing

Post by jclausius » Tue Oct 03, 2017 3:17 pm

Something is not adding up here. Have you debugged the call into ProcessCommandGet() ? If you set MergeType.OverwriteWorkingCopy, it sets an internal variable which should force the client to request the latest file.

Can you compile and debug against the VaultClientIntegration source files to see if that is indeed the case?
Jeff Clausius
SourceGear

HenryEI
Posts: 8
Joined: Fri Dec 16, 2016 12:44 pm

Re: Get Latest API command failing

Post by HenryEI » Tue Oct 03, 2017 3:38 pm

One of the main difficulties with debugging this, is that I cannot duplicate the error on my computer where I can debug it. I can only observe it on the computers of the users who are having these issues and investigate it without any debugging tools. And the users who are having these problems are unable to lend me their computers since they are extremely busy.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Get Latest API command failing

Post by jclausius » Tue Oct 03, 2017 6:12 pm

That will be tough. What if you took and compiled in ProcessCommandGet, but you put in some WriteLines to output some data to a file, and then have the users run that?
Jeff Clausius
SourceGear

HenryEI
Posts: 8
Joined: Fri Dec 16, 2016 12:44 pm

Re: Get Latest API command failing

Post by HenryEI » Mon Oct 09, 2017 10:38 am

Sorry for the delayed response. I was able to get ahold of a user's computer, and it turned out to be a problem with their settings in Vault itself. In Options>Local Files>Modified working copy, the option had to be set to overwrite, as shown in the attached picture.
Attachments
Setting.PNG
Setting.PNG (46.93 KiB) Viewed 36693 times

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Get Latest API command failing

Post by jclausius » Tue Oct 10, 2017 8:08 am

Thanks for posting back. I'm glad you were able to get to the bottom of the issue.
Jeff Clausius
SourceGear

Post Reply