fix: correct timeout error page status code#41810
Conversation
WalkthroughError message constants for server timeout scenarios are updated. The HTTP status code changes from ChangesError Message Updates
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/client/src/ce/constants/messages.ts`:
- Around line 492-494: The message for the timeout is semantically inconsistent
with the 408 status; either make the text client-side or change the status
code—update PAGE_SERVER_TIMEOUT_DESCRIPTION (and the adjacent "Request timed
out" constant) so that if you keep HTTP 408 the description reads a
client-focused message like "Your request timed out. Please check your
connection and try again," or if you want to describe a slow server keep the
current wording but change the HTTP status to a server-side timeout (e.g., 504)
wherever the 408 status is defined and used.
- Line 490: The exported constant PAGE_SERVER_TIMEOUT_ERROR_CODE
(PAGE_SERVER_TIMEOUT_ERROR_CODE = () => "408") has semantics mismatch with its
message; update it to return "504" to match the message "The server is taking
too long to respond" OR keep "408" and revise the associated user-facing message
to a client-timeout phrasing like "Your request took too long. Please try
again."; also review the PR reference to issue `#41544` and correct or remove that
issue ID if it is unrelated to timeout handling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2d67e0b7-d017-4ef5-bc1a-457a1568bf11
📒 Files selected for processing (1)
app/client/src/ce/constants/messages.ts
| export const PAGE_NOT_FOUND_TITLE = () => "404"; | ||
| export const PAGE_NOT_FOUND = () => "Page not found"; | ||
| export const PAGE_SERVER_TIMEOUT_ERROR_CODE = () => "504"; | ||
| export const PAGE_SERVER_TIMEOUT_ERROR_CODE = () => "408"; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for usage context of PAGE_SERVER_TIMEOUT_ERROR_CODE to understand the timeout scenario
rg -n -C5 'PAGE_SERVER_TIMEOUT_ERROR_CODE' --type=ts --type=tsxRepository: appsmithorg/appsmith
Length of output: 92
🏁 Script executed:
#!/bin/bash
# Search for usage context of PAGE_SERVER_TIMEOUT_ERROR_CODE
rg -n -C5 'PAGE_SERVER_TIMEOUT_ERROR_CODE' --type=tsRepository: appsmithorg/appsmith
Length of output: 2858
🏁 Script executed:
#!/bin/bash
# Search for any references to issue `#41544` or timeout error handling in the codebase
rg -n 'PAGE_SERVER_TIMEOUT|timeout.*error|408|504' app/client/src/ce/constants/ --type=ts -A2 -B2Repository: appsmithorg/appsmith
Length of output: 854
🏁 Script executed:
#!/bin/bash
# Look for the actual error page or handler that uses this constant
fd -e ts -e tsx . app/client/src/ | xargs rg -l 'PAGE_SERVER_TIMEOUT_ERROR_CODE|PAGE_SERVER_TIMEOUT_TITLE|PAGE_SERVER_TIMEOUT_DESCRIPTION' | head -20Repository: appsmithorg/appsmith
Length of output: 161
The error code and message have conflicting semantics.
HTTP 408 (Request Timeout) indicates the client failed to send a request within the timeout window, while the message "The server is taking too long to respond" describes server-side behavior, which aligns with HTTP 504 (Gateway Timeout).
Either:
- Change code to
"504"to match the message semantics, or - Reword the message to reflect client timeout semantics (e.g., "Your request took too long. Please try again.")
Additionally, verify that issue #41544 referenced in the PR ("Allowing only invited users to register is not working") is the correct issue—it appears unrelated to timeout error codes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@app/client/src/ce/constants/messages.ts` at line 490, The exported constant
PAGE_SERVER_TIMEOUT_ERROR_CODE (PAGE_SERVER_TIMEOUT_ERROR_CODE = () => "408")
has semantics mismatch with its message; update it to return "504" to match the
message "The server is taking too long to respond" OR keep "408" and revise the
associated user-facing message to a client-timeout phrasing like "Your request
took too long. Please try again."; also review the PR reference to issue `#41544`
and correct or remove that issue ID if it is unrelated to timeout handling.
| "Request timed out"; | ||
| export const PAGE_SERVER_TIMEOUT_DESCRIPTION = () => | ||
| `Please retry after some time`; | ||
| `The server is taking too long to respond. Please retry after some time`; |
There was a problem hiding this comment.
Semantic inconsistency between error code and error message.
The error code 408 (Request Timeout) indicates a client-side timeout, but the description "The server is taking too long to respond" describes a server-side timeout scenario. This creates confusion:
-
If this is truly a client-side timeout (client didn't send request in time) → Use 408, but update the message to something like: "Your request timed out. Please check your connection and try again."
-
If this is a server-side timeout (server/API taking too long to respond to a completed request) → The message is correct, but revert the status code to 504 or use 503.
The message should semantically align with the chosen status code to avoid user confusion and aid in troubleshooting.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@app/client/src/ce/constants/messages.ts` around lines 492 - 494, The message
for the timeout is semantically inconsistent with the 408 status; either make
the text client-side or change the status code—update
PAGE_SERVER_TIMEOUT_DESCRIPTION (and the adjacent "Request timed out" constant)
so that if you keep HTTP 408 the description reads a client-focused message like
"Your request timed out. Please check your connection and try again," or if you
want to describe a slow server keep the current wording but change the HTTP
status to a server-side timeout (e.g., 504) wherever the 408 status is defined
and used.
Summary
This PR fixes the misleading timeout error page status code.
The current timeout page displays 504, which suggests a gateway timeout. However, this error is triggered by a client-side request timeout, so 408 is more appropriate.
Changes
Fixes #41544
Summary by CodeRabbit