-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal Server Error When Using Offset >= Total Organizations and Limit = 0 in Organization Discovery GET API #21025
Internal Server Error When Using Offset >= Total Organizations and Limit = 0 in Organization Discovery GET API #21025
Comments
For testing purposes, you can create 10 organizations using the following bash script.
|
Note
These tests will no longer be necessary after the fix. |
@BimsaraBodaragama, just a gentle reminder to review the related PR. |
Describe the issue:
When querying the Organization Discovery GET API with an offset greater than or equal to the total number of organizations and with a limit of 0, the server returns a 500 Internal Server Error. The error message indicates an "Unexpected Processing Error" and the server logs show a
StackOverflowError
caused by a recursive call in thecalculateOffsetForPreviousLink
method.Error Message:
How to reproduce:
offset=10
andlimit=0
.offset=15
andlimit=0
to observe the same behavior (you can use any offset greater than the total number of organizations for demonstration).Example Requests:
Expected behavior:
The API should return a valid response with
count=0
,startIndex=offset+1
, and aprevious link
as shown in the responses for other valid limits. The API should not cause a server error or throw aStackOverflowError
.The text was updated successfully, but these errors were encountered: