Increase logging around username synchronization.

This commit is contained in:
Alex Hart 2023-03-10 13:14:19 -04:00 committed by Greyson Parrelli
parent 894095414a
commit e1e117ce73

View file

@ -267,7 +267,16 @@ public class RefreshOwnProfileJob extends BaseJob {
String serverUsernameHash = whoAmIResponse.getUsernameHash(); String serverUsernameHash = whoAmIResponse.getUsernameHash();
String localUsernameHash = Base64UrlSafe.encodeBytesWithoutPadding(Username.hash(localUsername)); String localUsernameHash = Base64UrlSafe.encodeBytesWithoutPadding(Username.hash(localUsername));
if (!hasServerUsername) {
Log.w(TAG, "No remote username is set.");
}
if (!Objects.equals(localUsernameHash, serverUsernameHash)) {
Log.w(TAG, "Local username hash does not match server username hash.");
}
if (!hasServerUsername || !Objects.equals(localUsernameHash, serverUsernameHash)) { if (!hasServerUsername || !Objects.equals(localUsernameHash, serverUsernameHash)) {
Log.i(TAG, "Attempting to resynchronize username.");
tryToReserveAndConfirmLocalUsername(localUsername, localUsernameHash); tryToReserveAndConfirmLocalUsername(localUsername, localUsernameHash);
} }
} catch (IOException | BaseUsernameException e) { } catch (IOException | BaseUsernameException e) {