fix: resolve 4 bugs in termui - #3560
Conversation
📝 WalkthroughWalkthroughThis change updates example keyboard parsing to use radix 10, tracks and replaces the weather refresh interval on ChangesExample runtime fixes
Dev-server reload logging
Estimated code review effort: 2 (Simple) | ~8 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Biome (2.5.6)packages/dev-server/src/server.tsFile contains syntax errors that prevent linting: Line 383: Expected a parenthesis '(' but instead found '=>'. 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: 1
🤖 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 `@packages/dev-server/src/server.ts`:
- Line 383: Fix the malformed catch callback in the exitedPromise handling by
declaring a parameter for the rejection value, then preserve the existing
console.error logging using that value.
🪄 Autofix
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2a139afb-c120-4495-a547-298c057e6cbe
📒 Files selected for processing (4)
examples/showcase/src/index.tsxexamples/weather/src/index.tsxexamples/widget-gallery/src/index.tspackages/dev-server/src/server.ts
| this._killChild(); | ||
|
|
||
| await exitedPromise.catch(() => {}); | ||
| await exitedPromise.catch( => console.error()); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
if rg -nP 'exitedPromise\.catch\(\s*=>|catch\(\s*=>' packages/dev-server/src/server.ts; then
echo "Malformed Promise.catch callback remains" >&2
exit 1
fiRepository: Karanjot786/TermUI
Length of output: 261
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'File excerpt:\n'
sed -n '375,388p' packages/dev-server/src/server.ts
printf '\nSyntax check with TypeScript if available:\n'
if command -v tsc >/dev/null 2>&1; then
tmp="$(mktemp -d)/server.ts"
sed -n '1,420p' packages/dev-server/src/server.ts > "$tmp"
if tsc --noEmit --strict --target es2022 --module es2022 "$tmp" 2>&1 | grep -n "383"; then
echo "ERROR"
else
echo "No parse error reported at line 383"
fi
else
echo "tsc not found"
fiRepository: Karanjot786/TermUI
Length of output: 920
Fix the malformed .catch callback.
packages/dev-server/src/server.ts:383 has invalid TypeScript syntax: catch is missing an argument expression, so the source does not compile. Pass the rejection value to the callback.
Proposed fix
- await exitedPromise.catch( => console.error());
+ await exitedPromise.catch((error) => console.error(error));📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| await exitedPromise.catch( => console.error()); | |
| await exitedPromise.catch((error) => console.error(error)); |
🧰 Tools
🪛 Biome (2.5.6)
[error] 383-383: Expected a parenthesis '(' but instead found '=>'.
(parse)
🤖 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 `@packages/dev-server/src/server.ts` at line 383, Fix the malformed catch
callback in the exitedPromise handling by declaring a parameter for the
rejection value, then preserve the existing console.error logging using that
value.
Source: Linters/SAST tools
Description
This PR fixes real bugs found in the codebase:
parseInt: without10, strings like'0x1F'or'08'parse in unintended bases.parseInt: without10, strings like'0x1F'or'08'parse in unintended bases.Type of Change
How Has This Been Tested?
Checklist
Related Issue
Ref: #3559
Summary by CodeRabbit