fix: properly encode sheet names with special characters in Google Sheets integration#41773
fix: properly encode sheet names with special characters in Google Sheets integration#41773aayushbaluni wants to merge 2 commits intoappsmithorg:releasefrom
Conversation
…names Use application/x-www-form-urlencoded encoding for ranges on values:batchGet so a literal + in sheet titles is sent as %2B instead of being decoded as space. Fixes appsmithorg#41536
|
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 (3)
✅ Files skipped from review due to trivial changes (3)
WalkthroughA new utility encodes Google Sheets API query parameter values; GetStructureMethod and RowsGetMethod now encode A1 ranges and build URIs with the builder's encoded mode. A unit test verifies plus signs are percent-encoded. ChangesGoogle Sheets query-parameter encoding
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Problem
Google Sheets
spreadsheets.values.batchGetrequests send sheet ranges via repeatedrangesquery parameters. Spring built those URIs with default encoding, which left a literal+in an A1 range (for example in the quoted sheet title). Many servers decode+as a space in query strings, so the API saw the wrong sheet name.Change
application/x-www-form-urlencodedrules (URLEncoder) before attaching it as a query parameter, so+is sent as%2B.UriComponentsBuilder.build(true)so values are not double-encoded (consistent with other methods in this plugin that combine encoded path segments with query params).Testing
GoogleSheetsApiEncodingTestasserting encoded output contains%2Band no literal+for a sample range.Fixes #41536.
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests