[EOCI-745] prevent recursive range error on redirects#190
Merged
evanheisler merged 1 commit intomasterfrom Sep 16, 2025
Merged
Conversation
a9f4292 to
93cb037
Compare
Contributor
|
I'm missing the connection between thinking mode and 302 response code - what's that? |
Contributor
Author
Just highlighting it because the timing was suspicious and might spark an idea. The first occurrence I found of this particular error was on 7/31 just after think mode was deployed. |
Contributor
Author
|
To be clear, this change isn't really a fix for whats causing the error, but should cause |
epeters3
approved these changes
Sep 16, 2025
|
🎉 This PR is included in version 7.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
graphql-proxy-servicewill sometimes error with aRangeError: Maximum call stack size exceeded. The log's call stack points to an infinite recursive loop within the @lifeomic/alpha client's request method.The errors occur in the chat agent callstack from various user-agents but its very difficult to tell why. (logs). Bugsnag is reporting these as 502's from flma, but from the logs we can see its not limited to the member app.
Looking back in the logs and matching up dates with changes, it also may have started after introducing thinking mode.
Reviewing the code, the conclusion is that the client is receiving a 301 or 302 response, causing it to re-call itself with the same parameters, leading to the crash. The specific flaw is that the client does not have a safeguard to detect when a redirect points back to the original URL.
The logic now checks if the resolved redirect URL is identical to the original request URL. If they are the same, the redirect chain is immediately broken, and the response is returned to the caller.
This should replace the crash with a non-fatal application error (the returned 302 response). This makes the system stable and allows for safe investigation into which downstream service is issuing the redirect.