Skip to content

(4 of 5) Deprecate disableTransactions(boolean)/disableTransactions() in favour of transactions()/isTransactionsEnabled() #369

Description

@curfew-marathon

Context

PR #352 added transactions(boolean) and isTransactionsEnabled() to ClientWriteOptions as the affirmative replacement for disableTransactions(boolean) / disableTransactions(). An early commit on that PR (a4540c6) deprecated both old methods, but the final commit (2445..., "remove deprecation from disableTransactions, keep dual paths") removed the annotations so the docs could be updated first. This issue re-applies the deprecation.

Preconditions

  • Step 1 docs shipped in a published release: java-sdk docs/examples, the sdk-generator README template, and the spring-boot-starter example. Do not start this until those are released, not just merged. If deprecation lands while released docs still teach disableTransactions, users copy a method that now warns.

Scope

src/main/java/dev/openfga/sdk/api/configuration/ClientWriteOptions.java:

  • Re-apply @Deprecated to disableTransactions(boolean) (line 92) and disableTransactions() (line 102).
  • Add @deprecated Javadoc tags pointing to transactions(boolean) and isTransactionsEnabled(), noting isTransactionsEnabled() returns the inverse of disableTransactions(). Reuse the wording from commit a4540c6.

Migrate internal call-sites so the build stays warning-clean:

  • src/test/java/dev/openfga/sdk/api/client/OpenFgaClientTest.java lines 1288, 1356, 1433, 1476, 1686
  • src/test/java/dev/openfga/sdk/api/client/OpenFgaClientHeadersTest.java:443
  • src/test/java/dev/openfga/sdk/api/client/OpenFgaClientWriteResponseHeadersTest.java:175

Keep one focused test that still calls disableTransactions(true/false) with @SuppressWarnings("deprecation"), asserting the old and new methods invert each other, so the backward-compatible path stays covered.

Acceptance criteria

  • Both disableTransactions overloads carry @Deprecated and a @deprecated Javadoc tag naming the replacement.
  • Build passes with deprecation warnings treated as errors if the project enables that (-Xlint:deprecation / -Werror), or the deprecated calls are confined to the one suppressed back-compat test.
  • A test asserts transactions(false) implies disableTransactions() == true, and disableTransactions(true) implies isTransactionsEnabled() == false.
  • CHANGELOG notes the deprecation and the migration mapping.

Sequencing

Step 2. Blocked by step 1 being released (java-sdk docs/examples, sdk-generator template, spring-boot-starter example). Blocks the removal issue. Tracked in the umbrella issue.

Owner: @curfew-marathon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Intake

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions