fix: report actual synced connection count in connector_sync (#1547)#1815
fix: report actual synced connection count in connector_sync (#1547)#1815hunterxtang wants to merge 6 commits into
Conversation
|
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 selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthroughconnector_sync now sets connections_synced from the number of dispatched tasks (len(task_ids)) and uses a singular message when appropriate. A new async unit test verifies the HTTP 201 response, message wording, connections_synced value, returned task_ids, and that only one sync task was dispatched and awaited. ChangesConnector sync response count
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
🚥 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 `@tests/unit/api/test_connector_sync_response.py`:
- Line 109: Remove the stray signature comment "# Made with Bob" from the test
file; locate the comment in tests/unit/api/test_connector_sync_response.py
(search for the exact string "# Made with Bob") and delete that line so the file
contains only test code and no personal/signature comments.
🪄 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: 4f582f41-8469-44a9-9926-c634d14a82f2
📒 Files selected for processing (2)
src/api/connectors.pytests/unit/api/test_connector_sync_response.py
8512d02 to
baaad33
Compare
…m/hunterxtang/openrag into fix/1547-connections-synced-count
The connector_sync function signature was updated in langflow-ai#1782 to include request and session parameters. This test was written against the old signature and failed with TypeError before reaching any assertions. Fixes the test to pass both required parameters as MagicMock instances.
richardz403
left a comment
There was a problem hiding this comment.
Ran the unit test test_connector_sync_response and the changes seem to be in order.
Fixes #1547
connector_sync reported connections_synced: len(active_connections), but it selects only the first working connection and dispatches a single task, so the count (and the message) were inflated whenever multiple connections were active. Changed to len(task_ids) and fixed the matching message to singular.
Added test_connector_sync_reports_one_connection_with_multiple_active: with 3 active connections it asserts connections_synced == 1. Verified it fails on main (reports 3) and passes with the fix.
Summary by CodeRabbit
Bug Fixes
Tests