Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

03-22-2019 , 09:34 AM
I hate dealing with non technical managers

Or even worse are guys that think they’re technical but are not at all
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-22-2019 , 12:04 PM
Totally non-technical is fine at a certain level - because all they know is results. But the front-line manager directly over devs has to be technical imo to keep things headed in the right direction.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-22-2019 , 11:30 PM
Barrin,

Have you told the manager that the Jr guy is really good?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-23-2019 , 12:26 PM
I have given nothing but good feedback about him to my manager. Perhaps I need to be more explicit. Next time on our 1-1s I’m going to ask my manager when will he get promoted. It better be end of the next quarter, or I’m seriously switching teams or getting a new job. I feel like our staff engineer might be holding him back as well. Since the junior engineer is not a “yes man” with him.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2019 , 12:45 PM
I'm sure you're right barrin but why does it matter to you so much?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2019 , 12:53 PM
There's a superstar young engineer on my team as well. I went to tell his manager he needs promotion this year and thankfully it was already in the works and approved.

I don't want to speak for barrin, but in my case it was important to me because I want to see talented people get the comp and recognition they deserve -- it's nice to be in a culture that rewards high performance.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2019 , 12:55 PM
Ah i guess my company’s getting me pretty jaded
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-26-2019 , 10:37 PM
I swear I thought there was some way to do this in desctructuring wonderland (w/o having to use Object.assign or looping):

Code:
const crmUserInfo = {
  profile: {someObject: "some stuff"},
  receiptBio: {someOtherObject: "some other stuff"},
  givingHistory: {"someGivingObject": "yay giving"}  
};


const multipleDupesOneMissing = { 
  Success: {
    cognitoMatches: trimCognitoUsers(cognitoMultipleMatchesOneMissingCrm),
    ...crmUserInfo // NO - BAD!! BUT WHY DAMMIT?
  }
};
I want a flat object that looks like this:

Code:
const multipleDupesOneMissing = { 
  Success: {
    cognitoMatches: trimCognitoUsers(cognitoMultipleMatchesOneMissingCrm),
    profile: {someObject: "some stuff"},
    receiptBio: {someOtherObject: "some other stuff"},
    givingHistory: {"someGivingObject": "yay giving"}  
  }
};
No matter what I try to google I always land on the damn MDN page which just goes on and on and on and never seems to have what I want.

EDIT: Never mind. It worked the way I want. My ES LINT version was set to 8 instead of 2018.

Last edited by suzzer99; 03-26-2019 at 10:44 PM. Reason: dumb
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 01:52 AM
Quote:
Originally Posted by KatoKrazy
There's a superstar young engineer on my team as well. I went to tell his manager he needs promotion this year and thankfully it was already in the works and approved.

I don't want to speak for barrin, but in my case it was important to me because I want to see talented people get the comp and recognition they deserve -- it's nice to be in a culture that rewards high performance.
+100. Generally I like to see people I work well with get promoted. It makes them happy, less likely to leave the team or the company. If all the smart people left your team, I would be very disappointed. If it wasn’t for him, I wouldn’t be learning much, get much **** done and I would have left by now.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 06:02 PM
Had my first annual review with the company I joined in late 2017. First section: list of what I got done/delivered. Second section: what my coworkers thought of me - cliffs, some of them think I can be a bit of a dick (shocker).

Results:

Spoiler:

Big raise, huge bonus, RSU grant where I'm told only 5% of people at my salary grade get them.


** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 06:03 PM
Congrats!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 08:02 PM
Nice job Grue!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 08:08 PM
Have to work on the dick thing. Thought I was hiding it better ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 08:19 PM
I am really stuck on C# Moq. I know I must be doing something wrong. Basically I am trying to return a value from an asynchronous method that's buried in a line of asynchronous methods.

Code:
var mockBBClient = new Mock<IAppFxClient>();
  mockBBClient.Setup(x => x.RequestAsync("ping", "ping", 1))
  .Returns(Task.FromResult("sdsd"));
The mockBBClient is then passed around and winds up in the code below as Client.

The weird part is SO seems to suggest that the "sdsd" above is ignored. Task.FromResult just needs some value in there that matches the Task return type. So if that's true how the heck do I get a mock response to the methods that are calling RequestAsync in my code?

The method I'm mocking (RequestAsync) returns Task<string>. The compiler is fine with my code. But I only get a blank response in the method of code that's calling RequestAsync on the mock db access client.

So I broke down the response when running live vs. running in test mode. First I output the Task (promise I guess) before awaiting it, then after.

Code:
public async Task<string> GetData(InputsT inputs, DataListLoadOptions options)
{
    var response = Client.RequestAsync("DataListLoad", "XYZ");
            
    Console.WriteLine("pre await response");
    Console.WriteLine(response);

    var response2 = await response;
    Console.WriteLine("post await response");
    Console.WriteLine(response2);
    Console.WriteLine("FINISH");

    return response2;
}
For live results I get:
Code:
response
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[System.String,EA.Blackbaud.SoapClient+<RequestAsync>d__9]
response2
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"

