The edge case
Edge Cases, a brief introduction
Edge cases in software occur when someone does something the software's developer did not expect and coded against or accidental coding errors that in 99% of cases work as intended and only break when unexpected input is used.
An interesting report
It begun with a Discord message. The person said that while they were able to use Zoom Player to browse a Plex server, for some reason, trying to connect to an Emby server triggered an authentication error.
If you're unfamiliar, Plex and Emby are media server software which allow you to index your media library and stream it to other devices and software. While Zoom Player has it's own media library indexing features, it is also able browse and stream content from media servers such as Plex, Emby and Jellyfin.
Brainstorming
I usually try to code defensively, I try to ensure Zoom Player is as solid as I can make it and as such, I've added some code to handle unclean input, the added slash, the extra space. Even so, I went over the configuration settings to verify the server setup values were correctly filled and indeed, that was not the problem.
My next step was switching to the debug build. Zoom Player's debug build output very extensive log files that allow me to trace the code to better understand what's going on someone else's PC. There are so many PC configurations and Zoom Player has so many settings and options that without proper logging, it would be very difficult to trace and debug complex bugs.
My findings
As soon as I reviewed the relevant log files, I immediately noticed something was off. In the server's password field, the last 3 characters were "%40". I doubted anyone used "%40" as part of a password where the rest of the password was legible and not just a random set of characters. To me it felt like a problematic character encoding issue was at play.
And my suspensions were soon confirmed. It turns out the last character in password was actually "@" and it was erroneously encoded to "%40". I reviewed the code and sure enough, instead of just encoding the password text as the UTF8 standard used by JSON (the method of information transfer to the server) specifies, I accidentally encoded the password with HTML-UTF8 encoding used in URLs where "@" is a reserved character and is encoded to ... you guessed it "%40".
I fixed it
This edge case was a silly oversight that sat in the code for months. Fixing it was easy, all it required was replacing the HTML-UTF8 encoding functions with standard UTF8 encoding functions, 1 line of code.
Conclusion
Even experienced developers like myself make silly and embarrassing mistakes. Sometimes these mistakes can lurk in the code for months and even years, but when they strike, having good, in-depth logging is key to maintaining a large project.