fix: Handle Unavailable Bittensor API Data#21
Open
RenzoMXD wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 change fixes issue
#7by adding stable backend error responses and frontend UI states for unavailable Bittensor data.Previously, if Bittensor chain data, adapter calls, or future indexer requests failed, the backend could return a generic error and the frontend could only show a vague backend-unavailable message.
Now the API returns a typed
503error withBITTENSOR_DATA_UNAVAILABLE, and the frontend displays a specific message: “Bittensor data is temporarily unavailable.”Related Issue
Closes: #7
Change Type
Real Behavior Proof
Normal API behavior
Result:
{"status":"ok","service":"tao-passport-api"}Result included:
{ "walletAddress": "5FAbc123TAOPassportDemoWalletAddress999999999999", "trustScore": 89, "reputationSignals": [...] }Forced Bittensor unavailable behavior
Command used:
Result:
HTTP/1.1 503 Service Unavailable{ "error": { "code": "BITTENSOR_DATA_UNAVAILABLE", "message": "Bittensor data is temporarily unavailable. Please retry after the chain adapter reconnects.", "retryable": true, "source": "bittensor" } }The same typed error behavior was also verified for:
Checklist
503response for unavailable Bittensor data