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

State ETag support with HTTP protocol #540

Open
heunghingwan opened this issue Oct 19, 2023 · 5 comments
Open

State ETag support with HTTP protocol #540

heunghingwan opened this issue Oct 19, 2023 · 5 comments
Labels
enhancement New feature or request pinned

Comments

@heunghingwan
Copy link
Contributor

Describe the proposal

State ETag support has been added in #476, but it is limited to the grpc protocol. When using the http protocol, the ETag cannot be obtained through the get function.
Not sure how to change it in a backwards compatible way, may be with a new function like getWithMetadata?

@shubham1172
Copy link
Member

shubham1172 commented Oct 26, 2023

Hi @heunghingwan, the ETAG comes back in the response header which we seem to be ignoring/dropping. Only the response body is being returned as Key-Value pairs via get method.

To be backward compatible, I propose a new method getState that looks like this:

async getState(statestore: string, key: string, options?: Partial<StateGetOptions>): Promise<GetStateResponse> {};

type GetStateResponse = {
  key: string,
  value: KeyValueType;
  etag?: string;
};

We can also add a deprecation notice to get function and remove it eventually in the next major release.

@shubham1172
Copy link
Member

@XavierGeerinck what are your thoughts?

@XavierGeerinck
Copy link
Contributor

maybe with getFullState or getWithMetadata (as proposed)

@shubham1172
Copy link
Member

After discussing with Xavier offline, I am also in favor of getWithMetadata since state.getState will be awkward to look at. In the next major release, we can deprecate getWithMetadata and add the same functionality to get.

@dapr-bot
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added the stale label Dec 26, 2023
@shubham1172 shubham1172 added pinned enhancement New feature or request and removed stale labels Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

No branches or pull requests

4 participants