Skip to content

Saturday, 26 August 2023

In this blog post I will be summarizing my experience and learnings during the amazing 12 week of the Google Summer of Code with KDE.

So this week GSoC finally comes to an end; it almost feels like yesterday when my project proposal finally got selected. I still remember how happy I was to receive the opportunity to work on projects which will be used by thousands of people. I would like to thank my mentor Carl Schwan for being so patient throughout this journey. A special thanks also goes to Joshua Goins for providing detailed reviews to my Merge Requests and assisting me in resolving several of my bugs.

I have been advocating for KDE and its products in my social circle for a long time now (probably annoying everyone at this point 😆). It feels unreal that during the past 12 weeks I was able to contribute 6k+ lines of code to KDE’s Tokodon. This is my largest contribution to KDE so far and I feel delightful for it.

My project “Adding moderation tools to Tokodon” met almost all of ts goals, and I will be working on fixing minor bugs and writing unit tests post GSoC to improve it even further. If you are a mastodon moderator be sure to try Tokodon’s moderation tools for managing your instance.

I thank Google and KDE community for giving me this incredible opportunity. After spending these 12 weeks working on Tokodon’s codebase, I feel a lot more comfortable with large code bases, debugging code and feel like a much better programmer 💪.

Post GSoC, I plan to contribute more to KDE and other interesting open source projects. I will also try helping upcoming KDE contributors. Other than contributing to KDE, I plan on learning GoLang and work on writing a compiler along with my CS course.

You can read my previous blog-posts here

Friday, 25 August 2023

Let’s go for my web review for the week 2023-34. It’s bigger than usual since it’s a double issue.


Industry News and Opinions

Debian Celebrates 30 years! - Bits from Debian

Tags: tech, foss, debian

One of the most important projects out there in my opinion. Happy birthday!

https://bits.debian.org/2023/08/debian-turns-30.html


Mozilla Foundation - Petition to stop France from forcing browsers to censor websites

Tags: tech, browser, censorship, france, politics

Please, even if you’re not French go and sign this. It can’t be allowed to pass, this would create a dangerous precedent.

https://foundation.mozilla.org/en/campaigns/sign-our-petition-to-stop-france-from-forcing-browsers-like-mozillas-firefox-to-censor-websites/


Every Phone Should Be Able to Run Personal Website | rohanrd.xyz

Tags: tech, web, self-hosting

I admit I’d love it if it made a come back. That’d be a big boost to self-hosting websites for people. Our infrastructures are not quite ready for it though.

https://rohanrd.xyz/posts/every-phone-should-be-able-to-run-personal-website/


We Call on FOSS Contributors to “Exit Zoom” - Software Freedom Conservancy

Tags: tech, zoom, licensing, foss, surveillance

Definitely this! There are awesome Free Software alternatives to Zoom. We need to get more people to use them

https://sfconservancy.org/news/2023/aug/15/exit-zoom/


This Is What Happens When People Start Actually Reading Privacy Policies – The Markup

Tags: tech, machine-learning, zoom, law, licensing

Good explanations around the (deserved) complaints against Zoom and their not that new user license.

https://themarkup.org/hello-world/2023/08/12/this-is-what-happens-when-people-start-actually-reading-privacy-policies


Web Environment Integrity has no standing at W3C; understanding new W3C work | 2023 | Blog | W3C

Tags: tech, web, google, privacy, surveillance

Good reminder on how the W3C works and what it evaluates. If Web Environment Integrity would become a “standard” it’d likely be more of a “de facto” thing because a major player shoved it everyone’s throat.

https://www.w3.org/blog/2023/web-environment-integrity-has-no-standing-at-w3c/


Windows feature that resets system clocks based on random data is wreaking havoc | Ars Technica

Tags: tech, microsoft, security

What a bad idea. From the information at hand I don’t see how this can go well.

https://arstechnica.com/security/2023/08/windows-feature-that-resets-system-clocks-based-on-random-data-is-wreaking-havoc/


An energy-efficient analog chip for AI inference | IBM Research Blog

Tags: tech, hardware, ai, machine-learning, neural-networks

Now this could turn out to be interesting. To be confirmed when this get closer to production (if it does), especially on the power consumption side. This will be the important factor to make this viable I think.

https://research.ibm.com/blog/analog-ai-chip-inference


3D and Geometry

Solving the Point-in-Polygon Calculation Challenge: Tips From Top Engineers

Tags: tech, optimization, geospatial, geometry

Not as detailed as I would like on the proposed solution. A good starting point for inspiration though. Should help with geospatial and fleet management problems.

https://nextbillion.ai/blog/optimizing-point-in-polygon-calculations-for-geospatial-applications


Magic Mirrorball

Tags: tech, 3d, mathematics

If you want to know more about how to use mirror balls to create environment maps, this is a good resource.

https://mirrorball.frost.kiwi/


Rewriting wipEout - PhobosLab

Tags: tech, gaming, 3d, portability

Interesting rewrite attempt. Gives nice information on the original code and the PSX architecture as well.

https://phoboslab.org/log/2023/08/rewriting-wipeout


Networking and Programming

mDNS Primer

Tags: tech, dns, networking

Doesn’t go much in depth, but this is a nice resource with interesting references to follow to dig deeper and learn mDNS.

https://fabiensanglard.net/mdns/index.html


