Skip to content

(2 of 5) Migrate transaction docs and examples off disableTransactions to transactions()/isTransactionsEnabled() #368

Description

@curfew-marathon

Context

PR #352 added an affirmative transaction API to ClientWriteOptions: transactions(boolean) and isTransactionsEnabled(). These replace the double-negative disableTransactions(boolean) / disableTransactions() pair. Both APIs currently coexist and neither old method is deprecated yet.

Before the old methods can be deprecated, the public guidance that still teaches them has to move to the new API. If deprecation lands first, released docs and examples will steer users onto methods that emit warnings. This was raised in review on PR #352.

This issue covers the hand-written docs and examples in the java-sdk repo. The generated README.md is tracked separately in openfga/sdk-generator (its template is the source of truth).

Scope

Migrate disableTransactions(true) to transactions(false) and disableTransactions(false) to transactions(true), and mode-checks from options.disableTransactions() to !options.isTransactionsEnabled().

Javadoc:

  • src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java mode-selection prose around lines 415, 424, 469, 478

Example projects:

  • examples/basic-examples/src/main/java/dev/openfga/sdk/example/Example1.java:120
  • examples/basic-examples/src/main/kotlin/dev/openfga/sdk/example/KotlinExample1.kt:120
  • src/test-integration/java/dev/openfga/sdk/example/Example1.java:120

Out of scope

  • README.md write examples (lines 617, 628, 653): generated, fixed via openfga/sdk-generator.
  • Test call-sites in OpenFgaClientTest, OpenFgaClientHeadersTest, OpenFgaClientWriteResponseHeadersTest: migrated as part of the deprecation issue, so at least one back-compat test intentionally keeps disableTransactions.
  • Adding the @Deprecated annotation: separate issue, gated on this one shipping in a release.

Acceptance criteria

  • No disableTransactions(...) calls remain in OpenFgaClient.java Javadoc or in the three example files listed.
  • Mode-selection Javadoc describes behavior in terms of isTransactionsEnabled().
  • Example output and behavior are unchanged (transactions(false) is exactly equivalent to the prior disableTransactions(true)).
  • Examples compile and run.

Sequencing

First step in the deprecation lifecycle. Blocks the deprecation issue: that issue stays blocked until this change is in a published release, not just merged. Tracked in the umbrella issue.

Owner: @curfew-marathon

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions