22
Root
3y

I’m trying to add digit separators to a few amount fields. There’s actually three tickets to do this in various places, and I’m working on the last of them.

I had a nightmare debugging session earlier where literally everything would 404 unless I navigated through the site in a very roundabout way. I never did figure out the cause, but I found a viable workaround. Basically: the house doesn’t exist if you use the front door, but it’s fine if you go through the garden gate, around the back, and crawl in through the side window. After hours of debugging I eventually discovered that if I unlocked the front door with a different key, everything was fine… but nobody else has this problem?

Whatever.
Onto the problem at hand!

I’m trying to add digit separators to some values. I found a way to navigate to the page in question (more difficult than it sounds), and … I don’t know what view is rendering the page. Or what controller. Or how it generates its text.

The URL is encrypted, so I get no clues there. (Which was lead dev’s solution to having scrapeable IDs instead of just, you know, fixing them). The encryption also happens in middleware, so it’s a nightmare to work through. And it’s by the lead dev, so the code is fucking atrocious.

The view… could be one of many, and I don’t even know where they are. Or what layout. Or what partials go into building it.

All of the text on the page are “resources” — think named translations that support plus nested macros. I don’t know their names, and the bits of text I can search for are used fucking everywhere. “Confirmation number” (the most unique of them) turns up 79 matches. “Fee” showed up in 8310 places before my editor gave up looking. Really.

The table displaying the data, which is what I actually care about, isn’t built in JS or markup, but is likely a resource that goes through heavy processing. It gets generated in a controller somewhere (I don’t know the resource name so I can’t find it), and passed through several layers of “dynamic form” abstraction, eventually turned into markup, and rendered as a partial template. At least, that’s how it worked in the previous ticket. I found a resource that looks right, and there’s only the one. I found the nested macros it uses for the amount and total, and added the separators there… only to find that it doesn’t work.

Fucking dead end.

And i have absolutely nothing else to go on.

Page title? “Show”
URL? /~LiolV8N8KrIgaozEgLv93s…
Text? All from macros with unknown names. Can’t really search for it without considerable effort.
Table? Doesn’t work.
Text in the table? doesn’t turn up anything new.
Legal agreement? There are multiple, used in many places, generates them dynamically via (of course) resources, and even looking through the method usages, doesn’t narrow it down very much.

Just.
What the fuck?
Why does this need to be so fucking complicated?

And what genius decided “$100000.00” doesn’t need separators? Right, the lot of them because separators aren’t used ANYWHERE but in code I authored. Like, really? This is fintech. You’d think they would be ubiquitous.

And the sheer amount of abstraction?
Stupid stupid stupid stupid stupid.

Comments
  • 0
    And this is not as simple as calling a currency format method in a tostring style method ?
  • 3
    @killames Oh, it is. But where is the question.
  • 0
    @Root you aren’t indicating you wanted to stab me in the other rant like that bitch tori suggested years ago were you ? 🥲
  • 1
    @killames Of course.

    🗡🙂
  • -1
    @Root smooch hopefully nice lady who enjoyed the idea of me wanting to sign the execution order of everyone with the last names Zimmerman peters witmer and baker lol
  • 0
    And all women named tori lol
  • 0
    @Root oh that’s mean :( edited 😭
  • 1
    Wow, you are in desperate need of some debugability-enhancing instrumentation.

    Drop all things and start with adding trace log output to that "encrypted URL" dispatcher so you can actually see, what is handling the request in question.
    After that the actual ticket should be trivial to do - so do it.

    Then you might want to continue making that pile of crap better debugable before actually starting to refactor the hell out of it...
  • 1
    Omg you have "encrypted URLs to avoid ID scraping" too?! Holy fuck I hate that.

    In our project it's session-based to URLs are invalid after log off. Meaning you can't save pages as favorites or even use your history. So annoying and unnecessary.
Add Comment