Open nick4598 opened 2 weeks ago
Solution 3 from vilius seems the best, we should proceed with that.
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?
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:
Solution 2
Add hooks / callbacks that would be called on events such as onTransformerInitialized.
Problems:
Solution 3
Pass to transformer ctor additional options:
iSsynchronization: boolean
. processAll and processChanges will be merged into one process() method initialize would be moved into function which is responsibility of consumers to call. Then it shoudl be safe to access provenanceDb/sourceDb/ syncDirection.Open Questions