Bug 485137 - Turning off Link Previews not Functional if Matrix Server doesn't support link previews
Summary: Turning off Link Previews not Functional if Matrix Server doesn't support lin...
Status: RESOLVED FIXED
Alias: None
Product: NeoChat
Classification: Applications
Component: General (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-06 16:04 UTC by Timothy Arnold
Modified: 2024-04-13 17:27 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Shows setting is turned off but loading preview still shows (744.34 KB, image/png)
2024-04-06 16:04 UTC, Timothy Arnold
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Arnold 2024-04-06 16:04:29 UTC
Created attachment 168221 [details]
Shows setting is turned off but loading preview still shows

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY

I'm currently using a matrix server implementation that doesn't have URL Previews implemented (endpoint `/_matrix/media/v3/preview_url`). So in order to get rid of the endless spinning cog on preview url attempts, I tried turning them off in settings. This didn't change the behaviour and I still see the spinning cog.

(Aside: The server returns an `M_UNRECOGNIZED` errcode if the endpoint isn't supported. It might be worth hitting the endpoint and see if it returns that error code to determine if the url preview should be loaded)

STEPS TO REPRODUCE
1. Connect to a server without the preview_url endpoint implemented or turned off 
2. Attempt to turn off link previews in messages
3. Confirm that the "loading preview" image is still displayed

OBSERVED RESULT

"Loading Preview" is displayed even if the link previews are turned off in the client

EXPECTED RESULT

"Loading Preview" shouldn't be displayed

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.8.4-300.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 2700X Eight-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 590 Series
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: X470 AORUS GAMING 7 WIFI

ADDITIONAL INFORMATION
NeoChat Build Information:
KDE Frameworks 6.1.0 
Wayland Windowing System
Qt 6.6.2
libQuotient 0.8.1.2
Comment 1 James Graham 2024-04-13 12:46:55 UTC
So this setting should have nothing to do with the server and is local. It works for me on master, if I flick it off they all go away and come back if switched on.

That being said it would still be a good idea to ping the endpoint sometime early on and just not show them if they aren't supported.
Comment 2 Timothy Arnold 2024-04-13 12:53:32 UTC
(In reply to James Graham from comment #1)
> So this setting should have nothing to do with the server and is local. It
> works for me on master, if I flick it off they all go away and come back if
> switched on.
> 
> That being said it would still be a good idea to ping the endpoint sometime
> early on and just not show them if they aren't supported.

It appears to be working for me on master now -- perhaps https://invent.kde.org/network/neochat/-/commit/1a96899336f2f1a916207796b482ca4112909ebf fixed it? 

We can close this. If you'd like me to open a separate bug for hitting that endpoint, I can, though.
Comment 3 James Graham 2024-04-13 17:27:48 UTC
That's fine I've made a note it's on my list