Skip to content

feat!: hold at most one complex transaction filter - #1461

Open
DaughterOfMars wants to merge 8 commits into
developfrom
feat/single-transaction-filter-selector
Open

feat!: hold at most one complex transaction filter#1461
DaughterOfMars wants to merge 8 commits into
developfrom
feat/single-transaction-filter-selector

Conversation

@DaughterOfMars

Copy link
Copy Markdown
Contributor

Why

The GraphQL service stops supporting the combination of two or more complex filters (function, recipient, input object, changed object, wrapped or deleted object) with the v1.38 release, along with the scanLimit that made those combinations work. The client never sent scanLimit, so such a filter already failed at the server; nothing in the type prevented building one.

What changes

TransactionsFilter now holds at most one of those filters plus kind, which the service also cannot combine with any of them, so an invalid combination no longer exists as a value. The setters for those filters replace each other rather than accumulating — that is the one behavioral surprise, and it is documented on each of them. The sender, checkpoint and digest filters are unaffected and still combine freely.

Over the FFI the same guarantee needs methods, so the filter became an object with setters instead of a record of optional fields, following ClientTransactionBuilder.

affectedAddress is still not exposed; adding it is now one variant rather than a fourth invalid pairing, but it would make the address_transactions examples obsolete, so it belongs in its own PR. The @oneOf subscription filters have the same unenforced "exactly one" property and are untouched.

Test plan

  • cargo clippy --workspace --all-targets --all-features, make check-fmt, make bindings-examples-format-check
  • Regenerated all bindings; Go examples type-check, C# examples build, Kotlin examples compile
  • Ran transactions_with_function and transactions_with_shared against testnet in both Rust and Python
  • Swift is unverified locally: this machine's toolchain fails to compile bindings/swift/Package.swift itself, unrelated to this change

🤖 Generated with Claude Code

The GraphQL service stops supporting the combination of two or more complex
filters with v1.38, and the client never sent `scanLimit`, so those
combinations already failed at the server. A single selector field makes them
unrepresentable instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread crates/iota-sdk-graphql-client/src/query_types/transaction.rs Outdated
Comment thread crates/iota-sdk-graphql-client/src/query_types/transaction.rs Outdated
Comment thread crates/iota-sdk-graphql-client/src/query_types/transaction.rs
@thibault-martinez

Copy link
Copy Markdown
Member

conflicts

@thibault-martinez

Copy link
Copy Markdown
Member

Maybe a conflict resolution issue but we're removing affected_address with this PR?

@DaughterOfMars

Copy link
Copy Markdown
Contributor Author

Maybe a conflict resolution issue but we're removing affected_address with this PR?

sounds like it yeah, I'll fix it

self.function = function.into();
/// Select on a function, kind, address or object, replacing the selector
/// already set, if any.
pub fn with_selector(mut self, selector: impl Into<Option<TransactionsSelector>>) -> Self {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this the only one that accepts an option? I think it's weird that you can call any of the other setters with None and it resets no matter what was actually preset. It's just a bit confusing. I think it's fine to just take plain values for the others?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants