Skip to content

fix(ui): CDN query re-coding - #2919

Draft
renefloor wants to merge 1 commit into
masterfrom
fix/new-cdn-compat
Draft

fix(ui): CDN query re-coding#2919
renefloor wants to merge 1 commit into
masterfrom
fix/new-cdn-compat

Conversation

@renefloor

Copy link
Copy Markdown
Contributor

Submit a pull request

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

Every image attachment fails to load (403). Text, PDFs, avatars, reactions, read receipts all fine — images only, and nothing gets logged because the image cache swallows the error.

Root cause: stream_image_cdn.dart built the resized URL with Uri.replace(queryParameters: {...}), which re-encodes existing query values. The signing params are base64, so = padding became %3D and the signature no longer matched.

Why prod never showed it: the two CDNs sign differently — production CloudFront uses URL-safe base64 (__, ~, -, no = at all), so re-encoding was a no-op. GCP Cloud CDN uses standard base64 with = padding. The bug was always there; the CDN migration just exposed it.

Verified by curl: original URL 200, with resize params and = intact 200, with =→%3D 403. Fixed by rebuilding from the raw query string; all images including GIFs now render on device.

Screenshots / Videos

Simulator Screenshot - iPhone 17 Pro - 2026-08-25 at 10 44 03

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant