Skip to content

feat: fallback to account operations when pin not found in status command#38

Merged
pcfreak30 merged 2 commits into
developfrom
feat/status-operation-fallback
May 17, 2026
Merged

feat: fallback to account operations when pin not found in status command#38
pcfreak30 merged 2 commits into
developfrom
feat/status-operation-fallback

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented May 17, 2026

Copy link
Copy Markdown
Member

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 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

Add fallback to account operations when pin is not found in the status command

The status command 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:

  • New StatusService: Introduces a StatusService interface and StatusServiceDefault implementation that first attempts to retrieve pin status, and if the pin is not found (ErrPinNotFound), queries the portal SDK's AccountAPI.ListOperations() to find a matching operation for the CID.
  • New OperationStatusResult type: Represents operation status details including operation name, protocol, progress percentage, status message, and error information.
  • Updated status command output: Single-CID lookups render either pin status or operation status depending on which is found. Multi-CID table output now includes a "Source" column indicating whether the status came from a "pin" or "operation".
  • Updated command documentation: The status command description now documents the fallback behavior and lists operation status values (pending, running, completed, failed, error).
  • Comprehensive tests: Adds tests for the StatusServiceDefault covering pin found, fallback to operation, no operation exists, nil account client, non-ErrPinNotFound errors, and error field population from operations.

…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
@kody-ai

This comment has been minimized.

@github-actions

github-actions Bot commented May 17, 2026

Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 34.0%

Generated from commit: 38e5f4a
Repository: LumeWeb/pinner-cli

Comment thread pkg/cli/status_service.go
@kody-ai

kody-ai Bot commented May 17, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@pcfreak30 pcfreak30 merged commit 206a1af into develop May 17, 2026
2 checks passed
@pcfreak30 pcfreak30 deleted the feat/status-operation-fallback branch May 17, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant