Skip to content

Commit 01823f8

Browse files
revert chanegs only keep the error logging block
1 parent 982cf03 commit 01823f8

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

packages/react-on-rails-pro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build-watch": "yarn run clean && yarn run tsc --watch",
99
"clean": "rm -rf ./lib",
1010
"test": "yarn test:non-rsc && yarn test:rsc",
11-
"test:non-rsc": "jest tests --testPathIgnorePatterns=\".*\\.rsc\\.test\\..*\"",
11+
"test:non-rsc": "jest tests --testPathIgnorePatterns=\".*(.rsc.test.).*\"",
1212
"test:rsc": "NODE_CONDITIONS=react-server jest tests/*.rsc.test.*",
1313
"type-check": "yarn run tsc --noEmit --noErrorTruncation",
1414
"prepack": "nps build.prepack",

packages/react-on-rails-pro/src/ReactOnRailsRSC.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const streamRenderRSCComponent = (
5555
transformRenderStreamChunksToResultObject(renderState);
5656

5757
const reportError = (error: Error) => {
58+
console.error('Error in RSC stream', error);
5859
if (throwJsErrors) {
5960
emitError(error);
6061
}

react_on_rails_pro/lib/react_on_rails_pro/request.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ def create_connection
234234
retry_after: ->(req, res) do
235235
Rails.logger.error("An error occured and retry is going to be made")
236236
Rails.logger.error("Error: #{res.error}")
237-
Rails.logger.error("Request Body: #{req.body}")
238-
0
237+
Rails.logger.error("Request Body: #{req.body&.first(1000)}")
238+
nil
239239
end,
240240
)
241241
.plugin(:stream)
@@ -254,12 +254,8 @@ def create_connection
254254
# :operation_timeout
255255
# :keep_alive_timeout
256256
timeout: {
257-
connect_timeout: 100,
258-
read_timeout: 100,
259-
write_timeout: 100,
260-
request_timeout: 100,
261-
operation_timeout: 100,
262-
keep_alive_timeout: 100,
257+
connect_timeout: ReactOnRailsPro.configuration.renderer_http_pool_timeout,
258+
read_timeout: ReactOnRailsPro.configuration.ssr_timeout
263259
}
264260
)
265261
rescue StandardError => e

react_on_rails_pro/spec/dummy/config/initializers/react_on_rails_pro.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
# that the remote renderer works for CI.
2525
config.renderer_use_fallback_exec_js = false
2626

27-
config.renderer_http_pool_timeout = 20
28-
config.ssr_timeout = 30
27+
config.ssr_timeout = 10
2928

3029
config.raise_non_shell_server_rendering_errors = false
3130

@@ -36,7 +35,7 @@
3635

3736
# Retry request in case of time out on the node-renderer side
3837
# 0 - no retry
39-
config.renderer_request_retry_limit = 0
38+
config.renderer_request_retry_limit = 1
4039

4140
# Array of globs to find any files for which changes should bust the fragment cache for
4241
# cached_react_component and cached_react_component_hash. This should

0 commit comments

Comments
 (0)