Skip to content

fix(pins): send explicit match=exact on pins_list name filter - #450

Merged
pcfreak30 merged 1 commit into
developfrom
fix/pins-list-name-filter
Aug 22, 2026
Merged

fix(pins): send explicit match=exact on pins_list name filter#450
pcfreak30 merged 1 commit into
developfrom
fix/pins-list-name-filter

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the pins_list name-filter regression where a non-matching name returned the full unfiltered list.

Root cause: the exact-name filter was sent as a bare name with no match strategy. Pinning-service backends that require an explicit match strategy ignore it, so the server returns every pin. status/limit kept working (different params) and search kept working (WithFilterNamePartial pins match=partial) — isolating the breakage to the name filter.

Change

In PinningServiceDefault.listViaSDK (internal/cli/pinning_client.go), the exact-name path now sends WithFilterMatch(ipfs.MatchExact) alongside WithFilterName, mirroring how the substring-search path pins match=partial.

Tests

  • Added TestPinsListSendsExactNameMatch — asserts ListPins receives name + match=exact (symmetric with the existing match=partial guard).
  • go build ./... clean; TestPins* suite passes.

Summary

This pull request fixes the pins_list command's exact-name filter to explicitly send the match=exact strategy to the pinning service backend.

Changes

Bug Fix

  • internal/cli/pinning_client.go: When a nameFilter is provided (without a partial-match search), the code now appends both ipfs.WithFilterName(nameFilter) AND ipfs.WithFilterMatch(ipfs.MatchExact) to the list options.

Why It Matters

Previously, the exact-name filter sent only the name parameter without declaring a match strategy. Some pinning-service backends require an explicit matching strategy and would silently ignore a bare name filter, returning the full list instead of filtering by name. Status and limit filters would still apply, but the name filter became a no-op.

Test Coverage

  • internal/cli/pinning_service_test.go: Added TestPinsListSendsExactNameMatch, which verifies that:
    • When List is called with a non-empty nameFilter (and no search), it passes both WithFilterName and WithFilterMatch(ipfs.MatchExact) to the SDK.
    • The test guards against regression where the name filter might be dropped or the match strategy omitted.

Impact

This fix ensures that users filtering pins by exact name receive correctly filtered results, aligning behavior with the documented API specification where the default matching strategy is exact.

pins_list's exact name filter was sent as a bare `name` with no `match`
strategy, so pinning-service backends that require an explicit strategy
ignored it and returned the full list. status/limit kept working (they
are different params) and search kept working (WithFilterNamePartial
pins match=partial), which is why only the name filter appeared broken.

Send WithFilterMatch(ipfs.MatchExact) alongside the name, mirroring the
partial-match search path, and add a guard test asserting match=exact is
sent (symmetric with the existing match=partial guard).
@kody-ai

kody-ai Bot commented Aug 22, 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 0beed32 into develop Aug 22, 2026
23 of 25 checks passed
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