Skip to content

Commit

Permalink
chore: Dont return error if identity is the same
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Oct 27, 2023
1 parent 0e91a98 commit 8b74da9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions extensions/warp-ipfs/src/store/document/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ impl IdentityCacheTask {
match old_document {
Some(old_document) => {
if !old_document.different(&document) {
tracing::error!("Identity in cache havent changed");
let _ = response.send(Err(Error::IdentityExist));
let _ = response.send(Ok(None));
continue;
}

Expand Down
15 changes: 9 additions & 6 deletions extensions/warp-ipfs/src/store/document/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,20 @@ impl IdentityDocument {
return false;
}

if self.username != other.username
if other.verify().is_err() {
tracing::warn!(
"identity for {} is not valid, corrupted or been tampered with.",
self.did
);
return false;
}

self.username != other.username
|| self.status_message != other.status_message
|| self.status != other.status
|| self.profile_banner != other.profile_banner
|| self.profile_picture != other.profile_picture
|| self.platform != other.platform
{
return other.verify().is_ok();
}

false
}
}

Expand Down

0 comments on commit 8b74da9

Please sign in to comment.