feat: improve js and python templates on send message error handling#2109
feat: improve js and python templates on send message error handling#2109derberg wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 2299639 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
What reviewer looks at during PR reviewThe following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughUpdates WebSocket client generation to surface send errors instead of suppressing them. Python and JavaScript templates add constructor flags ( ChangesWebSocket Send Error Handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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/templates/clients/websocket/python/components/InitSignature.js`:
- Around line 19-22: InitSignature generates an invalid Python signature when
queryParamsArguments is empty array (producing a stray comma); update the
early-return/conditional in InitSignature to treat both null/undefined and empty
arrays/strings as "no query params" (e.g., check for !queryParams ||
(Array.isArray(queryParams) && queryParams.length === 0) or queryParams === ''),
and ensure the template only inserts the comma when queryParamsArguments is
non-empty so the generated def __init__ signature (in InitSignature) is valid;
trace callers ClientClass → Constructor where queryParamsArray is produced from
getQueryParams to verify empty Map/object becomes an empty array handled by this
check.
🪄 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: e098ac31-4188-44e5-8432-e24e2ed94f99
⛔ Files ignored due to path filters (8)
packages/components/test/components/__snapshots__/Readme.test.js.snapis excluded by!**/*.snappackages/components/test/components/__snapshots__/SendOperations.test.js.snapis excluded by!**/*.snappackages/components/test/components/__snapshots__/Usage.test.js.snapis excluded by!**/*.snappackages/templates/clients/websocket/python/test/components/__snapshots__/Constructor.test.js.snapis excluded by!**/*.snappackages/templates/clients/websocket/python/test/components/__snapshots__/InitSignature.test.js.snapis excluded by!**/*.snappackages/templates/clients/websocket/python/test/components/__snapshots__/Send.test.js.snapis excluded by!**/*.snappackages/templates/clients/websocket/test/integration-test/__snapshots__/integration.test.js.javascript.snapis excluded by!**/*.snappackages/templates/clients/websocket/test/integration-test/__snapshots__/integration.test.js.python.snapis excluded by!**/*.snap
📒 Files selected for processing (8)
.changeset/fix-ws-swallowed-send-errors.mdAGENTS.mdpackages/components/src/components/SendOperations.jspackages/components/src/components/readme/Usage.jspackages/templates/clients/websocket/javascript/components/Constructor.jspackages/templates/clients/websocket/python/components/Constructor.jspackages/templates/clients/websocket/python/components/InitSignature.jspackages/templates/clients/websocket/python/components/Send.js
|
@derberg lgtm but you need to resolve conflicts |
# Conflicts: # packages/components/src/components/SendOperations.js # packages/components/test/components/__snapshots__/SendOperations.test.js.snap # packages/templates/clients/websocket/test/integration-test/__snapshots__/integration.test.js.javascript.snap
|
|
/rtm |
|
@derberg can't merge it becoz of changes outside packages folder. |



fix #1858
I fixed not only in python but js as well as there was the same error
also added flag to constructors for user to disable this behaviour
also as agreed - agentic flow improved - changeset generation sucked so agents.md improved
Summary by CodeRabbit
New Features
Bug Fixes
Documentation