Skip to content

Commit 104a2c3

Browse files
committed
fix wasm client?
1 parent 1d518cc commit 104a2c3

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

common/wasm/client-core/src/helpers.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub async fn setup_gateway_wasm(
139139
GatewaySetup::MustLoad { gateway_id: None }
140140
} else {
141141
let selection_spec =
142-
GatewaySelectionSpecification::new(chosen_gateway.clone(), None, force_tls);
142+
GatewaySelectionSpecification::new(chosen_gateway.clone(), None, force_tls, false);
143143

144144
GatewaySetup::New {
145145
specification: selection_spec,
@@ -218,6 +218,7 @@ pub async fn add_gateway(
218218
preferred_gateway.clone(),
219219
latency_based_selection,
220220
force_tls,
221+
false,
221222
);
222223

223224
let preferred_gateway = preferred_gateway

common/wasm/client-core/src/storage/core_client_traits.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ impl GatewaysDetailsStore for ClientStorage {
154154
self.store_registered_gateway(&raw_registration).await
155155
}
156156

157+
async fn update_gateway_details(
158+
&self,
159+
details: &GatewayRegistration,
160+
) -> Result<(), Self::StorageError> {
161+
// Will overwrite value, which is what we want
162+
self.store_gateway_details(details).await
163+
}
164+
157165
async fn remove_gateway_details(&self, gateway_id: &str) -> Result<(), Self::StorageError> {
158166
self.remove_registered_gateway(gateway_id).await
159167
}

common/wasm/client-core/src/storage/types.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ pub struct WasmRawRegisteredGateway {
2020
pub derived_aes256_gcm_siv_key: Vec<u8>,
2121

2222
pub gateway_listener: String,
23+
24+
#[zeroize(skip)]
25+
pub expiration_timestamp: OffsetDateTime,
2326
}
2427

2528
impl TryFrom<WasmRawRegisteredGateway> for GatewayRegistration {
@@ -32,6 +35,7 @@ impl TryFrom<WasmRawRegisteredGateway> for GatewayRegistration {
3235
derived_aes256_gcm_siv_key: value.derived_aes256_gcm_siv_key,
3336
gateway_listener: value.gateway_listener,
3437
fallback_listener: None,
38+
expiration_timestamp: value.expiration_timestamp,
3539
};
3640
let remote: RemoteGatewayDetails = raw_remote.try_into()?;
3741

@@ -55,6 +59,7 @@ impl<'a> From<&'a GatewayRegistration> for WasmRawRegisteredGateway {
5559
registration_timestamp: value.registration_timestamp,
5660
derived_aes256_gcm_siv_key,
5761
gateway_listener: remote_details.gateway_listeners.primary.to_string(),
62+
expiration_timestamp: remote_details.expiration_timestamp,
5863
}
5964
}
6065
}

0 commit comments

Comments
 (0)