The importance of verifying webhook signatures | Snyk

Tags: tech, web, api, security

Nicely explain how to secure your webhooks step by step.

https://snyk.io/blog/verifying-webhook-signatures/


The downsides of C++ Coroutines | reductor’s blog

Tags: tech, c++, coroutine, asynchronous

Beware of the problems coroutines might bring. Some are “obvious” and related to concurrency in general, but some are running deep in their design in C++.

https://reductor.dev/cpp/2023/08/10/the-downsides-of-coroutines.html


Handles are the better pointers

Tags: tech, data-oriented, object-oriented, memory, gaming, 3d

A bit C++ and game engine focused (to be expected since this is were this kind of techniques originate from), bit very good explanation on how to have packed layouts for your objects and reduce pressure on memory allocation for data intensive tasks.

https://floooh.github.io/2018/06/17/handles-vs-pointers.html


Making Illegal States Unrepresentable

Tags: tech, programming, rust, type-systems

Illustrated with Rust in this case, but definitely one of the big advantages of having type systems. Adding constraints (even runtime ones) to your types make it harder for bugs to hide.

https://corrode.dev/blog/illegal-state/


Thinking about functional programming | notes.eatonphil.com

Tags: tech, programming, language

Very good points. Picking a particular language is likely not the right approach. Trying to apply the main principles of functional programming on the other hand is more likely to bear fruits.

https://notes.eatonphil.com/2023-08-15-thinking-about-functional-programming.html


Thoughts on Elixir, Phoenix and LiveView after 18 months of commercial use

Tags: tech, programming, elixir, backend, frontend

This is clearly getting more mature. Even the list of issues presented here actually makes me want to try it more as to evaluate the exact impacts.

https://korban.net/posts/2023-08-11-thoughts-on-elixir-phoenix-liveview/


Elixir for Humans Who Know Python · Joyyo

Tags: tech, elixir, phoenix, web, framework

Nice little primer about Elixir and Phoenix. Be careful though, I spotted a couple of mistakes in the code examples. That still gives a good idea of advantages and limitations of this stack.

https://joyyo.app/elixir-for-humans-who-know-python


Frontend

Things you forgot (or never knew) because of React

Tags: tech, web, frontend, framework, react

Long post but worth the read in my opinion. It lays out good reasons for reducing the dominance of React and move beyond it. There are good reasons to do so, and they’re piling up with the time passing.

https://joshcollinsworth.com/blog/antiquated-react


Use web components for what they’re good at | Read the Tea Leaves

Tags: tech, frontend, web, webcomponents

Good balanced view about Web Components. Interestingly it seems the adoption is already higher than I expected.

https://nolanlawson.com/2023/08/23/use-web-components-for-what-theyre-good-at/


The ideal viewport doesn’t exist

Tags: tech, gui, design

Good reminder that we have no idea of the window size the user will have. It’s in the context of web frontends here, but really it applies to desktop applications as well (we have a bit more control on the minimal size there but that’s it).

https://viewports.fyi/


Tools

JLA - Compatibility Checker

Tags: tech, licensing, foss

Looks like a handy tool for licenses compatibility checking.

https://joinup.ec.europa.eu/collection/eupl/solution/joinup-licensing-assistant/jla-compatibility-checker


Ansika: One-line Installer for Smoother Employee Onboarding

Tags: tech, tools

Looks like an interesting tool to manage user environment when they join a project.

https://github.com/HexmosTech/Ansika


localhost.run

Tags: tech, networking, tools, ssh, http

Looks like a very nice alternative to ngrok. It’s free, doesn’t require any particular command to download, just works through SSH.

https://localhost.run/


Best Practices

Patterns for Managing Source Code Branches

Tags: tech, git, version-control

A good reference on most of the branching patterns you can find. From this you can derive your project wide policy. Also it’s spot on when it says that branching is easy but each time you branch you need to keep in mind how you’re going to merge.

https://martinfowler.com/articles/branching-patterns.html


Optimise the Expensive First

Tags: tech, optimization, performance

Obvious advice perhaps, but so easily forgotten somehow…

https://two-wrongs.com/optimise-the-expensive-first


Root Cause is Plural

Tags: tech, system, safety, knowledge, risk

A good reminder on how the “five why” are just a starting pont. For proper investigation and risk management you need to go deeper.

https://codywilbourn.com/2018/01/02/root-cause-is-plural/


Architecture and Complexity

How architecture diagrams enable better conversations - Unravelled Development

Tags: tech, architecture, communication, c4

Good reminder of the benefits of having a model of your architecture and keeping it up to date. It’s something too often forgotten in teams I think. Interesting to see C4 getting some traction, I think it strikes a good balance.

https://www.unravelled.dev/how-architecture-diagrams-enable-better-conversations/


Squeeze the hell out of the system you have – Dan Slimmon

Tags: tech, databases, postgresql, architecture, complexity

Excellent points. Don’t be fooled by alluring architecture changes. Always keep the complexity in check and favor tuning what’s already here or changing your use patterns to meet the performance you need.

https://blog.danslimmon.com/2023/08/11/squeeze-the-hell-out-of-the-system-you-have/


The cost of convenience — surma.dev

Tags: tech, library, framework, web, architecture

Good thinking about abstraction levels on top of a platform. It’s very much focused on the Web platform but applies more generally. Good food for thought on the libraries vs framework debate, why escape hatches matter and why you want a layered architecture.

