-
Notifications
You must be signed in to change notification settings - Fork 267
Conversation
pub async fn initialize( | ||
instance: &Instance, | ||
dna: Option<Dna>, | ||
maybe_dna: Option<Dna>, | ||
context: Arc<Context>, | ||
) -> HcResult<Arc<Context>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if we have a Dna in the context/state, but then call initialize with Some(dna)? If that is invalid behavior, maybe that is an argument for splitting this into two different functions so we can't do something invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have a look again. I've left it as one function for now, but added comments and a panic in case maybe_dna
is Some
AND there is a DNA already in the nucleus state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, fair enough
Co-Authored-By: Willem Olding <[email protected]>
Co-Authored-By: Willem Olding <[email protected]>
PR summary
Loading of instances was broken.
Two reasons why we didn't notice this right away:
changelog
documentation