Skip to content

Conversation

@gnprice
Copy link
Member

@gnprice gnprice commented Jul 31, 2025

Fixes #1709.

Commit messages

314c83c api [nfc]: Rename field UploadFileResult.url from "uri"

Like elsewhere in our codebase, use the standard term "URL":
https://github.com/zulip/zulip-mobile/blob/main/docs/style.md#url-not-uri

c7f336c compose [nfc]: Take a URL string at inlineLink, rather than a Uri object

This way this function is a more faithful wrapper of constructing
the actual Markdown syntax. The Markdown will have a URL string,
after all, so it's for the best to put this function's caller in
control of exactly what string that is.

2e06a67 compose: For uploads, use verbatim URL string from server

Fixes #1709.

Round-tripping through Uri.parse and .toString() had the effect
of percent-encoding any non-ASCII characters in the given URL string.
The server expects, reasonably enough, that the client will refer to
the upload using the same URL string the server provided at upload
time; so do that.

6a35cc4 compose [nfc]: Simplify inlineLink by dropping null destination

Now that the caller is passing a string instead of a Uri object, the
caller that wants an empty string here can just pass an empty string.

gnprice added 4 commits July 31, 2025 13:14
This way this function is a more faithful wrapper of constructing
the actual Markdown syntax.  The Markdown will have a URL string,
after all, so it's for the best to put this function's caller in
control of exactly what string that is.
Fixes zulip#1709.

Round-tripping through `Uri.parse` and `.toString()` had the effect
of percent-encoding any non-ASCII characters in the given URL string.
The server expects, reasonably enough, that the client will refer to
the upload using the same URL string the server provided at upload
time; so do that.
Now that the caller is passing a string instead of a Uri object, the
caller that wants an empty string here can just pass an empty string.
@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Jul 31, 2025
@chrisbobbe chrisbobbe merged commit 6a35cc4 into zulip:main Aug 1, 2025
1 check passed
@chrisbobbe
Copy link
Collaborator

Thanks, LGTM! Merged.

@gnprice gnprice deleted the pr-upload-url branch August 1, 2025 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer review PR ready for review by Zulip maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uploaded file's URL gets percent-encoded, breaking permissions

2 participants