... buncha XML ...

</soap:Envelope>
FINISH
For mock results I get:

Code:
response
System.Threading.Tasks.Task`1[System.String]
response2

FINISH
Is it something weird because we have a task within a task?

Last edited by suzzer99; 03-27-2019 at 08:35 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 08:22 PM
it seems so much easier to just change jobs than to wait for promotions and raises.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 09:34 PM
It is at a lot of places.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 09:39 PM
ya ive bitched about my situation a lot. I am on the promo list now. its still absurd to me. the best dev Ive worked with at my job is like the model "lead" and hes not even close to being compensated.

the problem is children. get married and pump out a bunch of kids and you arent gonna be looking to change jobs even if you are losing a bit of money. big companies just own you then.

anyway...heres a great email I just got forwarded. for context, someone from another team sent an email to our QA. not any dev. just straight to the single QA on our team. obv she forwarded it to the devs but like, its not hard to send the email to the entire team.

Quote:
Hello!
xxxx we have an API and we think the issue is not on our end. The api is whatever” and we’re receiving a 500 response code. Is there someone on the team that can help us figure out what’s going on or does another team write the APIs? The path is whatever . The error message is quite lengthy so I won’t include it here but will be happy to share if needed. Any help would be greatly appreciate. Feel free to reach out to me or Jim. Thank you!
my favorite part is that they are getting an error, but they arent gonna tell what that error is just yet. and ya Im not even gonna try to ask wtf data they were calling the api with.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 09:40 PM
Lol i think i’d be tempted to verbally abuse anyone who sent me something like that

Or at the very least “the solution is whatever”
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 10:12 PM
hmm, her email did not have "whatever", I was just removing the sensitive info from this post. sorry for the confusion.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 10:48 PM
Oh than that looks like one of 14 emails i get a day
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 10:50 PM
Quote:
Originally Posted by OmgGlutten!
it seems so much easier to just change jobs than to wait for promotions and raises.
Quote:
Originally Posted by suzzer99
It is at a lot of places.
The even dumber part is they would gladly pay some unknown off the street market rate to replace you if you left.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-27-2019 , 10:59 PM
I've hopped too much in the past 6 years and yeah tbh my comp has topped out until I get that principal roll where I can apparently sit at home and show up for calls and thats about it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-28-2019 , 12:25 AM
Quote:
Originally Posted by OmgGlutten!
it seems so much easier to just change jobs than to wait for promotions and raises.
It is, but you also have to restart again. In big companies the real money is at the upper principal/staff and partner levels. So it can pay to stay at giant corp for 10+ years, develop deep expertise, and the payday at the end is pretty huge (if you reach director/partner levels)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-28-2019 , 12:53 AM
Quote:
Originally Posted by suzzer99
The weird part is SO seems to suggest that the "sdsd" above is ignored. Task.FromResult just needs some value in there that matches the Task return type. So if that's true how the heck do I get a mock response to the methods that are calling RequestAsync in my code?
No, that's not the case. In your link, the question involves someone returning a base Task rather than a Task<T>. Prior to .NET 4.6 there was no easy way to create a completed base Task, so people would hack it with stuff like FromResult(default(int)). By this:

Quote:
As shown in this answer, in .NET 4.6 this is simplified to .Returns(Task.CompletedTask);
The poster means "in .NET 4.6 there's this easier way, don't need to hack it".

Quote:
The method I'm mocking (RequestAsync) returns Task<string>. The compiler is fine with my code. But I only get a blank response in the method of code that's calling RequestAsync on the mock db access client.
Hard to say without messing around with it. Breakpoint before you await the mocked task. What is response.Result?

My first guess at the problem is simply that your method signatures aren't the same.

Quote:
mockBBClient.Setup(x => x.RequestAsync("ping", "ping", 1))

var response = Client.RequestAsync("DataListLoad", "XYZ");
If you don't set MoqBehavior.Strict, Moq will allow you to call undefined methods on your mock. Usually, for reference types, that means you get null back, but in this instance I'm not sure if you'd get null or Task<string>.FromResult(null).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-28-2019 , 09:55 AM
Thanks a lot - this helps me understand what's going on better. My C# expert coworker doesn't seem to have a lot of experience with async stuff.

The third parameter is an optional timeout. If I try to create my mock method w/o it, I get "An expression tree may not contain a call or invocation that uses optional arguments" error.

BUT, googling that got me thinking maybe I should try the whole It.IsAny<x>() instead of my hardcoded values. And boom, this works:

Code:
mockBBClient.Setup(x => x.RequestAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<int>()))
  .Returns(Task<string>.FromResult(clientResponse));
Good demonstration to just follow the damn examples verbatim and don't assume you know what you can substitute and what you can't.

Why is It.IsAny so magic vs. random args? Oh duh, the method isn't being invoked by my test, it's being invoke by my code - with values that are not "ping", "ping" and 1. Gahhh. It never really dawned on me I was setting up a method listener looking for specific parameters.

Last edited by suzzer99; 03-28-2019 at 10:00 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m