Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET SDK bug: (Write query) StoreId from query options is not used when transactions are disabled #431

Open
6 of 10 tasks
laerva1801 opened this issue Oct 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@laerva1801
Copy link

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Slack Community and have not found a suitable solution or answer.
  • I agree to the terms within the OpenFGA Code of Conduct.

Description

https://github.com/openfga/dotnet-sdk/blob/8144f2679d29e073ac206691128e3561cdbe1f26/src/OpenFga.Sdk/Client/Client.cs#L226

When using the Write operation in the .NET SDK, StoreId from the options is ignored when transactions are disabled. The StoreId set directly on the client is used instead.

AuthorizationModelId from the options is respected - the same should happen for storeId.

Expectation

StoreId provided in ClientWriteOptions should be read and used regardless of transactions being enabled or not.

Reproduction

  1. Given you have an OpenFgaClient instantiated with a specific storeId (call this "Id 1") provided in ClientConfiguration.
  2. When using the Write operation in the SDK, with transaction set to disabled in the options AND a storeId provided, e.g.
new ClientWriteOptions() {
 StoreId = "<Id 2">,
 AuthorizationModelId = "<some authorization model id>",
 Transaction = new TransactionOptions()
   {
       Disable = true
   }
}
  1. Then the storeId provided in the ClientWriteOptions is not used, and the StoreId set in ClientConfiguration is instead used. (Tuple write goes to storeId "Id 1", not "Id 2" that was provided in query

SDK Checklist

  • JS SDK
  • Go SDK
  • .NET SDK
  • Python SDK
  • Java SDK

OpenFGA SDK version

0.5.1

OpenFGA version

1.6.1

SDK Configuration

Not relevant

Logs

No response

References

No response

@laerva1801 laerva1801 added the bug Something isn't working label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant