Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.6k stars 821 forks source link

[AppConfig] Inconsistent 304 behavior across different APIs #23325

Open RichardChen820 opened 1 month ago

RichardChen820 commented 1 month ago

In version 1.2.0-beta.1, per-page ETag feature was added. When calling NewListSettingsPagerwith the IfNoneMatch option, if the server responds with a 304 Not Modified, the current behavior of this method is to return a nil ETag and an empty settings collection. This behavior is inconsistent with the GetSetting method.

The GetSetting method yet supports passing the OnlyIfChanged option. Its behavior is that if the server responds with a 304, the method will throw a ResponseError with status code 304. This behavior is inconsistent with that of ListSettingsPager.

It's not that I think a 304 should be treated as a ResponseError, but similar responses should at least have consistent behavior across different APIs.

To me, it might be more reasonable not to throw a ResponseError but instead return a nil setting for GetSetting , a nil settings collection for listing page.

RichardChen820 commented 4 weeks ago

Any thoughts, comments?

RichardChen820 commented 1 week ago

@RickWinter Thoughts?