Skip to content

fix: avoid mutating resource paths in ODataRequestCount#1121

Open
Louis-Stegra wants to merge 1 commit intoSAP:mainfrom
Louis-Stegra:fix/stateful-odata4-count-request-builder
Open

fix: avoid mutating resource paths in ODataRequestCount#1121
Louis-Stegra wants to merge 1 commit intoSAP:mainfrom
Louis-Stegra:fix/stateful-odata4-count-request-builder

Conversation

@Louis-Stegra
Copy link

@Louis-Stegra Louis-Stegra commented Mar 14, 2026

Context

Bug report: #1120

Feature scope:

CountRequestBuilder.toRequest() for OData V4 had the side effect of mutating the shared ODataResourcePath when appending $count to it. Reusing the same builder could therefore produce invalid paths such as $count/$count. This change makes ODataRequestCount copy the incoming resource path before appending extra segments, so repeated toRequest() calls remain stable and do not corrupt later execution.

That fix was inspired by a similar implementation in ODataRequestFunction

Feature scopes:

  • Prevent ODataRequestCount constructors from mutating the provided ODataResourcePath
  • Add a low-level regression test proving ODataRequestCount does not modify the original resource path
  • Add a V4 builder-level regression test proving repeated CountRequestBuilder.toRequest() calls return the same URI

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

@cla-assistant
Copy link

cla-assistant bot commented Mar 14, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant