Open heunghingwan opened 10 months ago
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.
@XavierGeerinck what are your thoughts?
maybe with getFullState
or getWithMetadata
(as proposed)
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
.
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.
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
?