Fix CDN image resizer host matching and dimension edge cases - #6640
Draft
aleksandar-apostolov wants to merge 1 commit into
Draft
Fix CDN image resizer host matching and dimension edge cases#6640aleksandar-apostolov wants to merge 1 commit into
aleksandar-apostolov wants to merge 1 commit into
Conversation
- 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
Contributor
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
Contributor
SDK Size Comparison 📏
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Goal
Closes AND-1393 — follow-up correctness fixes for the CDN image resizer (shipped in #6631), from code review.
Implementation
isStreamCdnHostednow matches the defaultSTREAM_CDN_HOST_PATTERNor a customcdnHost(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).@DeprecatedReplaceWith("streamCdnImageResizer")onChatUI.streamCdnImageResizing(it generated uncompilable code — aStreamCdnImageResizingvalue assigned to aStreamCdnImageResizerproperty); documented manual migration instead.Testing
Added client tests: additive host (a default Stream CDN URL still resizes when a custom
cdnHostis set) and non-positive original dimensions.spotlessCheck,detekt,apiDump(no change), andStringExtensionsKtTestall green.