https://surma.dev/things/cost-of-convenience/


complex simple good bad code

Tags: tech, programming, complexity

To take with a pinch of salt, it conflates a few things in my opinion. Still it’s a good reminder that eliminating complexity shouldn’t be a goal. Managing said complexity and avoiding the undue one, this is what matters.

https://cohost.org/tef/post/2503472-complex-simple-good


Management and Communication

Carrot Problems

Tags: business, fake

Very good advice. Don’t waste time believing false business claims and trying to replicate them. Easier said than done though, most people don’t have the privilege of insiders knowledge.

https://www.atvbt.com/the-carrot-problem/


The Double-Blind Review Is What Makes Decisions Fair

Tags: business, management, decision-making

Clearly very much inspired by the science peer review system. Having experienced it, indeed I wish more business decisions would be made that way.

https://www.yegor256.com/2023/08/15/decision-making-process.html


80% of bosses say they regret earlier return-to-office plans

Tags: tech, management, remote-working

Those who listen (not mandate) to their employees and hire whatever the location will come out on top. It’ll require planning real estate ahead of course but the writing is probably on the wall.

https://www.cnbc.com/2023/08/11/80percent-of-bosses-say-they-regret-earlier-return-to-office-plans.html


Hire for Floors, not Ceilings - Jacob Kaplan-Moss

Tags: hr, hiring

This advice makes sense. People performance fluctuate you need to know where the extremes are before hiring them. Easier said than done though.

https://jacobian.org/2023/aug/16/floors-not-ceilings/


Choose the Right Words in an Argument

Tags: management, communication, conflict

Lots of good advices for dealing with a conflict. Choosing the right words and the right time matter. Not easy to apply but worth trying.

https://hbr.org/2014/06/choose-the-right-words-in-an-argument


How to Communicate When Trust Is Low (Without Digging Yourself Into A Deeper Hole) – charity.wtf

Tags: communication, trust

Interesting advices. As usual with this kind of topics it’s probably easier said than done though.

https://charity.wtf/2023/08/17/how-to-communicate-when-trust-is-low-without-digging-yourself-into-a-deeper-hole/


Misc

Ask vs guess culture - by Jean Hsu - Tech and Tea

Tags: life, work, culture

Very good points about cultural differences. Indeed some people directly ask and express their needs, others are more waiting and take into account everyone else’s needs when asked. Both have pros and cons, it’s important to know where you stand.

https://jeanhsu.substack.com/p/ask-vs-guess-culture


I Created the Nerdiest Game Ever | Pier-Luc Brault - Personal Website

Tags: tech, funny

Experience the gruesome work of being an operating system. Now show some respect!

https://plbrault.com/blog-posts/i-created-the-nerdierst-game-ever-en/



Bye for now!

Wednesday, 23 August 2023

I’m posting this a little bit earlier this month, because I’ll be busy until next week and won’t have a chance to finish anything. I have a lot of new features to show, and important documentation work to showcase!

Plasma

More KCMs have their footer actions moved to the header, such as Application Style:

So long, footer actions!

Kirigami

The Kirigami Add-ons AboutPage should be nicer to use for non-KDE projects, and stops them from opening up the QML file itself in your default text editor when you click on certain links.

Components in AboutPage now have support for viewing their licenses and webpage!

Now you can read GPL to your heart’s content!

Kirigami’s FlexColumn now respects the spacing parameter, allowing applications that use it to use Kirigami units.

MobileForm/FormCard’s SpinBox and TextField delegates now use the disabled color when needed in it’s labels.

MobileForm/FormCard’s separator now hides when navigating it via keyboard.

Kirigami Add-ons is now REUSE compliant.

Tokodon

I added support for focal points in media attachments! This means that media won’t be centered carelessly, but will be cropped to the author’s wishes. This feature will appear in 23.12.

This artwork is now focused as it should be!

You can set the focal points in Tokodon as well! I really needed this feature because I post art on Mastodon, and had to use Mastodon Web because that was the only place I could set focal points.

I added a new floating button on the timeline to scroll back to the beginning. This feature will appear in 23.12.

The new scroll back button.

Now you can now share to the Fediverse via Tokodon! Right now it only supports URLs, but this can be expanded in the future. This feature will appear in 23.12.

When it comes to media in posts, it should be much easier to add them. Now you can drop or paste them into the composer! This feature will appear in 23.12.

Account and hashtag links in profile descriptions should now open inside of Tokodon. This feature will appear in 23.12.

Do you use Pleroma or Akkoma? If you found the experience a bit lacking in Tokodon, it should now be a whole lot better. The language selector should no longer disappear, and the correct maximum character count is fetched. The local visibility option and custom poll limits are supported now too! Everything but the local visibility option will appear in 23.08.

There’s now an option to disable Tokodon asking for the admin scope when logging in. This is useful for admins who don’t feel safe with giving Tokodon permissions, or if your server (like Pixelfed) does not correctly handle it when logging in. This will appear in 23.12.

The new moderation toggle, visible on the login page.

For the cherry on top, the post margins should now look much, much better. This will show up in 23.12.

Bug Squashing

Sometimes I wonder if it’s worth describing each bug I fix, but I think it’s important to make it known that we’re fixing our old features too. Most of these apply to 23.08 as well:

