Skip to content

Conversation

@newtork
Copy link
Contributor

@newtork newtork commented Jul 1, 2025

Context

https://github.com/SAP/cloud-sdk-java-backlog/issues/481

Please provide a short description of what your change does and why it is needed.

Feature scope:

For Generic OData Client:

  • Switch default behavior for HttpResponse entity from lazy-buffered to `eagerly-buffered.
  • Switch optional feature toggle from disableBufferingHttpResponse() on ODataRequestResultGeneric to withoutResponseBuffering() on ODataRequestRead and ODataRequestReadByKey.
  • Deprecate legacy API, mark new API unstable.

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Documentation updated
  • Release notes updated

@newtork newtork marked this pull request as draft July 1, 2025 19:55
@newtork newtork added do not merge Pull request must not be merged do not review Pull request should not be reviewed labels Jul 2, 2025
@newtork newtork added please merge Request to merge a pull request please review Request to review a pull request and removed do not merge Pull request must not be merged do not review Pull request should not be reviewed labels Jul 16, 2025
@newtork newtork marked this pull request as ready for review July 16, 2025 15:36
Copy link
Member

@MatKuhr MatKuhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

productive code largely LGTM, didn't look at tests yet. I like the non-breaking introduction of AutoClosable, even though it comes at the cost of some new API.

If we want to reduce new API a bit, we could consider adding executeOpen() to ODataRequestExecutable. That would have the downside that this is also on Batch, where then both execute and executeOpen behave the same (since changing execute to now start buffering would be a breaking change 🙁)

But maybe we can somewhere make clearer, that this solution not only buffers, but eagerly buffers. It's good for understanding the importance of having both, as you pointed out 😉

public ODataRequestResultResource.Executable withoutResponseBuffering()
{
requestResultFactory = ODataRequestResultFactory.WITHOUT_BUFFER;
return httpClient -> (ODataRequestResultResource) this.execute(httpClient);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This effectively means that withoutResponseBuffering() will be the last method before executing, but I think that is an acceptable small limitation

Copy link
Member

@MatKuhr MatKuhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests LGTM 👍🏻

Copy link
Member

@rpanackal rpanackal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed low level api changes. Overall looks good to me.

Same concern as @MatKuhr on logging failed buffering of http entity.

That said, I haven't previously looked at this module deeply. So not sure if I missed anything.

Copy link
Member

@MatKuhr MatKuhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise lgtm

@MatKuhr MatKuhr merged commit 08f2777 into main Aug 1, 2025
14 checks passed
@MatKuhr MatKuhr deleted the odata-move-disable-buffer-toggle branch August 1, 2025 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

please merge Request to merge a pull request please review Request to review a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants