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

MSC2530 image captions are used as filenames #2882

Closed
frebib opened this issue May 20, 2024 · 1 comment · Fixed by #3567
Closed

MSC2530 image captions are used as filenames #2882

frebib opened this issue May 20, 2024 · 1 comment · Fixed by #3567
Labels
A-Send_Attachments O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@frebib
Copy link
Contributor

frebib commented May 20, 2024

Steps to reproduce

  1. Send an MSC2530 compatible event with a supported client (e.g. Beeper, or use Move attachment preview above the composer, allowing to add captions … #2600) with a pretty lengthy caption, enough to hit the "File name too long" error message. In my case it was sent with mautrix-whatsapp with MSC2530 functionality enabled.
  2. Look in the app logs

Outcome

What did you expect?

The body field to not be used as part of the filename, but the filename field instead (as per MSC2530)

What happened instead?

2024-05-20T22:04:26.220575Z ERROR elementx: org.matrix.rustcomponents.sdk.ClientException$Generic: msg=File name too long (os error 36) at path "/data/user/0/io.element.android.x/cache/temp/media/.tmppY5zlJ/These words here are the body field of the m.image event.jpeg"
from an event that looks like

{
  "type": "m.room.message",
  ...
  "content": {
    "body": "These words here are the body field of the m.image event",
    "filename": "image.jpg",
    ...
    "msgtype": "m.image",
  },
  ...
}

The image doesn't show/load in the timeline, and clicking on it gives a "Sorry, an error occurrred" message popup

It's possible that this is a Rust SDK bug, in which case please move this issue

Your phone model

No response

Operating system version

No response

Application version and app store

5d8cc80

Homeserver

No response

Will you send logs?

Yes

Are you willing to provide a PR?

Yes

@frebib frebib added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label May 20, 2024
@jmartinesp jmartinesp added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Uncommon Most users are unlikely to come across this or unexpected workflow A-Send_Attachments labels May 22, 2024
@frebib
Copy link
Contributor Author

frebib commented Sep 30, 2024

Hit this again today

2024-09-30T19:37:45.938083Z ERROR elementx: org.matrix.rustcomponents.sdk.ClientException$Generic: msg=File name too long (os error 36) at path "/data/user/0/io.element.android.x/cache/temp/media/.tmp0f8hs5/2992: **UK Coal**\nThe Watership Down rabbits removed an additional 0.1 nanometers constructing their warren, although that was mostly soil. British rabbits have historically mined very little coal; the sole rabbit-run coal plant was shut down in the 1990s."
        at org.matrix.rustcomponents.sdk.FfiConverterTypeClientError.read(SourceFile:26)
        at org.matrix.rustcomponents.sdk.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(SourceFile:13)
        at org.matrix.rustcomponents.sdk.FfiConverterTypeClientError.liftFromRustBuffer(SourceFile:1)
        at org.matrix.rustcomponents.sdk.FfiConverterRustBuffer$DefaultImpls.lift(SourceFile:6)
        at org.matrix.rustcomponents.sdk.ClientException$ErrorHandler.lift(SourceFile:8)
        at org.matrix.rustcomponents.sdk.Matrix_sdk_ffiKt.access$uniffiCheckCallStatus(SourceFile:123)
        at org.matrix.rustcomponents.sdk.Matrix_sdk_ffiKt.uniffiRustCallAsync(SourceFile:194)
        at org.matrix.rustcomponents.sdk.Matrix_sdk_ffiKt$uniffiRustCallAsync$1.invokeSuspend(Unknown Source:17)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:9)
        at kotlinx.coroutines.DispatchedTask.run(SourceFile:113)
        at com.google.android.gms.tasks.zzc.run(SourceFile:49)
        at kotlinx.coroutines.scheduling.TaskImpl.run(SourceFile:3)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:96)
 |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Send_Attachments O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants