Skip to content

msgconv: fix size and mimetype of converted animated stickers - #1059

Merged
Fizzadar merged 2 commits into
mainfrom
iFixRobots/was-sticker-size
Nov 23, 2026
Merged

Fizzadar merged 2 commits into
mainfrom
iFixRobots/was-sticker-size

Conversation

@iFixRobots

@iFixRobots iFixRobots commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Animated stickers come from WhatsApp as a zip (application/was), but the bridge only ever delivers the animation.json inside it (or the png/gif/webp/webm when animated_sticker converts it). info.size is still set from the message's FileLength, which is the size of the zip, so clients show the wrong size. A user saw 18,113 B displayed and got a 177,950 B file.

With reupload, the size is now taken from the bytes that actually get uploaded. With direct media, the extraction only happens when the file is downloaded, so the size isn't known yet and is left out, both for messages and for imported sticker packs. The webm target also sent image/webm, which is now video/webm like in the Telegram bridge. I also bumped the sticker pack cache key, so pack items that were cached with the zip size get reuploaded once.

I tested this on a real account by sending the same Lottie sticker to a bridged DM (9,406 B zip, 177,199 B JSON):

main this branch
reupload, raw JSON size 9406, download 177199 size 177199, download 177199
reupload, webm / webp size 9406, image/webm 27932 / image/webp 149754 size 27932 video/webm / size 149754 image/webp
direct media size 9406, download 177199 no size, download 177199
static webp sticker size 646, download 646 unchanged

Linear: https://linear.app/beeper/issue/PLAT-40523

View in Indent
Tag @indent to continue the conversation here.

@indent

indent Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Issues

No issues found.

CI Checks

All required CI checks passed on 2f9331b.

Review agents

Select any unchecked box below to run or rerun that agent.

Passed (1)
  • Indent Review Agent · No issues found.
Full results

Indent Review Agent

  • Summary: No issues found.
  • Last ran on commit: 2f9331bc
  • Latest result
    {
      "summary": "No issues found.",
      "findings": []
    }

@iFixRobots iFixRobots changed the title msgconv: set correct size for converted animated stickers msgconv: fix size and mimetype of converted animated stickers Nov 16, 2026
Comment thread pkg/msgconv/wa-sticker.go
TypeDescription: "sticker",
}
dbKey := database.Key(fmt.Sprintf("stickercache:%x", part.Info.BridgedSticker.ID))
dbKey := database.Key(fmt.Sprintf("stickercache:v2:%x", part.Info.BridgedSticker.ID))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@indent what's this for?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It changes the sticker pack cache key so packs imported before this fix get re-uploaded once with the correct size, instead of keeping the cached zip size forever.

@indent

indent Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

This session is private. Request access: https://app.indent.com/c/01a1dcfa-5e17-768d-a926-6e8fbdc70c56

@indent
indent Bot requested a review from Fizzadar November 18, 2026 11:36
@Fizzadar
Fizzadar merged commit 1a756c6 into main Nov 23, 2026
12 checks passed
@Fizzadar
Fizzadar deleted the iFixRobots/was-sticker-size branch November 23, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants