misskey-dev / misskey

🌎 A completely free and open interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
10.1k stars 1.38k forks source link

Silently dropped media description (aka image caption or alt-text) when the media description is too long. #13823

Open subsys-R9boq8 opened 6 months ago

subsys-R9boq8 commented 6 months ago

💡 Summary

If user tries to enter media description that is too long (>512 characters?) for an image, the alt-text is silently dropped and no media description is added at all. This cannot be realized without reviewing one's previously sent posts or revisit image caption.

🥰 Expected Behavior

Media description is added, or at the very least an error like "Media description text count exceeded limit" is given to user trying to add an media description longer than supported.

🤬 Actual Behavior

Media description is silently dropped without informing the user about what has just happened.

📝 Steps to Reproduce

  1. Open the note creating interface and upload an image/select an image from the drive.
  2. Add a media description that is longer than 512 characters, click the tick on the up-right corner.
  3. Re-click the image and click "add caption" in pop up menu.
  4. The image description is not saved at all.

💻 Frontend Environment

Originally appeared on:
* Model and OS of the device(s): Pixel 4a, Android 13
* Browser: Chrome 124.0.6367.159
* Server URL: (I'm not comfortable disclosing this)
* Misskey: 2024.3.1

Replicated on:
* Model and OS of the device(s): Virtual Machine, Linux
* Browser: Tor Browser 13.0.14 (based on Mozilla Firefox 115.10.0esr), Security Level Standard (All browser functions enabled)
* Server URL: zmi.im
* Misskey: 2024.3.1

🛰 Backend Environment (for server admin)

No idea, I'm only a user.

Do you want to address this bug yourself?

zyoshoka commented 5 months ago

https://github.com/misskey-dev/misskey/blob/b683d79f8b3efffa4498380a47f136d79e0ddbe7/packages/frontend/src/components/MkPostFormAttaches.vue#L117-L122

Using os.apiWithDialog instead of misskeyApi here fixes the problem.