Why is iModelDb.key random during BriefcaseDb.onOpened #8151
Replies: 3 comments 7 replies
-
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
It would have been nice if the key were always random, so nobody would ever ascribe any meaning to it. For example, it can't be "iModelId" since you can open different checkpoints of the same iModel. But, then we added a way for apps to supply it, then for some reason we made it a combination of iModelId and ChangesetIds for opening checkpoints. I assume #6847 was an attempt to make somebody's interpretation of "key" consistent. If you're not the one supplying "opts", then I guess setting key in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would make a bug report but I don't think I'll do it justice, so leaving this here for posterity.
Why is there a random guid created here?
This later gets overwritten to some variant of
`${iModelId}:${changeset.id}`
(only in some iModels it seems but I haven't traced which atm because I have a workaround for my case and there are a lot of Db types)In my case, I see it overwritten here.
The biggest problem with this, is when I have a listener on
BriefcaseDb.onOpened
, during which the opening process is ostensibly already complete, thekey
can be the random guid, and then it gets reset later before I then during an RPC call try to find some data I cached atonOpened
time.So why is it done this way? Am I missing something? Will this help anyone?
I'm just going to manually build the key myself in my
onOpened
handler.Beta Was this translation helpful? Give feedback.
All reactions