fix(pinner): restore indirect pin detection and add context cancellation#1039
Merged
fix(pinner): restore indirect pin detection and add context cancellation#1039
Conversation
- add context checks at start of each recursive pin traversal - extract traverseIndirectPins helper to eliminate duplicate code - reduce code duplication by ~40 lines while maintaining functionality - 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.
Recursively pinned roots should not show as indirect. Objects can be both directly and indirectly pinned. Restores behavior from before PR #1035.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1039 +/- ##
==========================================
+ Coverage 60.67% 60.74% +0.07%
==========================================
Files 268 268
Lines 33560 33597 +37
==========================================
+ Hits 20364 20410 +46
+ Misses 11520 11515 -5
+ Partials 1676 1672 -4
... and 12 files with indirect coverage changes 🚀 New features to boost your workflow:
|
4 tasks
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.
Member
Author
|
I've documented the backward-compatibility criteria and confirmed this PR passes legacy sharness tests in: I'm going to merge this since #1035 is already in the We may want to look at this in the future, maybe the legacy behavior can/should be changed, but I don't want to make any extra waves for 0.38 -- keeping things as-is where possible for now. |
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.
Follow-up for #1035 (forgot to push local changes):
CheckIfPinnedWithTypefor efficient checks with names #1035 is exactly the sameipfs pin ls <cid> --nameskubo#10970 caught this regressionWhile at it, some cleanup:
traverseIndirectPinsto avoid duplicated codeCheckIfPinnedWithTypefor efficient checks with names #1035, so in theory aborting listing all pins was sometimes stuck for longer than it should