regression: prevent S3 region empty string from blocking env var fallback - #39711
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (3)📓 Common learnings📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
🔇 Additional comments (1)
WalkthroughThe Amazon S3 configuration file was refactored to conditionally assign the region property only when a Region value is provided, rather than unconditionally including it in the connection configuration. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #39711 +/- ##
===========================================
- Coverage 70.91% 70.86% -0.06%
===========================================
Files 3209 3209
Lines 113893 113893
Branches 20689 20636 -53
===========================================
- Hits 80765 80708 -57
- Misses 31071 31129 +58
+ Partials 2057 2056 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
is there any way to test this? |
This PR fixes a regression introduced in #36659 (AWS SDK v3 upgrade) where users configuring S3 file storage without explicitly setting a region in Rocket.Chat settings would see an uncaught exception:
Root cause
The
FileUpload_S3_Regionsetting defaults to an empty string (''). Previously, AWS SDK v2 handled this gracefully by defaulting tous-east-1:However, AWS SDK v3 throws an error when region is falsy:
The key difference is that SDK v3 still accepts undefined (falling back to
AWS_REGIONenv var), but rejects empty string''.Proposed changes (including videos or screenshots)
Align region handling with the existing pattern used for credentials and endpoint - only pass to SDK when value is truthy. This allows users to either:
Issue(s)
Steps to test or reproduce
Before fix:
AWS_REGION=us-east-1environment variableAfter fix:
AWS_REGIONfrom environmentFurther comments
Didn’t add a changeset since the fix is within the same release window as the bug that introduced it.
Summary by CodeRabbit