iTwin / imodel-transformer

API for exporting an iModel's parts and also importing them into another iModel
MIT License
3 stars 2 forks source link

When a large number of changsets needs to be downloaded, transformer will error out because the access token provided to processChanges expires. #189

Closed nick4598 closed 1 month ago

nick4598 commented 3 months ago

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).

nick4598 commented 1 month ago

This has now been merged, the accessToken is no longer passed and we suggest an authorizationClient to be set.