Skip to content

Fix CDN image resizer host matching and dimension edge cases - #6640

Draft
aleksandar-apostolov wants to merge 1 commit into
developfrom
fix/cdn-resizer-review-followup
Draft

Fix CDN image resizer host matching and dimension edge cases#6640
aleksandar-apostolov wants to merge 1 commit into
developfrom
fix/cdn-resizer-review-followup

Conversation

@aleksandar-apostolov

Copy link
Copy Markdown
Contributor

Goal

Closes AND-1393 — follow-up correctness fixes for the CDN image resizer (shipped in #6631), from code review.

Implementation

  • isStreamCdnHosted now matches the default STREAM_CDN_HOST_PATTERN or a custom cdnHost (additive), matching its KDoc — a custom host no longer disables resizing of default Stream CDN images.
  • createResizedStreamCdnImageUrl(maxImagePixels) returns the URL unchanged for non-positive original dimensions (two negatives previously passed the positive-product check and appended negative params).
  • Removed the invalid @Deprecated ReplaceWith("streamCdnImageResizer") on ChatUI.streamCdnImageResizing (it generated uncompilable code — a StreamCdnImageResizing value assigned to a StreamCdnImageResizer property); documented manual migration instead.

Testing

Added client tests: additive host (a default Stream CDN URL still resizes when a custom cdnHost is set) and non-positive original dimensions. spotlessCheck, detekt, apiDump (no change), and StringExtensionsKtTest all green.

- Make custom cdnHost matching additive: isStreamCdnHosted now matches the
  default STREAM_CDN_HOST_PATTERN OR the custom cdnHost, matching the KDoc
- Guard non-positive original dimensions in the max-pixel resize overload
  (two negatives previously slipped through the positive-product check)
- Drop the invalid @deprecated ReplaceWith on ChatUI.streamCdnImageResizing
  (it generated uncompilable code); document manual migration instead
@github-actions

Copy link
Copy Markdown
Contributor

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@github-actions

Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.98 MB 5.98 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.28 MB 11.28 MB 0.00 MB 🟢
stream-chat-android-compose 12.77 MB 12.77 MB 0.00 MB 🟢

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant