talk-android icon indicating copy to clipboard operation
talk-android copied to clipboard

Attach/Send files to messages does not work for fresh users

Open woolfg opened this issue 1 year ago • 1 comments

Steps to reproduce

  1. Create a new user
  2. Use this user in Android Talk
  3. Try to send a file (e.g image) in a Message

To fix it, there are two options. After those steps it is possible to send images from Android as well.

  • Receive a message including an image
  • Login to web or iOS and send a message/file in Talk there

Expected behaviour

The file is sent.

Actual behaviour

  • File/Message is not sent
  • native Android notification "Failure: Failed to upload: imagename.jpg" is shown

image

Device brand and model

Moto g84 5G

Android version

14

Nextcloud Talk app version

19.0.1

Nextcloud server version

29.0.4

Talk version

19.0.7

Custom Signaling server configured

None

Custom TURN server configured

None

Custom STUN server configured

None

Android logs

No response

Server log

No response

Additional information

Is reproducable on different Android phones.

woolfg avatar Aug 07 '24 14:08 woolfg

iirc this might happen due to the attachments folder on server that is not yet created. Do you know if the same scenario also fails on iOS?

mahibi avatar Sep 02 '24 11:09 mahibi

yes this happened to me also and the fix options i did was the same as @woolfg mentioned

PH03N1X999 avatar Nov 18 '24 06:11 PH03N1X999

@Ivansss @SystemKeeper is it the same behavior on iOS?

mahibi avatar Jan 08 '25 09:01 mahibi

We check the status code for the missing attachment folder and create it in that case:

https://github.com/nextcloud/talk-ios/blob/52a6f3de3c6859f2c8fc7d2cf5cda3f0da63d896/NextcloudTalk/NCAPIController.m#L1930-L1952

https://github.com/nextcloud/talk-ios/blob/52a6f3de3c6859f2c8fc7d2cf5cda3f0da63d896/ShareExtension/ShareConfirmationViewController.swift#L660-L668

SystemKeeper avatar Jan 08 '25 09:01 SystemKeeper

is it the same behavior on iOS?

I can reproduce the issue in Talk iOS as well as using the web app.

Sharing the file request fails with a 500 internal sever error: Failed to share file. Error: Request failed: internal server error (500)

So even the file is correctly shared, the server replies with a 500 probably beacause the Talk folder hasn't been created for that new fresh user yet.

So this seems to be more like a server issue.

Ivansss avatar Jan 08 '25 11:01 Ivansss

is it the same behavior on iOS?

for me in worked on web and iOS as this was my workaround "Login to web or iOS and send a message/file in Talk there" to fix the problem.

woolfg avatar Jan 08 '25 11:01 woolfg

The issue reported in my previous comment https://github.com/nextcloud/talk-android/issues/4053#issuecomment-2577438927 was unrelated with this issue. This issue might be related with the attachment folder as @SystemKeeper reported here: https://github.com/nextcloud/talk-android/issues/4053#issuecomment-2577254140

Ivansss avatar Jan 08 '25 14:01 Ivansss

TODO:

  • try upload
  • if it fails, use DAV propfind to check if folder exists
  • if it doesn't exist (404 or 409), create folder with mkCol also see:
    • https://github.com/nextcloud/talk-android/blob/9b3a11569a8175d3591e3c4007370fc5c479ad02/app/src/main/java/com/nextcloud/talk/upload/chunked/ChunkedFileUploader.kt#L98
    • https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html#creating-folders-rfc4918

mahibi avatar Jan 08 '25 14:01 mahibi