feat: fallback to account operations when pin not found in status command#38
Merged
Conversation
…mand When pinner status <cid> gets ErrPinNotFound from the pinning service, it now queries the account operations API by CID and displays operation data (status, progress, error details) if a matching operation exists. - Add StatusService interface with pin→operation fallback logic - Add OperationStatusResult struct for account operation data - Add StatusServiceDefault with lookupOperation method - Update status command to use StatusService and render operation data - Add mock and unit tests for the fallback behavior
This comment has been minimized.
This comment has been minimized.
Code Coverage ReportTotal Coverage: 34.0% Generated from commit: 38e5f4a |
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
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.
When pinner status gets ErrPinNotFound from the pinning service,
it now queries the account operations API by CID and displays operation
data (status, progress, error details) if a matching operation exists.
Add fallback to account operations when pin is not found in the status command
The
statuscommand now checks account operations as a fallback when a pin is not found for a given CID. This allows users to see the status of in-progress or completed operations (e.g., uploads) even when no pin record exists yet.Key changes:
StatusService: Introduces aStatusServiceinterface andStatusServiceDefaultimplementation that first attempts to retrieve pin status, and if the pin is not found (ErrPinNotFound), queries the portal SDK'sAccountAPI.ListOperations()to find a matching operation for the CID.OperationStatusResulttype: Represents operation status details including operation name, protocol, progress percentage, status message, and error information.statuscommand description now documents the fallback behavior and lists operation status values (pending, running, completed, failed, error).StatusServiceDefaultcovering pin found, fallback to operation, no operation exists, nil account client, non-ErrPinNotFounderrors, and error field population from operations.