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

Make syncType less prone to caching invalid values #187

Open nick4598 opened 2 weeks ago

nick4598 commented 2 weeks ago

Writing this workup item after a call with transformation services team

Problem

Calling getters on the transformer such as :

Would lock in incorrect values if they were called too early. This is because a property 'isSynchronization' needs to be set to true before the syncDirection is accurately determined.

We had a few potential solutions:

Solution 1

use a private property to make sure that processAll / processChanges has been called before accessing provenanceDb / provenanceSourceDb getters. Throw error if not. Problems:

Problems:

Open Questions

nick4598 commented 2 weeks ago

Solution 3 from vilius seems the best, we should proceed with that.

nick4598 commented 2 weeks ago

Answers to the open Questions;

Does transformation services ever set isSynchronization to true during a processAll?

Is there such thing as a processAll reverseSync? If isSynchronization is false, which it is in processAll. then that defauslt to assuming a forward sync.

If consumer fails to call initialize, should we call it for them in the process function?