Hacker News new | ask | show | jobs
by msielski 3741 days ago
I had a strange experience where my cable company's mobile app, which streams most channels, was missing audio on a few channels. After escalating the issue to an engineer, he finally got back to us and told us that if a username contained "ts" like mine did this issue would happen. After making a second username without that combination, all worked fine. I'd still like to know what logic in their application would get stumped by these two letters.
3 comments

Imagine the cowboy code responsible for such an abomination of a bug.
I think I may be turning into a machine myself, because I had to google "cowboy code" thinking it's probably something from the Jargon File. Like, an apocryphal list of error codes and things, hidden in some obscure part of a posix filesystem etc.
In the context of acoustics, "ts" almost always means time-step (inverse of frequency). But I don't have the faintest idea of how it would collide with the username string :|
In the context of video streaming, ts probably stands for "Transport Stream" [1] and nothrabannosir's idea of the bug is probably very close to correct. What's both hilarious and sad is that someone on HN without access to the source code, debugging environment and internal QA tools probably root caused the bug, whereas the cable company's developers let it get all the way into production.

1: https://en.wikipedia.org/wiki/MPEG_transport_stream

Guessing they're scanning for parameters in a JSON object by doing something like

    ts = parseInt(jsonstr.indexOf("ts")+2);
I wish I didn't come to this guess by seeing it in real code so many times…

T_T

One of the reasons I've always been leery of regex. Especially since everyone I've seen using them tends to blindly copy an example from elsewhere and then bats at it until the test case passes.
I just realized that our codebase is probably relatively ok...
If only they had just looked for the whole key:

    ts = parseInt(jsonstr.indexOf("\"ts\":")+5);
The only thing I can think about is that ts is a abbreviation for terminal server. Which reminds me of a username: tsAdmin.

Perhaps there is an internal policy with usernames and those usernames and some rights are also transferred into the app. I don't have a better idea