Thiago Duvanel
353 words
2 minutes
Bug fixes in patch-hub
2024-10-16

As I continue contributing to patch-hub, I’ve had the opportunity to dive deeper into the codebase and tackle some of its challenges. Recently, my focus has been on resolving several bugs in key functionalities, which has been both a rewarding and educational experience.

Writing the full list name#

One of the bugs I addressed was in the obligation to write the full name of an email list to search for it. After investigating the root cause, I implemented a fix that made the search not after typing the full list and pressing enter, so it would search dinamically after inputing any data on the search area. That ensures patches are correctly parsed and displayed consistently.

Empty bookmark list#

Another significant issue was in the bookmark list, where after you select some lists to bookmark and follow them, if you access the bookmarked email lists and unbookmarks all the list content, the list would be empty, which would cause a PANIC (rust error) if the user presses an ENTER. The fix was basically to check before accessing the bookmarked list screen if it was empty. If isn’t, you can access it. If not, you would be redirected to the main email list menu.

Usize and u32#

In rust, there are some ways to describe an unsigned integer. You can use “usize”, which is a generic way to saying that is a integer without a negative/positive sign, os u32. In our main code, u32 and usize are used in different places, which can cause some incompability issues. The fix was to change all the u32 to usize, which is the rust standard for unsigned integers. This is safier too because on some computers, the u32 can be bigger than the usize, which would cause a panic or a bug.

Conclusion#

These contributions have been a fantastic way to sharpen my skills in Rust and better understand how robust tools are built in the open-source ecosystem. I’m excited to continue this journey and look forward to tackling more challenges as they arise. In my next posts, I’ll dive into more details about specific fixes and the lessons I learned along the way. Stay tuned!

Bug fixes in patch-hub
https://th-duvanel.github.io/posts/bug-fixes/
Author
Thiago Duvanel Fereira
Published at
2024-10-16