update descriptor only if its loading from the same transport url
@@ -61,8 +61,13 @@ pub fn descriptor_update<E: Env + 'static>(
transport_url,
result,
} => match descriptor {
- Some(descriptor) if descriptor.transport_url == *transport_url => {
- descriptor.content = match result {
+ Some(DescriptorLoadable {
+ transport_url: loading_transport_url,
+ content: Loadable::Loading,
+ }) if loading_transport_url == transport_url => {
+ *descriptor = Some(DescriptorLoadable {
+ transport_url: transport_url.to_owned(),
+ content: match result {
Ok(manifest) => Loadable::Ready(Descriptor {
transport_url: transport_url.to_owned(),
manifest: manifest.to_owned(),
@@ -73,7 +78,8 @@ pub fn descriptor_update<E: Env + 'static>(
.unwrap_or_default(),
}),
Err(error) => Loadable::Err(error.to_owned()),
- };
+ },
+ });
Effects::none()
}
_ => Effects::none().unchanged(),
