Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sticker picker previews not displayed if folder name has % #4548

Open
adbenitez opened this issue Jan 24, 2025 · 3 comments
Open

sticker picker previews not displayed if folder name has % #4548

adbenitez opened this issue Jan 24, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@adbenitez
Copy link
Member

DC version: 1.51.0 (git: v1.33.0-1302-gfd2dfa1d)

if you pick one of them they are displayed properly in chat, it is only in the thumbnails where they are not displayed

Image

@adbenitez adbenitez added the bug Something isn't working label Jan 24, 2025
@WofWca
Copy link
Collaborator

WofWca commented Jan 24, 2025

The relevant code:

const [stickers, setStickers] = useState<{
[key: string]: string[]
}>({})
useEffect(() => {
BackendRemote.rpc
.miscGetStickers(accountId)
.then(stickers => setStickers(stickers))
}, [accountId])

On 1.52.0 (git: v1.33.0-1328-g9b66ba51c) if you use just % instead of %20, you get

"uncaughtError"	{"message":"URI malformed","stack":"URIError: URI malformed\n    at decodeURIComponent (<anonymous>)\n    at Function.<anonymous> (file:///C:/Users/user/AppData/Local/Programs/DeltaChat/resources/app.asar/bundle_out/index.js:31:11045)"}

We probably don't want to use just the filename as src. Perhaps use pathToFileURL() (https://stackoverflow.com/questions/20619488/how-to-convert-local-file-path-to-a-file-url-safely-in-node-js).

Other such places need to be considered as well. For example, we had a lot of problems with thumbnails: #4247.

@Simon-Laux
Copy link
Member

Stickers are outside of blob folder. maybe decode uri component is enough for electron, but tauri needs a custom scheme and browser needs a custom url

@Simon-Laux
Copy link
Member

Actually the problem seems to be that we decode the uri. The simplest solution would be that the sticker bot gets updated to not uri escape folder names. Then the zip file and folder names will also look better as a positive side effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants