Fix: Registration wizard now verifies actual registration status #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This fix addresses a critical issue where the registration wizard displays "Registration successful!" without actually verifying that the user registration was persisted in the database.
Problem
The registration wizard was showing a success message based solely on the server's response to the registration request. However, as reported in issue #29, the server could return a successful response (HTTP 200 with
{"success": true}) while the actual database write failed silently. This resulted in:{"registered": false}This behavior was misleading and caused confusion for users who believed they were registered when they were not.
Solution
The fix adds a verification step after receiving a successful registration response:
After the registration endpoint returns success, the wizard now calls the status API (
/api/v1/bridge/bounty-challenge/status/{hotkey}) to verify the registration was actually persisted.A brief delay (500ms) is added before verification to allow for any async database writes to complete.
Based on the verification result:
status.registered == true: Display the success messagestatus.registered == false: Display a warning that registration may have failed, prompting the user to try againThis ensures users receive accurate feedback about their actual registration state.
Testing
cargo check --bin bountyget_statusmethod fromBountyClientRelated Issue
Fixes #29