When a large number of changesets needs to be processed / downloaded, the original access token provided to processChanges expires. I believe the token has a 1hr expiry time for downloading changesets.
Potential short-term solution
From itwinjs-core:
/**
Argument to a function that can accept a valid access token.
@public
*/
export interface TokenArg {
/* If present, the access token for the requested operation. If not present, use [[IModelHost.getAccessToken]] /
readonly accessToken?: AccessToken;
}
imodels-clients imports the above ^
So if users of imodel-transformer call IModelHost.startup() with an authorizationClient and DONT pass an access token then imodels-clients may call getAccessToken when it errors out in downloadChangesetFileWithRetry
I'm not 100% sure this will work ,but worth hopefully writing a test and validating in services side? Maybe even in core transformer as well.
Potential longer-term solution?
It seems like we should make it harder to pass an accesstoken to processChanges or atleast document that you should prefer to pass an authorization client to IModelHost.startup() and set it as undefined.
I tend to lean towards just documenting this behavior. We could also even use IModelHost.getAccessToken in the transformer any place we need an access token (not sure if we need one besides for passing to imodels-clients functions).
Problem
When a large number of changesets needs to be processed / downloaded, the original access token provided to processChanges expires. I believe the token has a 1hr expiry time for downloading changesets.
Potential short-term solution
From itwinjs-core:
/**
imodels-clients imports the above ^
So if users of imodel-transformer call IModelHost.startup() with an authorizationClient and DONT pass an access token then imodels-clients may call getAccessToken when it errors out in downloadChangesetFileWithRetry
I'm not 100% sure this will work ,but worth hopefully writing a test and validating in services side? Maybe even in core transformer as well.
Potential longer-term solution?
It seems like we should make it harder to pass an accesstoken to processChanges or atleast document that you should prefer to pass an authorization client to IModelHost.startup() and set it as undefined. I tend to lean towards just documenting this behavior. We could also even use IModelHost.getAccessToken in the transformer any place we need an access token (not sure if we need one besides for passing to imodels-clients functions).