Skip to content

fix: asset filter ignored when combined with q (#728) - #929

Open
udeachudivine-spec wants to merge 1 commit into
ritik4ever:mainfrom
udeachudivine-spec:fix/728-asset-filter-ignored-with-q
Open

fix: asset filter ignored when combined with q (#728)#929
udeachudivine-spec wants to merge 1 commit into
ritik4ever:mainfrom
udeachudivine-spec:fix/728-asset-filter-ignored-with-q

Conversation

@udeachudivine-spec

Copy link
Copy Markdown

When both ?asset=USDC and ?q= were supplied, the q filter searched assetCode as one of its OR arms. If didn't match the pinned asset code the q filter would drop all streams that the asset filter had just kept, silently ignoring the asset param.

Root cause: the q filter block unconditionally checked
stream.assetCode.toLowerCase().includes(searchTerm)
even when an explicit asset/assetCode filter was already active, creating an implicit conflict between the two filters.

Fix: skip the assetCode arm of the q filter when asset or assetCode is already set. Both filters now combine with AND logic — asset pins the asset, q searches id/sender/recipient only.

Same one-line fix applied to all three handlers that share this filter block: GET /api/streams, /api/streams/sender/:address, and /api/streams/recipient/:address.

Tests: four new integration tests covering

  • q + asset AND intersection
  • q alone regression
  • asset alone regression
  • q matching asset-A while asset=B is set (empty intersection)

Docs: updated OpenAPI spec (swagger.ts) to document AND semantics for all filter combinations on the three affected endpoints.

Commit Type

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (formatting, etc.)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • build: Changes affecting the build system or external dependencies
  • ci: Changes to CI/CD configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit

Breaking change? (If yes, add BREAKING CHANGE in the commit footer)

  • Yes — this contains a breaking change
  • No

What changed

Testing done

Related issues

Closes #

Checklist

  • I used the correct commit type (see above) for the squashed commit message.
  • I kept the change focused on the related issue.
  • I added or updated tests where useful.
  • I updated documentation where behavior changed.
  • I verified the app still builds or explained why verification was skipped.
  • My commits follow Conventional Commits (enforced by commitlint).

When both ?asset=USDC and ?q=<term> were supplied, the q filter
searched assetCode as one of its OR arms. If <term> didn't match
the pinned asset code the q filter would drop all streams that
the asset filter had just kept, silently ignoring the asset param.

Root cause: the q filter block unconditionally checked
  stream.assetCode.toLowerCase().includes(searchTerm)
even when an explicit asset/assetCode filter was already active,
creating an implicit conflict between the two filters.

Fix: skip the assetCode arm of the q filter when asset or assetCode
is already set. Both filters now combine with AND logic — asset pins
the asset, q searches id/sender/recipient only.

Same one-line fix applied to all three handlers that share this
filter block: GET /api/streams, /api/streams/sender/:address, and
/api/streams/recipient/:address.

Tests: four new integration tests covering
- q + asset AND intersection
- q alone regression
- asset alone regression
- q matching asset-A while asset=B is set (empty intersection)

Docs: updated OpenAPI spec (swagger.ts) to document AND semantics
for all filter combinations on the three affected endpoints.
@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

@udeachudivine-spec is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b270c23-96b8-4dba-840e-5109048bea56


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@udeachudivine-spec

Copy link
Copy Markdown
Author

close issue #728

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