Conversation
This was referenced Jun 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a narrowly scoped alternative to the widely-used getFromACASServerInternal helper so that specific routes (notably experiments-by-protocol-codename) can preserve upstream HTTP status codes (e.g., 404) instead of coercing all non-200 responses into a 500.
Changes:
- Added
getFromACASServerInternalPreserveResponseStatusto return(response.statusCode, body)for any upstream response. - Updated the experiments-by-protocol-codename route to use the new helper so 404s remain 404s.
- Added a Mocha spec to validate that a 404 response is preserved.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| modules/ServerAPI/src/server/routes/ServerUtilityFunctions.coffee | Adds a new GET helper that preserves upstream HTTP status codes. |
| modules/ServerAPI/src/server/routes/ExperimentServiceRoutes.coffee | Switches the protocol-codename experiments fetch to the new helper. |
| modules/ServerAPI/spec/serviceTests/ServerUtilityFunctionsMochaSpec.coffee | Adds test coverage for preserved 404 behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+164
to
165
| serverUtilityFunctions.getFromACASServerInternalPreserveResponseStatus baseurl, (statusCode, value) -> | ||
| callback(statusCode, value) |
| console.log 'got ajax error' | ||
| console.log error | ||
| console.log json | ||
| callback 500, {error: true, message:error} |
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.
Description
The route for fetching experiments by protocol code was returning 500 error when protocol didn't exist. I papered over this with acasclient code to convert 500 errors into
Noneresults, which then obfuscated real 500 errors like those caused by Java OOM errors.The
getFromACASServerInternalfunction (used very widely in this codebase) converts any non-200 responses into 500s, so instead of changing that ubiquitous behavior, I've added a narrow alternative that preserves status codes on responses.This PR is part 2 of 3:
Related Issue
How Has This Been Tested?
[]