Skip to content

Commit e3821ad

Browse files
fix(passport): handle 409 conflict as success in registerOffchain
- Treat 409 Conflict error as success (user already registered) - Check for multiple error indicators: '409', 'conflict', 'already registered' - Add informative log message for debugging - Prevents unnecessary error display to users who are already registered
1 parent d28db96 commit e3821ad

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Source/Immutable/Private/Immutable/Actions/ImtblPassportImxRegisterOffchainAsyncAction.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,15 @@ void UImtblPassportImxRegisterOffchainAsyncAction::OnImxRegisterOffchainResponse
4949
}
5050
}
5151

52+
// Handle 409 Conflict error - user already registered
53+
// This is a normal case and should be treated as success
54+
if (Result.Error.Contains(TEXT("409")) || Result.Error.Contains(TEXT("conflict"), ESearchCase::IgnoreCase) ||
55+
Result.Error.Contains(TEXT("already registered"), ESearchCase::IgnoreCase))
56+
{
57+
IMTBL_LOG("User is already registered offchain (409 response treated as success)");
58+
OnSuccess.Broadcast(TEXT(""), TEXT(""));
59+
return;
60+
}
61+
5262
OnFailure.Broadcast(TEXT(""), Result.Error);
5363
}

0 commit comments

Comments
 (0)