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

TableClient.submitTransaction and TableTransaction do not expose OperationOptions #28624

Closed
2 of 6 tasks
NitroXcellerate opened this issue Feb 21, 2024 · 5 comments · Fixed by #32384
Closed
2 of 6 tasks
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables

Comments

@NitroXcellerate
Copy link

  • Package Name: @azure/data-tables
  • Package Version: 13.2.2
  • Operating system:
  • nodejs
    • version: v18.12.1
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug
Currently, there is no way to pass operation options to a Transaction. When using functions like TableClient.upsertEntity and TableClient.createEntity, there is a second parameter called options in which you can pass several options such as an AbortSignal. This parameter is not exposed when using Transactions either via the TableTransaction class or the TableClient.submitTransaction function.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
TableClient.submitTransaction should have a second parameter called options of type OperationOptions.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
https://learn.microsoft.com/en-us/javascript/api/@azure/core-http/operationoptions?view=azure-node-latest
https://learn.microsoft.com/en-us/javascript/api/%40azure/data-tables/tableclient?view=azure-node-latest#@azure-data-tables-tableclient-upsertentity

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables labels Feb 21, 2024
@xirzec
Copy link
Member

xirzec commented Feb 21, 2024

@NitroXcellerate I think I see what you mean, the individual transaction operations have options that are specific to them, but since they are getting bundled into a single transaction request you would like a way to pass request options like an abortsignal.

Seems like we could put an optional argument on submitTransaction and pass that through here instead of an empty object:

/cc @joheredi

@xirzec xirzec removed the needs-team-triage Workflow: This issue needs the team to triage. label Feb 21, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Feb 21, 2024
@NitroXcellerate
Copy link
Author

Hi @xirzec, any update on this issue?

xirzec added a commit to xirzec/azure-sdk-for-js that referenced this issue Dec 30, 2024
@xirzec
Copy link
Member

xirzec commented Dec 30, 2024

Hi @xirzec, any update on this issue?

I have a PR out for this: #32384

@jeremymeng
Copy link
Member

If users cancel submitTransaction() call and are not re-using the same abort signal of the individual operations, should we abort individual operations as well, or only abort the transaction submission itself? I feel that this is ambiguous. Also, currently only the update operation can have its options passed in submitted transaction

/**
* Represents the Create or Delete Entity operation to be included in a Transaction request
*/
export type CreateDeleteEntityAction = ["create" | "delete", TableEntity];
/**
* Represents the Update or Upsert Entity operation to be included in a Transaction request
*/
export type UpdateEntityAction =
| ["update" | "upsert", TableEntity]
| ["update" | "upsert", TableEntity, "Merge" | "Replace"]
| ["update" | "upsert", TableEntity, "Merge" | "Replace", UpdateTableEntityOptions | undefined];

@jeremymeng
Copy link
Member

Ah I see, the bundled operation is submitted to the service. Then I guess most of the individual operation options won't make sense.

xirzec added a commit that referenced this issue Jan 2, 2025
### Packages impacted by this PR

`@azure/data-tables`

### Issues associated with this PR

Fixes #28624

### Describe the problem that is addressed by this PR

`submitTransaction` on `TableClient` didn't allow for passing
request-level options, such as an `AbortSignal` to cancel the request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants