Oh, God. NS PS is making me angry. They created ...
# random
s
Oh, God. NS PS is making me angry. They created a process that calls a Map/Reduce script to do some heavier work, which is reasonable. Then we reported that it failed if two users tried it at the same time. Here’s where things go off the rails: They took the original M/R script, made four additional copies of the JS file, created four new scripts (from each of the copied files) and a single deployment for each of those M/R scripts. Then the following garbage in the process that calls the M/R:
facepalm 4
😅 2
👀 2
r
I mean they did you a favor. With this handy template, you can just keep copying/pasting and adding new ones as you grow! /s
😆 2
s
This wins the award for the worst thing I have ever seen as a developer. I’d be more forgiving if it actually worked, but it is also riddled with bugs. And they duplicated the bugs five times! I was asked how long it would take me to fix the bugs and make a few small changes to this. My answer was I’d have to factor in the time to delete the existing code and forget everything I ever saw here before starting over from the beginning. There’s no fixing this.
v
bruh
1000000 1
lmao
c
This is what $275/hr+ gets you
At least make the number of scripts a script parameter or constant so you can just loop and not have to make a code change. If we're gonna be this bad lets go all the way.
d
and just put all the loop code in a free-text script param and
eval
that 😉 then you can change whenever you want without editing the script file right
1000000 1
c
I wish you the best of luck at your new job of head of NS PS.
1000000 1
😂 1
s
Maybe NS PS are doing us all a secret favor, giving us job security?
z
My favorite NS PS hacks are the ones where they add a field that is set to a saved search value and then they use a workflow to take that fields value and set it into a new copy of the field so it can be reported on.
e
this belongs on thedailywtf.com
n
What did I just read??? Written by NS PS charging $275/hr? I should increase my rate 2X
c
Whats even better is when they charge that and tell you they just put the new hires on it.
Its nuts how much they take advantage of people.
s
While deleting the NS PS code, I came across this search, and I just don’t understand it. Am I missing some clever trick here, or is this just stupid? They are doing a customer search, returning only the internal id, and the search criteria is, the internal id. That we already have.
e
I guess that's one way to see if a customer exists, but I'd just use a search.lookupFields
s
The sad thing here is that currentRecordId is the internal id of a customer, that was passed in from a Customer User Event. So the id is definitely valid, unless they are trying to see if the customer was deleted since the UE triggered this script.
n
What does the code do after getting the result?
s
replaces currentRecordId with the internal id
currentRecordId = result.getValue({ name: "internalid" });
n
🤣
That is the most useless search I have ever seen..
s
I know, and there’s no comment, no explanation of even what they thought they were doing. It just hurts my head.
n
Comment the code, move on 😄 If it is useful, you will know in a day or two
May be the dev didn't know what they were doing
1000000 1
s
I am replacing this whole thing, I don
I don’t trust any of it
n
Make sure you charge $275/hour for that