element-x-ios icon indicating copy to clipboard operation
element-x-ios copied to clipboard

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

Open marwing opened this issue 1 year ago • 12 comments

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

marwing avatar Mar 08 '24 12:03 marwing

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?

Velin92 avatar Mar 11 '24 19:03 Velin92

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)

marwing avatar Mar 11 '24 22:03 marwing

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

Velin92 avatar Mar 12 '24 10:03 Velin92

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.

marwing avatar Mar 13 '24 13:03 marwing

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

stefanceriu avatar Jun 18 '24 06:06 stefanceriu

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

marwing avatar Jun 18 '24 06:06 marwing

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

marwing avatar Jun 18 '24 06:06 marwing

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 avatar Jun 18 '24 06:06 marwing

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

marwing avatar Jun 18 '24 18:06 marwing

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 avatar Jun 19 '24 13:06 stefanceriu

We use this API in 4 different places:

  • the room details screen room topic
  • the timeline item long press menu message preview header
  • the settings screen app version at the bottom
  • and the member details

Do any of those work for you?

stefanceriu avatar Jun 19 '24 13:06 stefanceriu

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.

marwing avatar Jun 19 '24 13:06 marwing