fix: update bucket ingestion messages for clarity and pre-select saved buckets#1943
Conversation
…d buckets Port of 68cb5be from the CPD branch to main. Fixes two issues with S3 and IBM COS connectors: clarifies that the settings dialog's bucket selection sets a default filter (not an immediate ingest), and pre-populates the Add Knowledge upload page with the buckets already saved in the connector config so users don't have to re-select them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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)
Walkthrough
ChangesBucket Defaults and UI Copy
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 docstrings
🧪 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: 3
🤖 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 `@frontend/components/connectors/aws-s3/bucket-view.tsx`:
- Line 29: The useS3DefaultsQuery on line 29 returns defaults that may belong to
a different S3 connection than the current connector. Before using
defaults?.bucket_names on line 42 to set initialSelectedBuckets, add a check to
verify that defaults?.connection_id matches the current connector.connectionId.
Only pass defaults?.bucket_names to initialSelectedBuckets if the connection IDs
match; otherwise, pass undefined or an empty array to avoid preselecting buckets
from a different connection.
In `@frontend/components/connectors/shared-bucket-view.tsx`:
- Around line 58-79: The useEffect hook in SharedBucketView is not properly
preventing re-application of initial defaults. The issue is twofold: first, the
condition checks whether initialSelectedBuckets exist but does not verify that
the user hasn't already made manual selections in selectedBuckets, so defaults
can overwrite user choices. Second, hasAppliedInitial.current is only set to
true when valid.length is greater than zero, allowing the effect to re-run on
subsequent bucket updates and silently change the bucket_filter. Fix this by
adding a check to ensure selectedBuckets is empty before applying defaults, and
move the hasAppliedInitial.current = true assignment outside the valid.length
conditional so it is always set after the first evaluation, preventing the
effect from running multiple times.
In `@frontend/enhancements/connectors/ibm-cos/components/bucket-view.tsx`:
- Line 29: The useIBMCOSDefaultsQuery call does not filter defaults by the
current connector's connection ID, causing bucket_names from wrong connector
profiles to be used when multiple IBM COS connections exist. Modify the
useIBMCOSDefaultsQuery hook call to include the current connector.connectionId
as a parameter or filter, and add a validation check before using
defaults?.bucket_names at the point where it's forwarded (around line 42) to
ensure the returned defaults actually belong to the current
connector.connectionId before applying them to the selection.
🪄 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: 8c80f807-2ef1-4655-beb4-bfb2f00c5ef1
📒 Files selected for processing (7)
frontend/app/settings/_components/s3-settings-dialog.tsxfrontend/app/settings/_components/s3-settings-form.tsxfrontend/components/connectors/aws-s3/bucket-view.tsxfrontend/components/connectors/shared-bucket-view.tsxfrontend/enhancements/connectors/ibm-cos/components/bucket-view.tsxfrontend/enhancements/connectors/ibm-cos/settings-dialog.tsxfrontend/enhancements/connectors/ibm-cos/settings-form.tsx
The defaults query returns the first S3/COS connection regardless of active status. Only pre-select saved bucket_names when the defaults connection_id matches the current connector.connectionId to avoid seeding the wrong buckets if a stale connection exists alongside the active one. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two issues in the initial-selection effect: 1. hasAppliedInitial was only set when valid buckets were found, leaving the effect live across bucket refreshes and allowing stale defaults to overwrite selections made after a refetch. 2. No guard against the async race where buckets loads before initialSelectedBuckets: user clicks buckets, defaults arrive later and silently overwrite them. Fix: mark hasAppliedInitial unconditionally on first evaluation, and only apply defaults when selectedBuckets is still empty (user hasn't acted yet). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Port of 68cb5be from the CPD branch to main. Fixes two issues with S3 and IBM COS connectors: clarifies that the settings dialog's bucket selection sets a default filter (not an immediate ingest), and pre-populates the Add Knowledge upload page with the buckets already saved in the connector config so users don't have to re-select them.
Summary by CodeRabbit
Release Notes
New Features
UI/UX Improvements