feat(pinner): add CheckIfPinnedWithType for efficient checks with names#1035
Merged
feat(pinner): add CheckIfPinnedWithType for efficient checks with names#1035
CheckIfPinnedWithType for efficient checks with names#1035Conversation
adds CheckIfPinnedWithType method to Pinner interface that allows checking specific pin types with optional name loading. this enables efficient pin operations like 'ipfs pin ls <cid> --names' without loading all pins. - CheckIfPinned now delegates to CheckIfPinnedWithType for consistency necessary for ipfs/js-kubo-rpc-client#343
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1035 +/- ##
==========================================
+ Coverage 60.60% 60.68% +0.08%
==========================================
Files 268 268
Lines 33460 33569 +109
==========================================
+ Hits 20277 20372 +95
- Misses 11513 11522 +9
- Partials 1670 1675 +5
... and 12 files with indirect coverage changes 🚀 New features to boost your workflow:
|
lidel
added a commit
to ipfs/kubo
that referenced
this pull request
Sep 18, 2025
updates to use CheckIfPinnedWithType method from ipfs/boxo#1035, enabling efficient pin name retrieval for 'ipfs pin ls <cid> --names' - uses new CheckIfPinnedWithType from boxo for type-specific pin checks - pin names are now returned when listing specific CIDs with --names flag
This was referenced Sep 18, 2025
Closed
tests cover: - type-specific pin checking (direct, recursive, indirect) - pin name loading with includeNames flag - multiple CIDs in single call - edge cases (not pinned, internal mode, invalid mode) - backward compatibility with CheckIfPinned
f3c309e to
634cc18
Compare
CheckIfPinnedWithType for efficient checks with names
lidel
commented
Sep 18, 2025
Member
Author
lidel
left a comment
There was a problem hiding this comment.
Merging as per verbal during today's colo -- we will include this fix/optimization in Kubo 0.38.0-rc1.
lidel
added a commit
that referenced
this pull request
Sep 18, 2025
Recursively pinned roots should not show as indirect. Objects can be both directly and indirectly pinned. Restores behavior from before PR #1035.
lidel
added a commit
that referenced
this pull request
Sep 19, 2025
…ion (#1039) * fix(pinner): add context cancellation checks for indirect pins - add context checks at start of each recursive pin traversal - extract traverseIndirectPins helper to eliminate duplicate code - add tests for context cancellation behavior this fixes a pre-existing issue where indirect pin traversal never checked for context cancellation, causing operations to continue even after cancellation was requested. especially important for large pin sets with many recursive pins. * fix: indirect pin detection regression Recursively pinned roots should not show as indirect. Objects can be both directly and indirectly pinned. Restores behavior from before PR #1035. * docs: clarify pin type precedence in indirect checks explain why recursive pins are excluded from indirect results while direct pins are not. this asymmetry is intentional and preserved for compatibility with established ipfs behavior.
lidel
added a commit
to ipfs/kubo
that referenced
this pull request
Sep 19, 2025
* fix: use CheckIfPinnedWithType for pin ls with names updates to use CheckIfPinnedWithType method from ipfs/boxo#1035, enabling efficient pin name retrieval for 'ipfs pin ls <cid> --names' - uses new CheckIfPinnedWithType from boxo for type-specific pin checks - pin names are now returned when listing specific CIDs with --names flag * test: add CLI tests for pin ls with names tests cover: - pin ls with specific CIDs returning names - pin ls without CID listing all pins with names - pin ls with --type and --names combinations - JSON output with and without names - pin update preserving names - error cases (invalid CID, unpinned CID) * docs: add pin name improvements to v0.38 changelog covers fix for ipfs pin ls --names with specific CIDs and RPC pin name leak fix * fix(rpc): support pin names in Add() passes the Name field from PinAddSettings to the API request adds test to verify pin names work via RPC * test: add coverage for pin names functionality - test special characters, unicode, long names - test concurrent operations - test persistence across daemon restarts - test garbage collection preservation - fix indirect pin test logic * chore: boxo@main with boxo#1039 * fix(pin): improve pin ls robustness and validation - add nil check for n.Pinning with early fail-fast validation - use pin.StringToMode() for consistent type validation - add edge case tests for invalid types and unpinned CIDs
This was referenced Oct 2, 2025
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.
Adds
CheckIfPinnedWithTypemethod to the Pinner interface for efficient type-specific pin checks with optional name loading.Why
ipfs pin ls <cid> --namesin Kubo doesn't return pin names because the current API doesn't support fetching names for specific CIDs efficiently. This PR adds the missing functionality.Changes
CheckIfPinnedWithType(ctx, mode, includeNames, cids...)methodmode: which pin type to check (Recursive, Direct, Indirect, Any)includeNames: whether to load pin names from datastoreCheckIfPinnednow delegates toCheckIfPinnedWithTypeRelated
ipfs pin ls <cid> --nameskubo#10970