Commit ee07803
Fix console replay to use unwrapped version with correct parameter order
Critical fix for Pro Integration Tests failures.
Problem:
- Changed from consoleReplay() to buildConsoleReplay() in previous commit
- buildConsoleReplay() wraps output in <script> tags
- createResultObject() expects unwrapped JavaScript code
- Tests failing with: expected "console.log..." got "<script id=..."
Root Cause Analysis:
- consoleReplay signature: (customConsoleHistory, numberOfMessagesToSkip)
- buildConsoleReplay signature: (numberOfMessagesToSkip, customConsoleHistory, nonce)
- Original code had WRONG parameter order for consoleReplay
- My "fix" switched to buildConsoleReplay but introduced wrapping issue
Solution:
- Revert to consoleReplay() for unwrapped output
- Fix parameter order: consoleReplay(consoleHistory, previouslyReplayedConsoleMessages)
- This gives unwrapped JS AND correct parameter order
Testing:
- Should fix Pro Integration Tests console logging spec
- Should fix renderer_console_logging_spec.rb failures
References:
- consoleReplay: packages/react-on-rails/src/buildConsoleReplay.ts:18-20
- buildConsoleReplay: packages/react-on-rails/src/buildConsoleReplay.ts:57-60
- Failed test: react_on_rails_pro/spec/requests/renderer_console_logging_spec.rb:52
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 527aca1 commit ee07803
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
0 commit comments