upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-07-19 13:35:39 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-07-19 13:35:39 +0100
commit2e54dd09a1a3b42903eee00adf4472d8b679dcb1 (patch)
tree463bf5eff5f6523073b6bdba6ef0976b7b3e54db /src/client.rs
parenta8b574ae5117939717963304713dd2f1e2929c7d (diff)
fix(fetch): error when user profile not present
when fetching a user profile from user relays it throw an error when an existing version of the profile wasn't found
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/client.rs b/src/client.rs
index 0757359..ccd5cfb 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -909,11 +909,17 @@ async fn create_relays_request(
909 } 909 }
910 let mut map: HashMap<PublicKey, (Timestamp, Timestamp)> = HashMap::new(); 910 let mut map: HashMap<PublicKey, (Timestamp, Timestamp)> = HashMap::new();
911 for public_key in &user_profiles { 911 for public_key in &user_profiles {
912 let user_ref = get_user_ref_from_cache(git_repo_path, public_key).await?; 912 if let Ok(user_ref) = get_user_ref_from_cache(git_repo_path, public_key).await {
913 map.insert( 913 map.insert(
914 public_key.to_owned(), 914 public_key.to_owned(),
915 (user_ref.metadata.created_at, user_ref.relays.created_at), 915 (user_ref.metadata.created_at, user_ref.relays.created_at),
916 ); 916 );
917 } else {
918 map.insert(
919 public_key.to_owned(),
920 (Timestamp::from(0), Timestamp::from(0)),
921 );
922 }
917 } 923 }
918 map 924 map
919 }; 925 };