consul-api icon indicating copy to clipboard operation
consul-api copied to clipboard

Add a check-and-set to deleteKV without changing return type

Open Anusien opened this issue 5 years ago • 7 comments

The main dilemma with adding check-and-set to deleteKV is that all the delete KV methods return Response<Void>. Consequently we can't actually return whether the c-a-s worked. We can't change Response<Void> to Response<Boolean> without breaking a lot of existing code.

This just adds the capability for check-and-set but punts on the Response<Void> problem. If callers want to see if the delete succeeded, they'll have to do another getKV. However, this is the least invasive version of this change.

https://github.com/Ecwid/consul-api/issues/49

Anusien avatar Jan 07 '20 22:01 Anusien

This intentionally doesn't attempt to mess with the return type in the hopes of making incremental progress. Of the four possible solutions I outlined, this is number 1.

Anusien avatar Jan 07 '20 22:01 Anusien

The CI failure:

Could not GET 'https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-engine/5.1.0/junit-jupiter-engine-5.1.0.pom'. Received status code 403 from server: Forbidden

Anusien avatar Jan 08 '20 18:01 Anusien

@vgv any thoughts on approach?

Anusien avatar Jan 09 '20 18:01 Anusien

@vgv Did you have a chance to look at this?

Anusien avatar Mar 02 '20 23:03 Anusien

Hi, sorry for long response. I will look into PR this weekend.

vgv avatar Mar 03 '20 06:03 vgv

Just curious if you had a chance to look at this or any opinions on the approach.

Anusien avatar Jul 01 '21 16:07 Anusien

Hello! I am following up on this. Are there any concerns about this @vgv?

ParthKolekar avatar Oct 12 '23 06:10 ParthKolekar