Linux bug hunting example

I am a Linux user; and fixing Linux bugs have a different experience than fixing a windows bug; major part of which is delving into github and gitlab. So to make you aware of this whole brave new world I am relating one of my experience as a bug hunter
Experience
For days flatpak refused to work on my PC. Clicking the icon does nothing. I figured it might be something related to me switching to Xorg(my browser was tripping on wayland) I didn't knew for certain what. While on windows you might be helpless searching where the application stores its logs on Linux there's this thing you can and should try whenever something like this happens:
Tip #1 : Run the app on commandline.
flatpak run org.telegram.desktop
The command did run and gave the following error:
Missing sys.apsw_fault_inject_control Failed to create wl_display (No such file or directory) qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: vkkhrdisplay, eglfs, minimalegl, vnc, linuxfb, xcb, wayland, minimal, offscreen, wayland-egl.
Aborted (core dumped)
So... Yeah, I Googled this.
Tip #2 : Do your research
There were many threads related to this created by developers and for developers but nothing for a user like me. So, I did a brave thing...
Tip #3 : Report the bug on github
and created a issue(bug report) for this on telegram's github. Its a fairly regular thing, and most of my bug reports on github have been from Linux. Here it is if you are interested.
To digress a bit, windows doesn't foster this culture mainly because of these reasons:
- Dearth of open source software(or better closed source alternatives)
- Difficult access to logs
- Loads of users and official Microsoft support, so there are high chances your bug have been reported already, you just need to search the solution.
But, as you would know if you opened the report, my report was closed as soon as it was created. Apparently this wasn't telegram's fault it was flatpak's.
Tip #4 : The bug might be not the application's fault but the underlying software. But its better to know who's fault it is rather than trying to live with the fault.
So I googled why flatpak doesn't detect I am on XORG. Here's what I got.
Apparently it wasn't flatpak's fault either. It was Gnome's login manager(GDM) forgetting to remove the information that I logged into a wayland session. Flatpak uses this information(a file) to deduce I am using wayland. Apperantly you can remove the file manually or using a script. Though, I didn't want to do this manually, I wanted this to fixed. So I opened a link the redirected to this GDM issue. But lo and behold. They think the problem is resolved, for various reasons.
BUT it is NOT, at least not for me. Flatpak refuses to work under XORG and so does calibre.
So, I decided to write this post. And here's where it gets meta. As I was writing this post, I remembered I had put the following in my .profiles in order to theme qt apps:
export QT_QPA_PLATFORM=wayland export QT_QPA_PLATFORMTHEME=qt5ct
Removing this should theoretically fix it all.
Lessons
So what was the lessons here? We should remember all the dot files we change? We should try fixing a bug instead of living with it? We should try finding solutions instead of crying about it? Or maybe there is no lesson; maybe we're all just a bunch of dumb stinky idiots and we're all doomed.
The end.