Work In Progress

Here’s a list of features I’m working on, but are not quite finished yet. The first is Cross-account actions! This means you can interact with a post from another account, without the hassle of searching for it again and losing your place on the timeline.

Ever wanted to still receive notifications, even though Tokodon is closed? Say hello to Push Notifications! (powered by KUnifiedPush. There’s also going to be more granular notification settings, and the ability to turn off all notifications for an account.

It’s not really interesting to see a notification, so say hello to Tokodon in the Push Notifications KCM!

You can check out the work-in-progress MR here but it’s still a little finicky to set up.

NeoChat

When you paste an image that contains a URL and a bitmap, NeoChat won’t still put the URL in the textbox as well.

The space drawer context menu should behave and look a little bit nicer now, with icons!

The space context menu.

The avatar used in notifications should be more resilient, including transparent and weirdly shaped avatars.

The attachment chooser dialog should now be functional again, the one that asks if you want to “Paste from Clipboard” or “Choose Local File”.

The room and user completion menu should no longer show invalid entries, such as rooms that have no canonical aliases (so you couldn’t link them anyway!)

The “Explore Rooms” page now looks nicer, and also functions better. It should be clearer when it’s still loading or there’s actually no rooms.

The nicer looking Explore Rooms page.

Image attachments are now resized, improving memory usage and smoothing. In my testing, a 4K image (that didn’t have a thumbnail) now takes up ~30 MB less memory.

More about images, NeoChat will soon have support for sending blurhashes, which improves the loading experience for clients that support it. Blurhash generation should be faster as well.

And of course, logging out shouldn’t crash NeoChat anymore.

Dr. Konqi

I made the save report dialog a little clearer, and it now defaults to your home folder.

When on a mobile device, the buttons on the main page are now laid out vertically.

Dr. Konqi when it’s vertically constrained.

Discover

Fixed a bug in the Flatpak backend where Discover could crash… when trying to log an error.

Documentation

There’s an obvious documentation problem in many KDE repositories: they have no README! This month, I took some time to write out a basic template (with the help of Thiago, thanks!) and pushed them to some projects that desperately needed one.

If you haven’t heard me soapbox about this before, READMEs are small but vital lifeline for a project. To some people (including myself), if a project doesn’t have a detailed README it feels more “dead” even if the commit history is active. Some repositories are closely related (e.g. Breeze and Breeze Icons) but have no visible link between them on Invent - and let’s be honest, it’s search functionality sucks. To make matters more complex, some of our projects may be viewed elsewhere, like from the official GitHub mirror!

Here’s some important points I try to include a README:

  1. What is the purpose of this project?
  2. If this is a end-user facing application, what does it look like? (Note: not everyone knows what a “Gwenview” is but might be able to recognize it from a product screenshot.)
  3. If this is a complex, multi-layered and multi-component library - what is the folder called “autotests” or “kcms”? What does it contain? For some projects, this information shouldbe separated into a CONTRIBUTING document if it’s too long.
  4. If I want to contribute, how do I do it? And link to the community.kde.org if you can, instead of trying to maintain manual instructions. There can be exceptions.

For new developers, it’s important to strike down these blockers because it may not be totally obvious to some people what a “Plasma Framework” is. Or that you’re not actually supposed to open a GitHub PR or a GitLab issue. It’s a document you really only need to write once, update sometimes and it passively helps everyone.

And here’s the KDE projects I got to so far:

I encourage anyone reading this to look at the README for the projects you maintain (or even contribute to), and see if there’s room for any improvement!

Somewhat related, some repositories were missing Bugzilla links on Invent and someone told me how to fix them:

Thanks to everyone who helped review and push these along!

Outside of KDE

For Akkoma users, I contributed limited support for the Mastodon Preferences API! This is useful for Tokodon and other clients.

I fixed a qmlformat bug that added an extra space after target bindings. I hinted at what else we need to work on before qmlformat can be adopted in KDE here.

Sunday, 20 August 2023

We changed the default mouse click behaviour to double-click for KF6. For me this was surprising, so I would like to raise a few questions here that might as well be answered with: "sure, we are", and I just did not see it because I am a bit out of touch with KDE development news (and modern ways of communication in general). Personal and biased opinion follows. But here are the questions first:

Are we handling such a prominently user-facing (as in in your face) changes transparently enough?

How do we decide for such (as in groundbreaking) new defaults?

Have the users (as in many of them) been asked?

Update: I want to stress again that I am talking about transparency towards normal users. I am aware that this has been discussed within the development groups involved for quite some time. Even though I did not stumble over those discussions then, they were happening and can be looked up now.

So, now for the personal opinion... To me that change came a bit as a surprise both in it happening at all, as well as in the actual nature of the decision. I did not see any blog posts or mailing list topics regarding this before. I just found the already made decision at some point. And it felt weird. For me, the single-click behaviour, though surprising to users coming from Windows, has always felt like a good idea. On Windows I tended to weird-click sometimes, meaning, I tried to double-click, felt, that I would not be fast enough, cramped and then the intended double-click degraded half-way to a slightly longer single-click. So when I switched to KDE around 2004, I considered it progress when discovering the single-click behaviour. I even tried to enable it on Windows ... but since it is not the default, many apps do not really support it and either still use double-click or their work flows break. This is 15 years old knowledge of course so things might have changed since I stopped watching the Windows world with interest.

From what I see at work, Windows today uses some mixture of single and double-click depending on what you click. They also use a weird mixture of explicit Save button and auto-save depending on where you are doing your settings (as does the Web). And the world is still spinning. So people can adapt to even the weirdest behaviours.

The Web also uses single click. Back when the Web found its way into more and more households, people used to double-click on links (hyperlinks, as they were called back then). I remember that because I installed a lot of modems and Netscapes back then for non-techy friends and friends of friends and even enemies of friends. But the people adapted. These days the only one using double-click on links is your mom ... err, I mean, my mom. But she is even older than I am, so she is forgiven.

Then there are mobile platforms with their touch-based interfaces. They use single-tap. Users adapted. Not sure if there are people who would like to use double-tap to open files on their phones, but I do not know anyone who does.

So what do the people I know, think? I do not have many friends using KDE but all four of them use single click and like it. Three just switched from Windows in recent months and found it funny at first and nice shortly after. None of them chose to change the setting to double click even though I showed them how to do it.

On a side note, all of them changed the touch pad to tap to click but we did not change that one (yet?).

So in my little world, it does not make sense to fall back to the ancient double-click behaviour.

Of course, single-click behaviour has drawbacks. How to gracefully select a file would be the elephant in the room, I guess. The touch-interfacy long tap would probably feel weird (and hard to discover, unless you are cramp-clicking like me sometimes). So do the currently in-place select marker and the rubber band. Everyone hates at least one of them and more or less happily uses the other. But people adapt and go on with their lives. ... And so we will do with the new double-click behaviour in KDE. It just feels weird to me because single-click felt like progress and the recent change feels like going back to spinning drives again instead.

Bonus question: will the select marker be disabled by default now since it does not make sense to have it? And will said marker be enabled automatically if people switch to single-click behaviour? Might feel weird without having it then.

Anyhow, enough with the old man yelling at cloud.

Friday, 18 August 2023

…very hard.

KDE relies heavily on web services, and many of them need to be kept responsive even under strenuous load. I’ve recently had the opportunity to spend some time on load testing one of our websites and would like to share how that worked out.

To properly test things I wanted to have multiple computers make concurrent requests to the service and ensure that the service still performs within acceptable limits. To that end I needed a bunch of servers, software that can pressure the web service, and software that can make sure the service works.

The server bit is the easiest task there… any cloud provider will do.

The software also seemed easy. After very quick research Locust seemed as good a choice as any to poke at the service and make sure it responds. Except, after some pondering I came to realize that this is actually not so. You see, Locust does HTTP performance testing. That is: it makes HTTP requests and tracks their response time / error rate. That is amazing for testing an API service, but when dealing with a website we also care about the javascripty bits on top being responsive. Clearly a two-prong approach was necessary here. On the one hand Locust can put pressure on the backend and then something else can poke the frontend with a stick to see if it is dead. Enter our old friend: Selenium. An obvious choice given my recent work on a Selenium-based application testing framework. The advantage here is that Selenium can more or less accurately simulate a user using the website giving us a fairly good idea about perceived performance being up to spec. Better yet, both Locust and Selenium have master/client architectures whereby we can utilize the cloud to do the work while a master machine just sits there orchestrating the show.

The three building blocks I’ve arrived at are:

  • A cloud to scale in
  • Locust for performance testing (that the thing stays responsive)
  • Selenium for interaction testing (that the thing actually “works”)

I actually thought about showing you some code here, but it’s exceptionally boring. You can go look at it at https://invent.kde.org/sitter/load.

At first I needed to write some simple tests for Locust and Selenium. They were fairly straight forward, a bit of login, a bit of logout. Just to start putting pressure on the server-under-test.

With simple tests out of the way it was time to glue everything together. For this I needed a couple more puzzle pieces. I’ve mentioned that both Locust and Selenium have “server” components that can manage a number of clients. For Locust that is distributed load generation, and for Selenium it’s called a Grid. For convenience I’ve opted to manage them using docker-compose.

The last piece of the puzzle was some provisioning logic for the cloud server to install and start Selenium as well as Locust Workers.

When all the pieces were in place amazing things started happening!

On my local machine I had a Selenium Grid and a Locust master running. Magically, cloud servers started connecting to them as workers and after a while I didn’t have the Selenium and Locust power of one machine, no, UNLIMITED POWER! (cheeky Star Wars reference).

By starting a load test in Locust it was distributed across all available nodes, simulating more concurrent access than one machine would or could ordinarily do.

A simple loop also starts a number of concurrent Selenium tests that get distributed across the available grid nodes.

for i in {1..5}; python3 test.py& done

The end result is a Locust making hundreds of requests per second while Selenium is trying to use the UI. Well, for a while anyway… I naturally wanted to know the limits so I kept bumping the request numbers. At first all was cool.

Response times in the sub 100ms at 300 users is pretty good I think. CPU usage was also at a comfortable level.

So I increased it to 600 users, which was still OKish. But when I started going towards 1200 users the problems started to appear.

In the bottom graph you can see the two bumps from 300 to 600 and then to 1200. What you can see super clearly is how the response time keeps getting poorer and poorer the difference is so enormous that you almost can’t make out the response time changes from 300 to 600 anymore. Eventually the service started having intermittent interruptions when the Selenium tests were also trying to get their work done. Yet CPU and memory were not fully at capacity - In particular the intermittent failure hike is very suspicious. A look at the failures gave the hint: it was running into software limits. I bumped up the limits because the hardware still had leeway, and presto: no more failure spikes even when at 2048 users. Hooray! Response time does suffer though, so in the end there would need to be more reshuffling if that was an expected user count.

Conclusion

Knowing the limits of our services is very useful for a number of reasons, ranging from knowing how many users we can support, to how oversized our servers are for the task they are performing, to whether our service is susceptible to malicious use. Knowing the capabilities and weaknesses of our systems helps us ensure high availability.


To discuss this blog post check out KDE Discuss.

Thursday, 17 August 2023

Introducing the Bundle Editor

The Bundle Editor is an extension of the Bundle Creator, designed to enable artists to modify existing bundles. Often, when downloading a bundle, we find ourselves drawn to specific brushes and realize that a portion—ranging from 10% to 50%—will likely go unused. In such instances, the ability to trim down bundle sizes by removing unnecessary brushes offers the potential to significantly save on disk space.

Moreover, this functionality extends beyond bundles located solely within the resource folder usr/local/krita. It grants users the freedom to edit bundles from any preferred location. What’s even more impressive is that these edited bundles won’t be permanently added to the database, thus conserving space. They are temporarily integrated into the database solely for the editing process. Upon restarting Krita, the edited bundles are automatically removed from the database. In order to use the edited bundle, users need to import it just like they would do in case of a normal bundle.

How to edit bundles

To edit bundles, follow these steps:

  • Navigate to Settings > Manage Resource Libraries... > Edit Bundle.
  • Choose the desired bundle from your preferred location. The Bundle Creator will open in Editing Mode, displaying the resource items of the selected bundle in the Bundle Editor.
  • Customize your bundle by adding or removing resource items based on your preferences.
  • Proceed to the next section to manage tags. You can effortlessly add or remove tags to organize your bundle content.
  • Modify bundle metadata according to your preferences. Note that altering the bundle name won’t overwrite the original bundle; instead, a new copy with the new name will be created. If you intend to overwrite the existing bundle, avoid changing its name.
  • By default, the Bundle Editor saves the edited bundle in its original location, effectively overwriting it (unless you alter the name). Alternatively, if you opt to save the edited bundle in a new location, the original bundle remains unaffected, and the edited version is stored separately.
  • Be mindful that the Bundle Editor issues a warning if you choose to overwrite the original bundle, as this action could result in data loss. This safeguard prevents accidental overwriting of downloaded bundles.

The bundle editing workflow has been demonstrated below.

Bundle Creator


Again, a drawing on paper because I was too busy to draw something in Krita. :(

Bundle Creator

Wednesday, 16 August 2023

Kirigami Addons 0.11.0 is out! This release brings a bunch of new components. Since I forgot to write an announcement for the 0.10 release, I will mention some of the new features of 0.10 too.

This helpful component is similar to Kirigami.InlineMessage and can be used as the footer or header of a page.

Banner component at the top of page
Banner component at the top of page

Delegates (0.10.0)

Kirigami Addons 0.10.0 bring two new list and grid delegates:

  • RoundedItemDelegate: This delegate provides a nice rounded background for items inside a list or grid. You can see it in action in Arianna where it is used both in the grid and the sidebar.

Grid rounded delegates and list rounded delegate
Grid rounded delegates and list rounded delegate

  • IndicatorItemDelegate: This component is the perfect list delegate for an inbox where elements can be marked as read or unread (e.g in an email client).

Merkuro Mail folder view where some emails are marked as read and others are still unread
Merkuro Mail folder view where some emails are marked as read and others are still unread

Avatar (0.10.0)

We moved Kirigami.Avatar from Kirigami to Kirigami Addons. We tweaked the API a bit at the same time, and Avatar is no longer based on the AbstractButton component but is just an Item which can be used for decorative purposes.

In 0.11.0, we also introduced AvatarButton that can be used if you need an interactable element.

We also updated the look of the placeholder, when no avatar images is found, to be a bit less visually heavy and use a pale color. Fun fact, this is a design I helped introduce in Nextcloud a year ago.

New avatar look
New avatar look

MobileForm.FormHeader (0.10.0)

FormCardHeader is now deprecated, and we are replacing it with FormHeader. The difference is that FormHeader is placed outside of the cards.

Kirigami Settings (0.11.0)

We moved Kirigami.CategorizedSettings and Kirigami.SettingAction from Kirigami to Kirigami Addons. We used this opportunity to do a visual refresh of the component.

NeoChat settings using both the new Settings and FormHeader component
NeoChat settings using both the new Settings and FormHeader component

Currently, the search feature only searches inside the title of the categories, but in the future, we would like it to also search inside the content of the pages.

Floating buttons (0.11.0)

In KF6, for Kirigami we are removing the automatic floating buttons. As a replacement, we are adding two new components: FloatingButton and DoubleFloatingButton. We extracted these components from Powerplant, Audiotube and Marknote.

This is how this looks in Powerplant.

Floating button at the bottom right
Floating button at the bottom right

MobileForm is now FormCard (0.11.0)

We decided to rename MobileForm to FormCard since this new layout is also used on other form factors. As part of the renaming we used the opportunity to do some small but welcome change to the api. A lot of boilerplate for the layout is not needed anymore.

diff --git a/src/qml/RoomSettings/Permissions.qml b/src/qml/RoomSettings/Permissions.qml
index 07b8a942..674ee4a5 100644
--- a/src/qml/RoomSettings/Permissions.qml
+++ b/src/qml/RoomSettings/Permissions.qml
-import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
+import org.kde.kirigamiaddons.formcard 1.0 as FormCard

-Kirigami.ScrollablePage {
+FormCard.FormCardPage {
- id: root
-
- title: i18nc("@title:window", "Notifications")
- topPadding: 0
- leftPadding: 0
- rightPadding: 0
- ColumnLayout {
- spacing: 0
- MobileForm.FormCard {
- contentItem: ColumnLayout {
- spacing: 0
-
- MobileForm.FormCardHeader {
- Layout.fillWidth: true
- title: i18n("Room notifications setting")
- }
-
- MobileForm.FormRadioDelegate {
- text: i18n("Follow global setting")
- onToggled: { ... }
- }
- }
- }
- }
+
+ FormCard.FormHeader {
+ title: i18n("Room notifications setting")
+ }
+
+ FormCard.FormCard {
+ FormCard.FormRadioDelegate {
+ text: i18n("Follow global setting")
+ onToggled: { ... }
+ }
+ }

The qml import org.kde.kirigamiaddons.labs.mobileform is still here and will remain for the foreseeable future. Still, please update to the new import name to get all the latest improvements.

New About Pages

The look of the about page and the about kde page was also updated to use the new Avatar and FormCard components.

 

 

 

Bug fixes and minor improvements

  • We fixed various issues with the translations not loading for some components and added some ci checks to ensure that this doesn’t happen in the future.
  • In AlbumMaximizeComponent, we are now using icon name compatible with more xdg-icon-themes
  • The AboutPage now displays more information which were previously not displayed due to some broken checks.

Packager section

You can find the package on download.kde.org and it has been signed with my GPG key.

Saturday, 12 August 2023

People keep lamenting how lackluster Qt’s SVG renderer is. It leads to poorly rendered icons and wallpapers and it mostly only implements the SVG Tiny specification. As a weekend project I put together a resvg based image handler replacement. It was super easy because resvg is amazing!

The Plugins

An application that uses QSvgRenderer actually can, for the most part, just use resvg’s Qt header and call it a day. It has a very convenient interface that lets you replace most uses of QSvgRenderer with resvg’s. That’s all lovely, except who wants to port every application to a new library.

Luckily, most applications don’t actually use QSvgRenderer directly, they use it through 2 plugins. The iconengine plugin, providing a QIconEngine. And the imageformats plugin, providing a QImageIOHandler. Understanding when which is used is the first step.

Duh! The icon engine is used for icons! - Well, yes, usually…

The SVG QIconEngine confusingly isn’t actually used on KDE Plasma, instead we route all icon lookups through KIconEngine which does some magic. Ah! But where does it then get the icon from? If we follow the code paths a bit we end up here and after some reading on QImageReader we learn that on KDE Plasma icon lookup is actually not running through the SVG iconengine plugin but the imageformats plugin. Slightly confusing but actually beneficial because it means that icon rendering is ultimately running through the same code paths as regular SVG image reading when e.g. loading an Image in QML.

By creating an imageformats plugin we can replace most uses of QSvgRenderer with resvg without having to touch every application. Hooray!

QImageIOHandler

And the good news keeps on coming. A basic QImageIOHandler is super easy to implement.

    bool canRead() const override;
    bool read(QImage \*image) override;

All we need to do is implement reading

    \*image = ResvgRenderer(device()->readAll(), ResvgOptions()).renderToImage();

That gets us a working plugin. There are some extra features one can and should implement but for the most part that is all that’s needed. You can check out the complete source to see where things are at.

Duel of Plugins

Now that we have a plugin we just need to make Qt actually use ours instead of its own. Unfortunately this is where our luck runs out. Qt appears to have no facilities for manipulating which imageformats plugin is used when there are multiple candidates for the same format. In our case we have qsvg and qresvg both supporting SVG and it appears undefined behavior which of the two gets used. So, for the time being we’ll have to overwrite qsvg to get our plugin to reign supreme. Somewhat unfortunate.

Conclusion

Plugins are cool. Resvg is also cool. Making a resvg plugin is double cool.

You can give it a try at https://invent.kde.org/sitter/qresvgimageiohandler

Here’s what it looks like. On the left hand side you can see the image from a bug report where the image viewer icon is misrendered, on the right you can see the same icon rendered correctly using resvg.

To discuss this blog post head on over to KDE Discuss.

Friday, 11 August 2023

Let’s go for my web review for the week 2023-32.


The Legacy of Bram Moolenaar - Jan van den Berg

Tags: tech, vim

Nice words about Bram Moolenaar maintainer of vim who passed away recently.

https://j11g.com/2023/08/07/the-legacy-of-bram-moolenaar/


IBM, Red Hat and Free Software: An old maddog’s view - Linux Professional Institute

Tags: tech, unix, linux, redhat, history

Don’t be fooled of the title. Yes, it concludes about an opinion piece about the latest changes in policy around RHEL. Still, it starts with a very nice retelling of the history around UNIX and computing since the 70s. This is an invaluable resource.

https://www.lpi.org/blog/2023/07/30/ibm-red-hat-and-free-software-an-old-maddogs-view/


Your Computer Should Say What You Tell It To Say | Electronic Frontier Foundation

Tags: tech, google, browser, surveillance, attention-economy

Excellent piece against the Web Environment Integrity proposal from Google.

https://www.eff.org/deeplinks/2023/08/your-computer-should-say-what-you-tell-it-say-1


Blocked by Cloudflare

Tags: tech, cloudflare, google, surveillance, attention-economy

This is based on fingerprinting and sometimes fail. If Web Environment Integrity gets through it’ll be just worse.

https://jrhawley.ca/2023/08/07/blocked-by-cloudflare


Our current FOSS dystopia

Tags: tech, foss, politics, criticism

Definitely this. There’s still so much to achieve through FOSS, lots of missed opportunities. The mentioned factors clearly played a huge part in the current situation.

https://idiomdrottning.org/foss-dystopia


Just normal web things.

Tags: tech, browser, web

Indeed, too many websites or apps break or hijack basic features of the browser. To me it also shows the tension between trying to have a document browser and an application provider shoved in the same GUI.

https://heather-buchel.com/blog/2023/07/just-normal-web-things/


Python cocktail: mix a context manager and an iterator in equal parts

Tags: tech, programming, python

Definitely a clever combination of two Python constructs.

https://www.bitecode.dev/p/python-cocktail-mix-a-context-manager


Reverse Z (and why it’s so awesome) | Tom Hulton-Harrop

Tags: tech, 3d, floats

Good explanations of why you might want to revert the Z axis on your projection matrices. Of course it boils down to how float precision works.

https://tomhultonharrop.com/mathematics/graphics/2023/08/06/reverse-z.html


Remote work requires communicating more, less frequently | Ben Balter

Tags: tech, remote-working, management, communication

Kind of overlooking the cost of producing videos in my opinion. That being said, if you keep videos out of the picture this little article is spot on. Remote work is about more asynchronous and longer form communication first.

https://ben.balter.com/2023/08/04/remote-work-communicate-more-with-less/



I’m taking another short break, so no web review next week!

Bye for now!

Tuesday, 8 August 2023

I have summarized the entirety of July’s work in a single blog post, as I got quite busy with university in the last few weeks 😢.

Progress made on the Report Moderation Tool

I started with the Report Moderation Tool’s further implementation and managed to implement almost all of the features smoothly. However, I encountered a problem with the self-assigning and un-assigning of reports, which caused the application to crash with a segmentation fault. After dedicating hours to using gdb for debugging, I eventually concluded that the unexpected behavior was likely due to my use of smart pointers. It appeared that the memory was being de-allocated automatically when the object was set to null, and while accessing null when assigning the reports we accessed a null address leading to Tokodon crashing.

I reached out to the maintainers for their help and review on how to fix this issue. I was suggested to try switching to using raw (normal) pointers to address the problem. I tried refactoring the code in a similar way to resolve the issue. However, the transition from smart pointers to raw pointers proved to be more challenging than I had initially anticipated.

burning house meme showing my relation with cpp pointers

I ended up deciding to take a break from the Report Tool and tackle this at the end.

Some images of the (almost)implemented Report Tool

A collage of the implemented Report Tool

The draft Merge request implementing the Report tool can be found here.

Federation Tool | Manage federation with other servers

Before beginning with the implementation of the Federation Tool Carl pointed out that I was using expensive Q_Object to transfer data from cpp back-end to the QML front-end which was not optimal. So this time I used the QAbstractListModel’s built in functions to expose data to the front-end and realized how excellent Carl’s advice was 🥰 .

I felt more comfortable with the code-base now and can intuitively think about my next steps of action. I took my previously written code as boiler-plate and made the required changes in it to fit with the Federation Tool to finally implement the tool.

Carl also made a new Delegates.SubtitleContentItem delegate UI to display the data in a more responsive and beautiful way and further helped me in implementing this to the Federation Tool.

Image of the implemented Federation Tool

A collage of the implemented Federation Tool

The Merge request implementing the federation tool can be found here.

IP Block Tool | Manage the allowed IPs for your mastodon server

The IP Block Tools implementation was almost similar to the Federation Tools minus a bit of complexity in the data structures used. I used my previously written code as boiler-plate again and built the IP Block Tool on top of that.

Image of the implemented IP Block Tool

A collage of the implemented IP Block Tool

The Merge request implementing the IP Block tool can be found here.

Email Block Tool | Manage the email sources allowed to federate

Next tool I started implementing was Email Block Tool. Mastodon provides two kinds of Email block API endpoints: canonical email block and normal email block. Initially, I was skeptical how this would work. However, after further research, I discovered that the official Mastodon website only had the normal email block implemented. I after consulting with Carl, decided to only implement the normal Email Block feature. The canonical email block endpoint didn’t have any clear way to view or manage the blocked emails and would have been confusing for the end user along with the normal Email Block Tool.

The implementation is almost similar to the IP Block Tool and required minor changes to fit the Email Block Tool.

Image of the implemented Email Block Tool

A collage of the implemented Email Block Tool

The Merge request implementing the Email Block tool can be found here.

I will be writing regular blog posts on my website. You can read my previous blog-posts and follow my progress here.