element-hq / element-x-ios

Next generation Matrix client for iOS built with SwiftUI on top of matrix-rust-sdk.
https://element.io/labs/element-x
Apache License 2.0
388 stars 80 forks source link

Can't copy mxid or display name from member details screen #2546

Open marwing opened 5 months ago

marwing commented 5 months ago

Steps to reproduce

  1. open room
  2. tap on someone's avatar or display name
  3. tap and hold on their mxid or display name
  4. tap copy
  5. try to paste somewhere
  6. notice nothing pasted

Alternatively

  1. tap share
  2. notice you are sharing nothing

Outcome

What did you expect?

Ability to copy or share the actual mxid/display name

What happened instead?

copying/sharing empty text

Your phone model

iPhone 13 mini / iPad Pro

Operating system version

iOS/iPadOS 17.4

Application version

1.5.10 (94)

Homeserver

Synapse 1.102.0 / Proxy 0.99.15

Will you send logs?

No

Velin92 commented 5 months ago

I just tested this and I didn't have any issue, could you provide us with more details on how to reproduce this issue? Did this happen in a room with a lot of members for example?

marwing commented 5 months ago

While testing, I just noticed that the copying issue seems to only happens after the first try (i.e., after force closing the app, I can successfully copy an mxid or display name one time, all further attempts copy nothing/clear the clipboard). This happens in every room I tested (public or private, encrypted or unencrypted and dm or non-dm). Sharing seems to work more reliably, however the preview is always empty, so it may have only been that one time (I only checked the preview while testing).

If this doesn't happen for you, I have no idea what you would need to do. For me, this happens on my iPhone and my iPad. On my iPad, this even is a fresh install (because of me testing #2537), so I don't think I broke some app state.

https://github.com/element-hq/element-x-ios/assets/29716248/6a35495f-0a17-420d-b19a-4b6b4ea12ee9

(I highlighted where I expected a preview in the share sheet. Please forgive my horrible editing)

Velin92 commented 5 months ago

No worries thank you for the extra details! Sadly I still can't reproduce the issue for me the share always displays a preview and reliably pastes/shares the right content, try to send us a rageshake, after having tried the share. This could also be a iOS 17.4 issue, that only happens on some devices given the inconsistency of how this happens. In the meantime I'll move this to uncommon

marwing commented 5 months ago

I just repeated the steps above and sent logs just in case they do help. I don't see anything in them, but you probably have a better idea of what to look for. Luckily, I don't need this feature all that often (I think this is the first time I ever used it), so this is not too bad.

stefanceriu commented 2 months ago

Wasn't able to reproduce it either. Please reopen if it's still a problem.

marwing commented 2 months ago

I can still reproduce both issues (commenting and sharing) with 1.6.9 (108) on iOS 17.5.1 on both devices.

marwing commented 2 months ago

GitHub doesn't seem to let me reopen myself. I would appreciate it if you could do that.

marwing commented 2 months ago

I understand that it's hard to debug something you can't reproduce. If there is a way I can help debug this, please share.

marwing commented 2 months ago

Now that I can tap my way to higher log levels, would logs in debug or trace potentially help?

stefanceriu commented 2 months ago

It's not really about that, the implementation is absolutely trivial and as far as I can tell we're not doing anything wrong. This one liner is all there is to it and SwiftUI should take care of everything else https://github.com/element-hq/element-x-ios/blob/develop/ElementX/Sources/Other/SwiftUI/Views/AvatarHeaderView.swift#L165

stefanceriu commented 2 months ago

We use this API in 4 different places:

Do any of those work for you?

marwing commented 2 months ago

Yeah, I figured something like this would be the case. I'm just grasping at straws here, as I have no clue what could be happening.

All of these places exhibit the same symptoms: empty share previews and copying empty text/clearing the clipboard after the first time.