fix(ui): enrich link previews for uppercase URL schemes#2844
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
914bfc8 to
6fa1172
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v9 #2844 +/- ##
=====================================
Coverage ? 67.19%
=====================================
Files ? 430
Lines ? 27146
Branches ? 0
=====================================
Hits ? 18242
Misses ? 8904
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Uppercase schemes like `HTTPS://` were detected but forwarded verbatim to the enrichment endpoint, which failed to return link-preview data. Normalize the scheme before enriching so `HTTPS://` behaves like `https://`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6fa1172 to
5bcd890
Compare
Summary
Fixes FLU-625 for the v9 release line. URLs with an uppercase scheme (e.g.
HTTPS://example.com) were not enriched into link previews, while lowercasehttps://worked.The composer's URL regex already matched uppercase schemes, but the raw matched text was forwarded to
client.enrichUrl(...)verbatim — so the/ogendpoint receivedHTTPS://…and failed to enrich. The fix normalizes the scheme (viaUri.parse, which lowercases it) before enriching, soHTTPS://behaves the same ashttps://.Flutter counterpart to the React (#3226) and Angular (#734) fixes. v10 counterpart: #2843.
Scope
This fixes the composer link-preview enrichment path. Display-side linkification of uppercase schemes in rendered message text lives in
stream_core_flutterand is out of scope here.Testing
Added
message_input_url_enrichment_test.dart— assertsenrichUrlis called with the normalizedhttps://example.comfor both uppercase and lowercase input. Fails before the fix, passes after.🤖 Generated with Claude Code