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

URL Previews not working for e2e rooms, even with previews enabled #2555

Open
logic opened this issue Dec 19, 2020 · 3 comments
Open

URL Previews not working for e2e rooms, even with previews enabled #2555

logic opened this issue Dec 19, 2020 · 3 comments
Labels
A-URL-Previews O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Impairs non-critical functionality or suitable workarounds exist T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements Z-parity-with-web

Comments

@logic
Copy link

logic commented Dec 19, 2020

Describe the bug
With the introduction of url previews in 1.0.12, we now have parity with Element web, except for e2e rooms. I'm a member of a large number of e2e rooms with URL previews enabled (in element web) that are not expanding in element android.

(This used to work with the old version of riot-android, fwiw.)

To Reproduce
Steps to reproduce the behavior:

  1. Create and enter an e2e room.
  2. In Element web, go to room settings -> General -> URL Previews, and "enable URL previews for this room".
  3. Post a URL in the room, watch as it unfurls in Element web.
  4. Open the room in Element android, watch as it shows a bare URL with no preview.

Expected behavior
I was expecting a preview. :)

Smartphone (please complete the following information):

  • Device: Samsung Galaxy S7
  • OS: Android 10 (LineageOS + microg)

Additional context

  • 1.0.12 - Google Play Store
  • Homeserver: private synapse instance
@laszlovl
Copy link

laszlovl commented Jan 6, 2021

I randomly selected this bug as a potential good "first issue" to familiarize myself with the codebase, but it turns out it's a bit more complicated :-)

Element-Android's current behavior is pretty straight-forward, it simply disables URL previews for all encrypted rooms: https://github.com/vector-im/element-android/pull/2490/files#diff-777e743c40b267f7ad514207dabaf444be1b227ad415e31d86bf798ea3aac2f0R1353. That would have to be replaced with a per-room setting (https://matrix.org/docs/spec/client_server/latest#put-matrix-client-r0-user-userid-rooms-roomid-account-data-type).

However, Element-Web currently uses two different setting keys, one if the room is encrypted, another if the room is not encrypted. Non-encrypted rooms use "org.matrix.room.preview_urls", a key in the official namespace but missing from the spec (https://github.com/matrix-org/matrix-doc/issues/1732) and referred to as "legacy" by comments in the codebase. But for encrypted rooms it uses a dict with key "im.vector.web.settings", containing a setting called "urlPreviewsEnabled_e2ee".

Making Element-Android read from/write to the "im.vector.web" namespace would (although theoretically possible) not be the right way to go. Making it use its own namespace, "im.vector.android", would be possible but then the setting wouldn't be synchronized between Android and Web, also not ideal.

So the right way to tackle this probably involves first creating a formal spec for this setting, then (re-)writing both Element-Web and Element-Android to make use of it. (Although then you could argue whether room accountdata is even the right place for this setting; f.e. someone who trusts their homeserver - because it's ran by themselves or their organization - would probably rather enable e2e URL previews for all rooms with a single setting).

@justinmcdaniel
Copy link

Hi! I'm having this issue with e2e rooms for Android; absolutely no way to make URL previews work.

Have there been any updates on getting this fixed?

@msebald
Copy link

msebald commented Mar 19, 2022

Hi!

I also have this issue. No URL previews for encrypted rooms/chats. But I found an option for the windows client in the room options: "URL-Vorschau für dich in diesem Raum" (German, which probably translates back into the English original like "URL previews for you in this room"). So every participant of this room can/must enable this if URL previews are wanted. I tried and it worked!

Unfortunately I do not see this option for the Android and iOS client. For Linux I cannot say as I do not have a Linux machine with a GUI here at the moment.

I googled and read about this option and also if it should be enabled in encrypted rooms. And I noticed that this topic is there for quite a while. So I was not sure if this was the case by purpose (security by design) or not. But after noticing the option in the Windows client I would say that URL previews in encrypted rooms are supported - if enabled by the user.

So my question here is, if the option will be ported to Android and iOS (and maybe Linux), too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-URL-Previews O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Impairs non-critical functionality or suitable workarounds exist T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements Z-parity-with-web
Projects
None yet
Development

No branches or pull requests

5 participants