00:00:11.667 --> 00:00:14.447 Good. I have a I have a request then. Hey Brent.
00:00:16.257 --> 00:00:16.937 Hey, what's going on?
00:00:17.577 --> 00:00:22.006 Uh, would you mind with the time after this going through that
00:00:22.006 --> 00:00:26.505 schema change you made and then how it affected the seeding the
00:00:26.505 --> 00:00:27.137 database?
00:00:29.227 --> 00:00:30.137 Sure. Yeah.
00:00:31.017 --> 00:00:34.531 I think that'd be a cool thing for for Tim and and team. OK to
00:00:34.531 --> 00:00:36.817 see if they haven't been exposed to yet.
00:00:38.147 --> 00:00:38.547 OK.
00:00:39.467 --> 00:00:40.097 Cool. Thanks.
00:00:43.007 --> 00:00:44.857 Well, it's all good and screen share.
00:00:45.167 --> 00:00:49.227 I'm just gonna do a quick once over on endpoint security.
00:00:49.887 --> 00:00:50.487 Umm.
00:00:51.937 --> 00:00:55.150 I'm I'm you guys might have already seen this or something
00:00:55.150 --> 00:00:58.471 similar, but it's just good to like get this drilled in into
00:00:58.471 --> 00:01:01.738 into the back of your head cause it's really easy to make a
00:01:01.738 --> 00:01:03.317 mistake with stuff like this.
00:01:05.227 --> 00:01:09.488 So, and I might pick on people, just because there's only, we
00:01:09.488 --> 00:01:13.749 only got two other backends are sitting here. So that pick on
00:01:13.749 --> 00:01:17.940 you guys just as a just as a
00:01:17.940 --> 00:01:22.132 away on my screen if you guys are paying attention, is there
00:01:22.132 --> 00:01:26.118 anything with this endpoint definition that you're seeing
00:01:26.118 --> 00:01:27.767 that might not be ideal?
00:01:31.277 --> 00:01:33.967 And feel free to take a second. I'm not. I'm not rushing you or
00:01:33.967 --> 00:01:35.647 trying to put you on the spot too hard.
00:01:37.387 --> 00:01:41.091 You're getting accounts but ID in anyone can get an account by
00:01:41.091 --> 00:01:43.737 ID and you'll get their whole account model.
00:01:44.377 --> 00:01:45.627 Yeah, we're not authorizing.
00:01:44.537 --> 00:01:45.007 OK.
00:01:45.917 --> 00:01:49.133 It's on storefront. Probably only wanna do that on like
00:01:47.527 --> 00:01:51.450 OK, so So what should we? So I'll ask, what should we change
00:01:49.133 --> 00:01:49.477 admin.
00:01:51.450 --> 00:01:52.157 about this?
00:01:55.967 --> 00:01:58.657 It should be. You should only be able to get your current.
00:01:57.217 --> 00:01:58.887 Not be a public API.
00:01:59.487 --> 00:01:59.977 Count.
00:02:01.187 --> 00:02:04.694 And that that this is fine because that speaks accessible.
00:02:04.694 --> 00:02:08.439 But what what a what attributes should be either add or change
00:02:07.537 --> 00:02:09.447 It's us syndicate on that bad boy.
00:02:08.439 --> 00:02:08.617 or.
00:02:08.487 --> 00:02:11.607 Off authenticate. Yeah. So what we need.
00:02:11.087 --> 00:02:12.197 All right, so outhit, Kate.
00:02:13.047 --> 00:02:16.987 So what does authenticate do just just and I? Ohh clearly I.
00:02:17.687 --> 00:02:20.257 Spelt it wrong unless it's just not in there.
00:02:21.197 --> 00:02:21.917 OK, there we go.
00:02:23.377 --> 00:02:25.967 What does authenticate do for anyone who's willing to answer?
00:02:27.127 --> 00:02:30.588 Is that not that you have a valid session cookie and cause
00:02:30.588 --> 00:02:32.347 it'll read your cookies right?
00:02:30.737 --> 00:02:31.287 Yes.
00:02:31.797 --> 00:02:35.451 Yeah. So literally all that checks is that you're logged in
00:02:35.451 --> 00:02:36.547 with Anna account.
00:02:38.767 --> 00:02:41.257 Now I'm gonna. I'll leave the used in the store front one.
00:02:42.727 --> 00:02:45.836 Because it's good to cover what what these do. So what? Does
00:02:45.836 --> 00:02:48.944 anyone know what the used in storefront? Actually, what that
00:02:48.944 --> 00:02:49.657 actually does?
00:02:52.957 --> 00:02:54.007 That's going to allow.
00:02:53.287 --> 00:02:57.922 Opens up that endpoint so that anyone on the storefront or
00:02:57.922 --> 00:03:02.477 normal site that someone would log on to would be able to
00:03:02.477 --> 00:03:03.027 access.
00:03:04.007 --> 00:03:07.715 OK. And I'm glad you said that because you're not the only
00:03:07.715 --> 00:03:11.612 person who who thinks that. I'm sure any other takers of what
00:03:11.612 --> 00:03:13.057 that may or may not do.
00:03:18.887 --> 00:03:20.157 Alright so.
00:03:21.017 --> 00:03:25.346 All the used in storefront used in admin used in anything
00:03:25.346 --> 00:03:29.898 attributes do is when you run the T fours for a given portal
00:03:29.898 --> 00:03:34.152 it just creates that like endpoint in JavaScript. So you
00:03:34.152 --> 00:03:35.047 can call it.
00:03:36.387 --> 00:03:40.205 On the front end. So that's literally all it does. It's for
00:03:40.205 --> 00:03:43.577 the T force as no security implications or anything.
00:03:44.457 --> 00:03:48.076 OK, just because something says used an admin doesn't mean you
00:03:48.076 --> 00:03:48.707 can hit it.
00:03:49.677 --> 00:03:53.679 Now, hang on. No, if you manually add a reference, if you
00:03:53.679 --> 00:03:57.542 manually call one of those endpoints from into API dash
00:03:57.542 --> 00:04:01.889 storefront, that doesn't have that it it fails, don't it? Even
00:04:01.889 --> 00:04:06.097 if you've manually made your edit, yeah, it does actually do
00:04:04.047 --> 00:04:07.882 Yes, that's correct. Yeah. So, so the Houston storefront, it
00:04:05.447 --> 00:04:06.397 Yeah, that's right. Yeah.
00:04:05.507 --> 00:04:06.007 Yeah, yeah.
00:04:06.097 --> 00:04:06.787 something.
00:04:07.882 --> 00:04:11.905 doesn't, yeah, it it, it drives the T4 generation, but yeah, it
00:04:11.905 --> 00:04:15.928 does also not load that endpoint in the storefront or admin app
00:04:15.928 --> 00:04:19.700 pool. So they'll 404 if you don't have a use in store front
00:04:18.937 --> 00:04:19.187 Yeah.
00:04:19.700 --> 00:04:20.517 Easton admin.
00:04:20.397 --> 00:04:24.060 If you try to use like, yeah, if you go like API dash, storefront
00:04:24.060 --> 00:04:27.611 slash blah blah blah blah. But I guess what I'm getting at with
00:04:25.127 --> 00:04:25.417 Right.
00:04:27.611 --> 00:04:30.885 with this. What I was trying to like get at is don't think
00:04:30.885 --> 00:04:34.214 because something does or does not have a used in whatever.
00:04:34.214 --> 00:04:36.877 Don't think has any real security implications.
00:04:37.627 --> 00:04:40.588 So what I mean by that is for example, and I guess I'll ask
00:04:40.588 --> 00:04:43.696 the same question I asked again, now we have used an admin and
00:04:43.696 --> 00:04:44.337 authenticate.
00:04:45.527 --> 00:04:47.837 Is there anything wrong with this end point now?
00:04:53.187 --> 00:04:56.497 Yeah, you could still be just logged in that and get somebody
00:04:53.557 --> 00:04:54.967 Doesn't verify the.
00:04:55.857 --> 00:04:56.387 Yeah.
00:04:56.497 --> 00:04:57.297 else's account.
00:04:57.677 --> 00:05:00.890 Right. It doesn't verify the person fetching it. It actually
00:04:57.707 --> 00:04:58.967 So so.
00:05:00.890 --> 00:05:03.207 owns it, right? Or has any right to see it?
00:05:01.767 --> 00:05:02.827 Yeah. So.
00:05:04.307 --> 00:05:08.145 Yeah. So that for example and that that's usually more handled
00:05:08.145 --> 00:05:11.983 within like the the logic of the workflow or task like in this
00:05:11.983 --> 00:05:15.759 either in here or within the workflow usually you wanna do an
00:05:15.759 --> 00:05:19.658 ownership check. The issue with the endpoint now even though it
00:05:19.167 --> 00:05:20.057 We wanna.
00:05:19.658 --> 00:05:22.277 says authenticate I could go ahead. Sorry.
00:05:23.467 --> 00:05:26.019 Ohh I was jumping the gun. I feel like we want our role
00:05:26.019 --> 00:05:27.067 permission now so that.
00:05:27.787 --> 00:05:30.974 We make sure that, let's say a global admin is the only one
00:05:28.147 --> 00:05:30.057 That that is that is.
00:05:30.974 --> 00:05:31.717 that accessed.
00:05:32.037 --> 00:05:36.179 That is correct. So if I just do used anatomy and authenticate, I
00:05:36.179 --> 00:05:39.943 can still go to API admin and as long as I'm logged into an
00:05:39.943 --> 00:05:42.893 account, regardless of permissions or roles or
00:05:42.893 --> 00:05:46.657 anything, I can still hit that endpoint and get a response.
00:05:47.437 --> 00:05:51.038 So you're correct, what I would need to do is say like required
00:05:51.038 --> 00:05:51.657 permission.
00:05:52.367 --> 00:05:53.717 And then put a permission in here.
00:05:55.737 --> 00:05:58.308 So for example, one that might be like appropriate for this
00:05:58.308 --> 00:05:58.907 would be like.
00:05:59.757 --> 00:06:03.737 Accounts account view and that would mean that only.
00:06:04.517 --> 00:06:06.247 Users that have that permission.
00:06:07.437 --> 00:06:10.631 Can Steve like hit this endpoint, get a response so and
00:06:10.631 --> 00:06:13.996 then you can check in the database, you know hey like what
00:06:13.996 --> 00:06:17.589 roles have it. So in this case it's just Jeff global admin and
00:06:17.589 --> 00:06:21.125 Clarity Connect, which means it's locked down for all intents
00:06:21.125 --> 00:06:23.577 and purposes. So now this endpoint secure.
00:06:25.217 --> 00:06:28.353 Basically, unless you're a Assef global admin that's logged in
00:06:28.353 --> 00:06:29.447 you, you can't hit it.
00:06:30.317 --> 00:06:33.661 So just wanted to cover like don't, don't think just cause
00:06:33.661 --> 00:06:37.174 something has used an admin on authenticate that by itself is
00:06:37.174 --> 00:06:40.347 not locking it down. You need this required permission.
00:06:41.787 --> 00:06:45.133 Or, you know, requires one of a set of permissions kind of
00:06:45.133 --> 00:06:48.536 thing. So did this required permission thing? Is really the
00:06:48.536 --> 00:06:52.109 biggest thing that stops people from just hitting an endpoint,
00:06:52.109 --> 00:06:53.867 getting whatever they want now.
00:06:55.267 --> 00:06:58.364 Back to what Tim said about checking ownership, that is
00:06:58.364 --> 00:07:01.792 really important too, because there's a lot of endpoints that
00:07:01.792 --> 00:07:04.999 are named a specific way, whether they say they're secure
00:07:04.999 --> 00:07:06.547 or current user or whatever.
00:07:07.147 --> 00:07:09.497 And that doesn't necessarily mean they're locked down.
00:07:10.437 --> 00:07:13.934 So I was trying to look for an example of this that's real and
00:07:13.934 --> 00:07:14.877 within this file.
00:07:15.597 --> 00:07:16.747 By just go to.
00:07:18.297 --> 00:07:19.997 This guy. So.
00:07:20.837 --> 00:07:24.141 We can see right away. Hey, look, you have to be logged in,
00:07:24.141 --> 00:07:27.610 but there's no permission on it, right? So anyone who's logged
00:07:27.610 --> 00:07:31.244 into any account can hit it now. At first glance, just by looking
00:07:31.244 --> 00:07:34.383 at the endpoints definition, that seems like it might be
00:07:34.383 --> 00:07:37.742 fine, because clearly whoever made the endpoint intended for
00:07:37.742 --> 00:07:38.237 it to be.
00:07:38.877 --> 00:07:39.377 Hey.
00:07:40.287 --> 00:07:43.177 Current user subscriptions on demand now.
00:07:45.307 --> 00:07:49.041 You can't always just assume based off of the attributes and
00:07:49.041 --> 00:07:52.897 the naming of stuff that it's gonna be locked down, because if
00:07:52.897 --> 00:07:56.325 we actually look at the implementation for this guy and
00:07:56.325 --> 00:07:58.467 notice this DTO property here UID.
00:07:59.107 --> 00:08:03.220 If we go down here, we'll notice that in this workflow call, it
00:08:03.220 --> 00:08:07.267 actually tells you what's wrong, but it has A to do which says
00:08:07.267 --> 00:08:11.315 delete and use current account ID, or throw 401 or request ID.
00:08:11.315 --> 00:08:15.235 Now request dot ID. Why should we not use request dot ID for
00:08:15.235 --> 00:08:15.877 ownership?
00:08:17.157 --> 00:08:17.527 And that.
00:08:17.167 --> 00:08:20.021 Because I can change that right in the network call, I can pass
00:08:18.867 --> 00:08:22.474 Yeah, like I can set request ID to yeah, you can set that to
00:08:20.021 --> 00:08:20.957 whatever idea I want.
00:08:22.474 --> 00:08:26.022 literally whatever you want, right? So if the workflow just
00:08:26.022 --> 00:08:29.866 goes off of the request ID that the front end is setting in, you
00:08:29.866 --> 00:08:33.651 can change that to anything. You could literally be anything so
00:08:33.651 --> 00:08:37.317 that it should you should be using current account with throw
00:08:37.317 --> 00:08:40.924 41 and same thing with this DTO property UID not not that no
00:08:40.924 --> 00:08:44.117 good. So what you really should be doing is this guy.
00:08:46.047 --> 00:08:49.045 If that's intended to be a user ID, that should be current user
00:08:46.067 --> 00:08:46.737 And that's how.
00:08:49.045 --> 00:08:50.777 ID or throw 401. But yes, same deal.
00:08:49.637 --> 00:08:49.907 Yeah.
00:08:51.387 --> 00:08:55.286 Yeah, same thing. Just as long as you're not trusting the
00:08:52.257 --> 00:08:53.477 It looks like it probably is.
00:08:55.286 --> 00:08:56.697 incoming DTO to have.
00:08:57.687 --> 00:09:01.904 You know for ownership checks, basically. So you'll see in the
00:08:58.527 --> 00:08:58.687 Yep.
00:09:00.247 --> 00:09:00.487 Yep.
00:09:01.904 --> 00:09:06.255 certain places maybe there will be like a, you know request dog,
00:09:06.255 --> 00:09:08.397 you know user ID equals current.
00:09:09.757 --> 00:09:13.207 User ID or throw four. One that that's like an example of it.
00:09:13.207 --> 00:09:16.435 Basically it's saying, hey, let's not trust whatever's on
00:09:16.435 --> 00:09:19.662 this cause. This could be anything. Let's actually ask or
00:09:17.087 --> 00:09:18.987 Yeah. Rule of thumb.
00:09:19.662 --> 00:09:22.833 application to tell us who's this person on the session,
00:09:22.833 --> 00:09:23.167 right?
00:09:23.527 --> 00:09:27.096 Yeah. And the rule of thumb should be if you ever write an
00:09:27.096 --> 00:09:30.726 endpoint that accepts a user or account ID or anything like
00:09:30.726 --> 00:09:34.053 that, that should be an immediate red flag to you that
00:09:34.053 --> 00:09:37.743 unless you're doing something in like the admin portal where
00:09:37.743 --> 00:09:41.614 you're like, you're assigning a user or you're acting as a user
00:09:41.614 --> 00:09:45.365 in the admin portal and you've properly secured the endpoint,
00:09:45.365 --> 00:09:49.236 any storefront facing endpoint, you should never be writing one
00:09:49.236 --> 00:09:53.228 where you can specify which user is doing the thing or which user
00:09:53.228 --> 00:09:54.317 to act as because.
00:09:54.497 --> 00:09:57.360 All you're doing is making a door for anyone to do anything
00:09:57.360 --> 00:09:57.837 as anyone.
00:10:00.187 --> 00:10:03.903 Yep. And again pretty much any query you know by name ID
00:10:03.903 --> 00:10:08.011 doesn't matter, doesn't matter what kind of identifier or what
00:10:08.011 --> 00:10:12.053 parameter those should be locked down and if they're not, you
00:10:12.053 --> 00:10:16.095 know, the back end should be saying hey, only get it for this
00:10:16.095 --> 00:10:20.398 session's record, whether it's a user ID, account ID or whatever.
00:10:20.398 --> 00:10:24.505 So that was pretty much it just biggest takeaways is ownership
00:10:24.505 --> 00:10:28.612 checks, whether that's within the workflow or in this endpoint
00:10:28.612 --> 00:10:31.937 task. And then on the actual endpoints themselves.
00:10:32.057 --> 00:10:34.849 If there's anything they're grabbing that might be you don't
00:10:34.849 --> 00:10:37.138 want everyone to know, you probably want required
00:10:37.138 --> 00:10:39.197 permission or you need that ownership check.
00:10:40.297 --> 00:10:41.687 So yeah, that was pretty much it.
00:10:43.447 --> 00:10:46.454 If you want uh Brent, you can take it away and we can look at
00:10:46.454 --> 00:10:49.267 that stuff with the migrations and seeding, I'm not sure.
00:10:50.197 --> 00:10:50.977 Yeah, sure thing.
00:10:50.577 --> 00:10:51.677 But uh yeah.
00:10:52.407 --> 00:10:53.947 Great job TMK. Thank you.
00:10:53.217 --> 00:10:53.907 Still.
00:10:59.407 --> 00:11:01.197 I feel much less insecure now.
00:11:02.337 --> 00:11:02.677 Uh.
00:11:02.847 --> 00:11:06.397 Not just in on a personal level, but also from a coding level.
00:11:11.407 --> 00:11:15.745 Alright, so a few weeks back into the change on the E
00:11:15.745 --> 00:11:20.244 database where I added the account contacts type to the
00:11:20.244 --> 00:11:25.064 account contact. So I made the new table and then added the
00:11:25.064 --> 00:11:30.125 typed variable to the account contact model and so in order to
00:11:30.125 --> 00:11:33.097 correctly run a migration with this.
00:11:34.197 --> 00:11:38.514 I had to remove any additional previous contacts for the
00:11:38.514 --> 00:11:43.360 account and subsequently had to remove the accounts themselves.
00:11:43.360 --> 00:11:46.767 So when I ran my migration I had to rebuild.
00:11:48.247 --> 00:11:52.030 The whole database and since seed everything when they did it
00:11:52.030 --> 00:11:55.873 that way, I didn't run into any issues, but another developer,
00:11:55.873 --> 00:11:58.557 Alex, I think he just removed the accounts.
00:11:59.267 --> 00:12:05.632 And then ran the seating and so for some reason when he did
00:12:05.632 --> 00:12:07.647 that, the products.
00:12:08.767 --> 00:12:12.455 Products associations were not in the database, so when he
00:12:12.455 --> 00:12:16.392 tried to view the catalog on the website, none of the products
00:12:16.392 --> 00:12:17.267 would show up.
00:12:18.047 --> 00:12:21.756 And the only way I could fix that was to delete all the
00:12:21.756 --> 00:12:22.617 products and.
00:12:23.797 --> 00:12:26.627 They're related database entries.
00:12:27.547 --> 00:12:29.117 And then receive the database.
00:12:30.377 --> 00:12:34.017 I received the products anyways so that that wasn't.
00:12:35.417 --> 00:12:38.858 I'm not sure the cause of that. I don't know how exactly 100%.
00:12:38.858 --> 00:12:40.987 I'm not 100% sure how exactly he went.
00:12:42.367 --> 00:12:44.077 Receding the data.
00:12:46.367 --> 00:12:49.924 One he had implemented the new migration, but it was it was
00:12:49.924 --> 00:12:53.067 weird that the the products did not have a a product
00:12:53.067 --> 00:12:53.837 associations.
00:12:55.327 --> 00:12:58.927 Related to them, after this migration so.
00:13:00.507 --> 00:13:01.997 I'm actually not sure.
00:13:02.657 --> 00:13:03.337 How we could?
00:13:04.147 --> 00:13:05.977 Look into the cause of that.
00:13:07.777 --> 00:13:12.180 So what you're saying is, so whenever you you you added the
00:13:08.227 --> 00:13:08.757 Because I think.
00:13:12.180 --> 00:13:14.087 account contact type onto.
00:13:14.927 --> 00:13:17.277 The account contact table and then when you ran the migration
00:13:17.277 --> 00:13:19.398 it was complaining it. It basically wouldn't let you do
00:13:19.398 --> 00:13:19.777 it, right?
00:13:20.147 --> 00:13:22.717 It wouldn't let me do it because right there was, UM.
00:13:22.947 --> 00:13:26.401 Yeah, because there's a the reason would be there were
00:13:24.017 --> 00:13:24.337 Yeah.
00:13:26.401 --> 00:13:30.106 existing records in the account contact table and you were
00:13:29.277 --> 00:13:29.637 Umm.
00:13:30.106 --> 00:13:31.487 inserting the type ID.
00:13:32.547 --> 00:13:36.269 The required type ID column into the table and all the existing
00:13:36.269 --> 00:13:39.933 records would not have a type ID so they wouldn't know what to
00:13:39.933 --> 00:13:40.107 do.
00:13:40.637 --> 00:13:41.727 Exactly, yeah.
00:13:43.167 --> 00:13:47.062 I believe that you can actually. So if you open up your
00:13:47.062 --> 00:13:47.757 migration.
00:13:50.807 --> 00:13:51.877 This is kind of a.
00:13:54.687 --> 00:13:58.538 I could have done this earlier but kind of too late now, but
00:13:58.538 --> 00:14:01.757 doesn't really matter. You can actually in the up.
00:13:58.967 --> 00:13:59.307 Mm-hmm.
00:14:03.527 --> 00:14:05.477 Method there at the end of it.
00:14:08.757 --> 00:14:09.057 Sure.
00:14:09.217 --> 00:14:12.976 So like at the end of the method, yes, alright down there.
00:14:12.976 --> 00:14:16.989 I think you can just type SQL right here. Capital S lowercase,
00:14:16.989 --> 00:14:17.307 yeah.
00:14:17.927 --> 00:14:18.647 Umm.
00:14:19.647 --> 00:14:24.751 OK. And then in here you can just set the type ID so you can
00:14:24.751 --> 00:14:29.772 do update accounts dot account contact set like as as a SQL
00:14:29.772 --> 00:14:30.357 string.
00:14:31.267 --> 00:14:31.747 OK.
00:14:33.917 --> 00:14:37.678 Yeah. And then yeah, you basically do update accounts dot
00:14:37.678 --> 00:14:40.077 account, contact set type ID equals.
00:14:42.127 --> 00:14:43.397 UH-1.
00:14:45.087 --> 00:14:47.677 Umm. Or something like that.
00:14:48.777 --> 00:14:49.847 OK. Yeah, so.
00:14:51.487 --> 00:14:52.377 So OK.
00:14:52.907 --> 00:14:55.397 Yeah. So you could basically you could create.
00:14:56.137 --> 00:14:59.782 A like see to default type account contact type and then
00:14:59.782 --> 00:15:03.236 use this to set it on the existing records. When this
00:15:03.236 --> 00:15:07.137 migration runs. So basically patches up the existing records
00:15:07.137 --> 00:15:11.293 and ensures that the rest of the migration can run. We very very
00:15:11.293 --> 00:15:15.002 rarely do this because the alternate fix would just be to
00:15:13.547 --> 00:15:13.907 Mm-hmm.
00:15:15.002 --> 00:15:19.095 delete all of the records in the account contact table and most
00:15:19.095 --> 00:15:22.996 of the time when we're doing active schema changes like this
00:15:19.627 --> 00:15:19.917 Umm.
00:15:22.996 --> 00:15:26.577 it's not on a site that has like a production database.
00:15:26.847 --> 00:15:27.217 Sure.
00:15:28.027 --> 00:15:31.972 But if we did have a production database where we wanted to run
00:15:31.972 --> 00:15:35.792 this migration without loss of data, this is the way that you
00:15:35.792 --> 00:15:39.675 could do is you could use the SQL method inside the migrations
00:15:39.675 --> 00:15:43.311 to customize a little bit of what gets generated when this
00:15:43.311 --> 00:15:47.009 migration runs and it would patch up the existing record so
00:15:47.009 --> 00:15:50.706 they don't have to be deleted or like manually rectified or
00:15:50.706 --> 00:15:51.877 anything like that.
00:15:53.557 --> 00:15:54.647 And as a side note.
00:15:55.237 --> 00:15:59.976 Umm migrations do get auto generated but they're not like
00:15:59.976 --> 00:16:05.041 T4 outputs they are. They are able to be edited and so if the
00:16:02.287 --> 00:16:02.567 Mm-hmm.
00:16:05.041 --> 00:16:10.188 migration does something like this that you may need to change
00:16:10.188 --> 00:16:14.027 obviously use your discretion in terms of not.
00:16:15.347 --> 00:16:17.677 Breaking stuff if it. If it's, you know there.
00:16:18.277 --> 00:16:21.654 But you can make adjustments like this to patch up any small
00:16:21.654 --> 00:16:24.864 issues that arise as you're making new migrations. If you
00:16:24.864 --> 00:16:25.307 need to.
00:16:25.377 --> 00:16:28.427 You make sure that some default values are set.
00:16:29.097 --> 00:16:31.427 Uh, and I think even, UM.
00:16:33.487 --> 00:16:36.793 Ah, there's there might even be a way to do this in with like
00:16:36.793 --> 00:16:39.831 the on model creating method where it will automatically
00:16:39.831 --> 00:16:41.697 inject this type of thing for you.
00:16:44.967 --> 00:16:46.007 Yeah, that does sound right.
00:16:45.037 --> 00:16:45.627 But.
00:16:47.147 --> 00:16:51.253 But yeah, uh, you can even. You can even make a migration that
00:16:51.253 --> 00:16:54.968 changes nothing, like don't change any schema at all and
00:16:54.968 --> 00:16:59.139 then call entity framework, add migration and then just write a
00:16:59.139 --> 00:17:03.049 completely custom like hand rolled migration that generates
00:17:03.049 --> 00:17:07.025 you know with the up and down methods that does whatever you
00:17:07.025 --> 00:17:07.937 need it to do.
00:17:08.707 --> 00:17:09.057 Sure.
00:17:09.627 --> 00:17:10.037 So.
00:17:10.607 --> 00:17:13.964 Uh, you can use that for ensuring that like a stored
00:17:13.964 --> 00:17:17.891 procedure gets pushed into the database or anything like that
00:17:17.891 --> 00:17:18.207 that.
00:17:19.567 --> 00:17:23.227 That there's not really a parallel for in the code first
00:17:23.227 --> 00:17:26.952 model, but that we want to be consistently applied to all
00:17:26.952 --> 00:17:30.419 databases. That's actually how the upsert UI keys and
00:17:30.419 --> 00:17:34.207 translations stored procedure ends up in all set databases
00:17:34.207 --> 00:17:37.867 because many, many years ago there was a migration that.
00:17:38.837 --> 00:17:42.000 Put that in there. So forget what it's called. But it's up
00:17:41.497 --> 00:17:41.727 Yeah.
00:17:42.000 --> 00:17:45.056 there and it's like it isn't like 2018 or something like
00:17:45.056 --> 00:17:45.967 that, but anyway.
00:17:47.937 --> 00:17:51.318 Obviously, in order for this to work, there's a couple things.
00:17:51.318 --> 00:17:54.269 You change. Number one, you wouldn't hard code type ID
00:17:54.269 --> 00:17:57.382 equals one. You'd probably set type ID equals and then in
00:17:57.382 --> 00:18:00.708 parentheses like select top one ID from accounts dot account,
00:18:00.708 --> 00:18:03.660 contact type or something so that it's determined that
00:18:03.660 --> 00:18:04.357 doesn't like.
00:18:05.507 --> 00:18:08.848 Screwed up or anything and you could even make it more
00:18:07.027 --> 00:18:07.297 Right.
00:18:08.848 --> 00:18:12.674 deterministic by having a sequel query that creates one with a
00:18:12.674 --> 00:18:16.257 specific type ID before this or specific type name, key et
00:18:16.257 --> 00:18:19.901 cetera, and then doing update account, set account, contact
00:18:19.901 --> 00:18:23.302 set type ID equals select top one ID from accounts that
00:18:23.302 --> 00:18:26.642 account contact type where key equals the one that you
00:18:26.642 --> 00:18:30.407 specifically generated and that way it will deterministically
00:18:30.407 --> 00:18:34.233 always tie all new records to the same key or to the same type
00:18:34.233 --> 00:18:35.387 key no matter what.
00:18:35.477 --> 00:18:39.116 That that type keys ID happens to generate as whether it's one
00:18:39.116 --> 00:18:39.867 or a million.
00:18:40.637 --> 00:18:42.557 Umm it would. It would tie them to the right thing.
00:18:47.867 --> 00:18:48.327 Alright.
00:18:50.647 --> 00:18:54.759 I So what would there be anything related to one of these
00:18:54.759 --> 00:18:58.658 updates that could have potentially deleted stuff from
00:18:58.658 --> 00:19:02.627 the the Products Association table cause the the issue?
00:19:01.627 --> 00:19:02.747 Not that I'm seeing.
00:19:03.397 --> 00:19:03.827 OK.
00:19:04.867 --> 00:19:07.767 That was the little bit of an unusual bug to appear from this
00:19:07.767 --> 00:19:10.854 unless I mean, unless some there was something else that was done
00:19:10.854 --> 00:19:12.537 that I'm not aware of the database.
00:19:12.247 --> 00:19:12.897 I.
00:19:13.547 --> 00:19:16.610 I would assume that somebody probably was trying to rectify
00:19:13.847 --> 00:19:15.407 It wasn't a war, yeah.
00:19:16.610 --> 00:19:19.724 issues that came up when they ran the migration and they may
00:19:19.724 --> 00:19:22.837 have just accidentally cleared the wrong table or something.
00:19:20.327 --> 00:19:20.667 Yeah.
00:19:24.497 --> 00:19:27.579 Yeah, I think I was in the, I was in a working session with
00:19:27.579 --> 00:19:30.609 them when they were going through some of this. I'm trying
00:19:30.609 --> 00:19:33.177 to remember exactly how that happened, but it it.
00:19:34.947 --> 00:19:37.577 It was definitely all I can remember is a it was avoidable.
00:19:38.617 --> 00:19:39.597 That's all I can say.
00:19:41.627 --> 00:19:42.317 OK.
00:19:41.657 --> 00:19:46.854 But it wasn't like a total freak accident. It wasn't a bit flip
00:19:46.854 --> 00:19:49.127 from a solar flare, so yeah.
00:19:47.957 --> 00:19:48.377 That's good.
00:19:49.877 --> 00:19:52.385 Like a pretty sure it shouldn't be possible for what we were
00:19:49.967 --> 00:19:51.737 Yeah, he had just pulled.
00:19:52.385 --> 00:19:52.837 doing, but.
00:19:54.757 --> 00:19:57.635 Yeah, just pulled and he tried running migrations. It ran
00:19:57.635 --> 00:19:59.867 migrations with. That's when it freaked out.
00:20:01.127 --> 00:20:02.237 Oh yeah, I think.
00:20:01.687 --> 00:20:05.617 He couldn't run that migration for whatever reason. He didn't
00:20:05.617 --> 00:20:08.976 see it in the list, so we reverted back and then ran
00:20:08.976 --> 00:20:12.779 migrations again and it was still jumping over it, at which
00:20:12.779 --> 00:20:15.757 point I think we grabbed a different database.
00:20:17.317 --> 00:20:18.157 Who?
00:20:17.507 --> 00:20:20.468 Wasn't it like it it when there was some kind of seeding or
00:20:20.468 --> 00:20:23.033 something where like programmatically it just broke
00:20:23.033 --> 00:20:25.697 somewhere down the chain and that's why it was empty?
00:20:26.677 --> 00:20:29.771 Like, I think that's pretty much something like that happened
00:20:29.771 --> 00:20:31.567 like I think it was just like that.
00:20:32.577 --> 00:20:32.887 OK.
00:20:32.937 --> 00:20:34.487 Does something wasn't good?
00:20:35.617 --> 00:20:38.601 Whether that was already in the database or there was some kind
00:20:38.601 --> 00:20:41.631 of like default data missing or something eventually once it got
00:20:41.631 --> 00:20:44.707 to where it would have populated that table, it just freaked out.
00:20:45.267 --> 00:20:45.607 Umm.
00:20:45.557 --> 00:20:48.626 So I think that's pretty much what happened with that one
00:20:48.626 --> 00:20:51.906 table that was missing. I will call out those since I are you
00:20:51.906 --> 00:20:54.287 working on is this for A and a or something?
00:20:54.497 --> 00:20:55.757 Yes, it is, and Yep.
00:20:55.747 --> 00:21:00.094 OK, I was going to say I think and a QA still has this issue on
00:21:00.094 --> 00:21:03.898 it cause as with the Alex earlier help with the rewrite
00:21:01.497 --> 00:21:04.787 Yeah. I was about ready to to jump on it and fix it.
00:21:03.898 --> 00:21:04.577 config so.
00:21:05.387 --> 00:21:05.727 Yeah.
00:21:06.527 --> 00:21:06.817 So.
00:21:07.507 --> 00:21:10.183 Cool. And so actually, what I was actually this is this is
00:21:10.183 --> 00:21:12.995 great, but actually what I was referring to was the seed data
00:21:12.995 --> 00:21:14.537 issue. Brent, if you recall that.
00:21:15.717 --> 00:21:18.983 Which I just pinged you about it because it's it's fascinating
00:21:16.017 --> 00:21:17.027 Ohh.
00:21:18.983 --> 00:21:22.197 because it's, it's something that you'll never, I don't think
00:21:22.197 --> 00:21:24.167 a back end Dev will ever think about.
00:21:25.767 --> 00:21:27.637 Necessarily, we're doing a schema change.
00:21:29.327 --> 00:21:33.147 Yeah. So when you do a schema change too, you've got to go to
00:21:33.147 --> 00:21:36.844 your shared data model and the data set here in the default
00:21:36.844 --> 00:21:38.507 data and make sure you add.
00:21:40.077 --> 00:21:44.498 A method in here that populates the table that you've just
00:21:44.498 --> 00:21:45.847 generated. So for.
00:21:47.167 --> 00:21:51.257 This is something that I missed. I didn't add this here so.
00:21:52.137 --> 00:21:56.227 It it was yeah, causing an issue when.
00:21:56.487 --> 00:22:00.503 I Alex tried to to run the seed data. So that's one thing you
00:22:00.503 --> 00:22:04.520 gotta be aware of when you're adding a new tables that you go
00:22:04.520 --> 00:22:05.167 into this.
00:22:06.967 --> 00:22:11.647 It's a default. See that that make the correct marked method.
00:22:11.207 --> 00:22:14.357 This is this is mostly for.
00:22:12.567 --> 00:22:12.837 So.
00:22:16.147 --> 00:22:20.017 Things like new status, states, types, etcetera.
00:22:21.267 --> 00:22:24.157 You don't have to do this for every schema change that you do.
00:22:24.157 --> 00:22:27.138 Uh for every new table, but for all of the new types, States and
00:22:27.138 --> 00:22:28.697 statuses, you do need to do this.
00:22:29.797 --> 00:22:30.577 OK, so it's.
00:22:29.897 --> 00:22:32.984 One even if but but. But even if you added a field like, let's
00:22:30.397 --> 00:22:31.137 It's one of the.
00:22:32.984 --> 00:22:35.825 say you added a non nullable field to the product record.
00:22:35.825 --> 00:22:38.127 Wouldn't you have to come in and add that too?
00:22:41.227 --> 00:22:43.337 Not to here, I don't think.
00:22:44.497 --> 00:22:45.667 Unless it was like a.
00:22:46.957 --> 00:22:49.597 Unless you added a non nullable field to something.
00:22:50.697 --> 00:22:53.397 You would have. You would have to do it in sample.
00:22:51.597 --> 00:22:53.947 To like that, there was a foreign key to another table.
00:22:55.567 --> 00:22:56.937 And which case you may need to.
00:22:55.927 --> 00:22:58.859 You'd have to even sample data, right? Wouldn't you? If it was
00:22:58.859 --> 00:23:01.557 like non nullable, you'd have to do in sample data, yeah?
00:23:00.067 --> 00:23:00.667 Yeah.
00:23:02.257 --> 00:23:06.737 So I added a non nullable field a couple weeks back on a scheme
00:23:06.737 --> 00:23:07.927 of change to the.
00:23:08.007 --> 00:23:08.467 And.
00:23:09.887 --> 00:23:15.436 Job opening in Tasco I added a non nullable expiration date and
00:23:15.436 --> 00:23:20.377 I did not make a change into any of the seed data files.
00:23:22.497 --> 00:23:24.667 So if it's it's.
00:23:22.577 --> 00:23:23.697 So when the.
00:23:22.927 --> 00:23:27.617 That that, I think is fine because there is no.
00:23:26.687 --> 00:23:28.177 We only, yeah.
00:23:28.877 --> 00:23:31.187 Terri, say what you're actually doing in here.
00:23:29.107 --> 00:23:29.617 So I got.
00:23:31.897 --> 00:23:35.315 To be clear is that you're actually generating a new entire
00:23:35.315 --> 00:23:38.961 record. This is generating the default type States and statuses
00:23:38.961 --> 00:23:40.727 for all these different tables.
00:23:41.997 --> 00:23:45.167 Umm, if you're adding a field to an existing table.
00:23:45.857 --> 00:23:48.513 I don't think that there's anything you need to do in here.
00:23:48.513 --> 00:23:51.302 You probably would need to go into sample data if their sample
00:23:51.302 --> 00:23:53.914 data being generated for that type, and make sure that the
00:23:53.687 --> 00:23:54.157 Yep.
00:23:53.914 --> 00:23:55.507 required fields are all filled out.
00:23:56.307 --> 00:23:59.698 But if you're but for, this is for default data, so this is for
00:23:59.698 --> 00:24:03.035 anything that is, no matter what your project is, you're gonna
00:24:03.035 --> 00:24:06.372 need these things. So this isn't like sample customers. Sample
00:24:06.372 --> 00:24:09.657 product sample order data. This is like these are kind of the
00:24:09.657 --> 00:24:12.835 ones you're really gonna need all the different type States
00:24:12.835 --> 00:24:15.961 and statuses for all the stuff. That's just normally gonna
00:24:15.961 --> 00:24:16.967 happen in ASF site.
00:24:19.127 --> 00:24:23.199 So if they win the schema for like job openings and such had
00:24:23.199 --> 00:24:27.539 been written. If there had been sampled data added to the sample
00:24:27.539 --> 00:24:31.544 data file when the migration to add the expiration date non
00:24:31.544 --> 00:24:35.482 nullable was added, the seed data would not have succeeded
00:24:35.482 --> 00:24:39.488 right? Because it it wouldn't have had a field to add to it
00:24:39.488 --> 00:24:43.560 wouldn't have a value to add to that new non nullable field.
00:24:43.560 --> 00:24:46.697 When you're in the migration. Is that correct?
00:24:47.537 --> 00:24:50.577 Not when you were in the migrations, but when you were in
00:24:50.577 --> 00:24:53.616 the seed database. Test the default data and the seed and
00:24:51.007 --> 00:24:51.447 Mm-hmm.
00:24:53.616 --> 00:24:56.917 the sample data are not run by yeah, so it's not. It's kind of
00:24:53.637 --> 00:24:54.327 OK.
00:24:56.917 --> 00:25:00.271 easy because there is a seed, a bit of seed logic that gets run
00:25:00.271 --> 00:25:03.624 by entity framework when you run the migrations and you'll see,
00:25:03.624 --> 00:25:05.877 say, running seed method at the end of it.
00:25:05.617 --> 00:25:06.037 Yeah.
00:25:06.997 --> 00:25:09.406 That's different from the default data and sample data
00:25:09.406 --> 00:25:12.208 they're in this method. That's the ones that run when you go to
00:25:12.208 --> 00:25:12.427 that.
00:25:12.827 --> 00:25:13.527 The test.
00:25:13.527 --> 00:25:16.613 Uh, yeah, the unit test to run all C data in order, that's
00:25:15.367 --> 00:25:15.797 Yeah.
00:25:16.613 --> 00:25:18.077 that's what's running these.
00:25:18.647 --> 00:25:19.097 OK.
00:25:19.397 --> 00:25:23.217 Yeah. So these these are just our core like our you can almost
00:25:23.217 --> 00:25:26.975 think of these as like our core entities, right? Like you you
00:25:26.975 --> 00:25:30.552 need sample data like for your the sample products and the
00:25:30.552 --> 00:25:34.069 clarity login and all that stuff. And the reason why this
00:25:34.069 --> 00:25:37.888 is so important is because and and you know just talking about
00:25:37.888 --> 00:25:41.465 what happened if if you know somebody like in Brent's case
00:25:41.465 --> 00:25:45.284 like so he added the the account contact type he can easily he
00:25:45.284 --> 00:25:48.982 already has an instance of Seth he's already ran a seed data
00:25:48.982 --> 00:25:49.467 file so.
00:25:49.707 --> 00:25:52.673 The next step from his perspective is just to go into
00:25:52.673 --> 00:25:55.913 sequel and make make a really simple, you know, record for
00:25:55.913 --> 00:25:59.428 that for that type, right? Super easy, no problem. But then the
00:25:59.428 --> 00:26:02.448 problem becomes for the next developer, once that gets
00:26:02.448 --> 00:26:05.579 committed and they try to run the C data, not only is it
00:26:05.579 --> 00:26:08.874 breaking, but they have no idea why it's breaking right and
00:26:08.874 --> 00:26:11.949 especially if it's a front end developer, which is what
00:26:11.949 --> 00:26:13.157 happened in this case.
00:26:14.477 --> 00:26:18.142 You know, now we're 5-6 hours trying to troubleshoot something
00:26:18.142 --> 00:26:21.749 that they're, you know, they're trying to to struggle through
00:26:21.749 --> 00:26:25.414 and they have no idea why. So it's kind of a unique situation,
00:26:25.414 --> 00:26:28.905 but one that I wanted to kind of talk about. And thank you,
00:26:28.905 --> 00:26:32.512 Brent, for going through that because it is, even though it's
00:26:32.512 --> 00:26:36.235 not likely to necessarily come up because we're not going to be
00:26:36.235 --> 00:26:39.842 making many schema changes to those core entities, right? And
00:26:39.842 --> 00:26:42.867 when we do it's, it's usually gonna happen in core.
00:26:43.307 --> 00:26:47.552 And and before it gets into a client project, but it's
00:26:47.552 --> 00:26:52.415 definitely an area where we can lose 5678 hours pretty quickly
00:26:52.415 --> 00:26:54.267 just from the confusion.
00:26:56.157 --> 00:26:58.157 And sorry, Tim Kaine saw you had your hand up there.
00:26:58.767 --> 00:27:01.700 I was going to circle back to what Tim was talking about
00:27:01.700 --> 00:27:04.685 because he said he had added a required field right to an
00:27:04.685 --> 00:27:07.464 existing table, but it's not like a type of status or
00:27:07.464 --> 00:27:10.448 whatever in that instance. Would that be where? Cause you
00:27:10.448 --> 00:27:13.844 mentioned the, you know, you can go back to like you can edit the
00:27:13.844 --> 00:27:16.932 migration manually and like put a default value and they're
00:27:16.932 --> 00:27:19.865 basically for any of the existing records. Would that be
00:27:19.865 --> 00:27:23.055 where you might want to employ that on top of editing default
00:27:22.297 --> 00:27:23.897 You he.
00:27:23.055 --> 00:27:23.827 or sample data?
00:27:25.657 --> 00:27:30.477 Yeah, yeah. But then, I mean, that would still potentially
00:27:30.477 --> 00:27:35.624 break. So can you go to Brent, can you go scroll back up there
00:27:35.624 --> 00:27:36.767 and go to the?
00:27:38.307 --> 00:27:42.573 Sample data dot product I guess since that's the one that I used
00:27:42.573 --> 00:27:46.511 sample data dot products and you'll see in here that we are
00:27:46.511 --> 00:27:50.515 literally listing through like every single field. So if you
00:27:50.515 --> 00:27:54.519 add a field to this, so the migration what you're saying, it
00:27:51.687 --> 00:27:52.207 Umm.
00:27:54.519 --> 00:27:58.785 sounds like that would probably that would probably do the trick
00:27:58.785 --> 00:27:59.047 but.
00:28:00.607 --> 00:28:03.844 There's still just for a best practice, like if there's a
00:28:03.844 --> 00:28:07.249 required field being added to the product record, we have to
00:28:07.249 --> 00:28:10.654 come in here manually type that field, whatever that is, and
00:28:08.987 --> 00:28:09.617 Hmm yeah.
00:28:10.654 --> 00:28:11.937 then add a line for it.
00:28:13.327 --> 00:28:16.444 Yeah, I was saying it because I I know this BL mentioned like
00:28:16.444 --> 00:28:19.761 the hey, if something's required you could like add that SQL line
00:28:19.761 --> 00:28:23.029 in the migration itself as well for the existing records too. So
00:28:23.029 --> 00:28:25.894 I wouldn't just be for new records, you'd have to add it
00:28:25.894 --> 00:28:28.457 for the existing ones. I'm guessing too for it to.
00:28:29.637 --> 00:28:32.568 For you to not have, I'm not actually sure what would happen
00:28:32.568 --> 00:28:35.258 if you added a required field and then you had existing
00:28:35.258 --> 00:28:37.227 records, so I've been trying to do that.
00:28:38.287 --> 00:28:40.627 Probably an issue when you tried to map it out right.
00:28:43.947 --> 00:28:45.077 Well, let's talk about look.
00:28:43.987 --> 00:28:44.867 Maybe I'm not.
00:28:44.057 --> 00:28:45.547 So yeah, you'd wanna update it.
00:28:45.917 --> 00:28:48.500 Let's talk about that because, yeah, you would want him. You
00:28:48.500 --> 00:28:51.167 would want, like, let's say you make that make that migration.
00:28:52.467 --> 00:28:55.518 On your local, once it goes to QA and stage, you'll want
00:28:55.518 --> 00:28:58.890 records that are already there to now get those without having
00:28:58.890 --> 00:29:01.994 to receive that data. So yes, you should do the SQL piece
00:29:01.994 --> 00:29:05.419 there, but if that is going back into core then then we need to
00:29:02.207 --> 00:29:02.547 Umm.
00:29:05.419 --> 00:29:08.791 go back and update the sample data or the default data to have
00:29:08.791 --> 00:29:12.110 that as well. So that for the next time a project uses it. So
00:29:10.787 --> 00:29:11.087 Yep.
00:29:12.110 --> 00:29:15.267 like that's the criteria for what's what to do with there.
00:29:16.127 --> 00:29:19.480 Yeah, yeah, I was basically confirming you'd basically have
00:29:19.480 --> 00:29:22.888 to do all three tricks that we just talked about at once. If
00:29:22.888 --> 00:29:26.017 you're adding a required field. So yeah, cool. Awesome.
00:29:27.907 --> 00:29:28.167 So.
00:29:28.247 --> 00:29:31.479 Yeah, there's one more thing I like to add with this new schema
00:29:31.479 --> 00:29:34.710 changes on the the new develop branch is up. The JG was talking
00:29:34.710 --> 00:29:37.739 about a few weeks ago. There are some things that don't get
00:29:37.739 --> 00:29:40.870 automatically generated that's thrown an issue for me in this
00:29:40.870 --> 00:29:43.697 mapping initializer file. It doesn't actually generate.
00:29:45.257 --> 00:29:46.287 These three.
00:29:48.357 --> 00:29:51.418 Calls. So if you were running into an issue with your test
00:29:51.418 --> 00:29:54.635
of the reasons why it's it's
00:29:54.635 --> 00:29:58.007 trying to initialize this in the test field, but it's not there.
00:30:00.207 --> 00:30:02.017 I think Juju is aware of this but.
00:30:03.557 --> 00:30:06.033 Just just the call out that sometimes these aren't
00:30:06.033 --> 00:30:06.567 generating.
00:30:07.337 --> 00:30:08.337 With the new.
00:30:10.457 --> 00:30:11.197 T fours.
00:30:11.767 --> 00:30:15.520 So part of the part of that may be that there is some stuff that
00:30:15.520 --> 00:30:18.695 that he mentioned where basically the the process with
00:30:18.695 --> 00:30:22.389 the new T fours which we need to document this because it'll be
00:30:22.389 --> 00:30:25.622 going into the next release branch pretty soon. But the
00:30:25.622 --> 00:30:26.257 process is.
00:30:27.837 --> 00:30:31.430 Make your schema change in the data model layer. Rebuild the
00:30:30.377 --> 00:30:30.677 Umm.
00:30:31.430 --> 00:30:35.317 only the data model project. Run the T4 that's there. Rebuild the
00:30:35.317 --> 00:30:38.791 entire solution and then run that for a second time and it
00:30:38.791 --> 00:30:42.325 will pick up any other changes that happened downstream and
00:30:42.325 --> 00:30:45.387 integrate them into the future runs of the T fours.
00:30:47.387 --> 00:30:47.817 So.
00:30:48.457 --> 00:30:51.575 It's it's one T4, but you do have to run it twice to make
00:30:49.227 --> 00:30:49.497 But.
00:30:51.575 --> 00:30:53.617 sure that it gets all of the changes.
00:30:54.657 --> 00:30:57.837 Yeah, I mean, I'm not 100% sure that I rebuilt it. I thought I
00:30:57.837 --> 00:31:00.007 did and I I definitely run ran them twice.
00:31:00.587 --> 00:31:04.347 Umm Perez instructions and it still wasn't.
00:31:05.057 --> 00:31:07.920 Didn't generate generate, but it's totally possible that I've
00:31:07.920 --> 00:31:09.397 missed one of those steps after.
00:31:11.337 --> 00:31:13.717 Just the initial T4 generation.
00:31:21.187 --> 00:31:23.037 And quick question that might be dumb.
00:31:24.237 --> 00:31:26.967 When running that data model T4.
00:31:27.687 --> 00:31:31.817 You do not have to build between running it twice or you do.
00:31:35.697 --> 00:31:36.517 I'm guessing you don't.
00:31:35.907 --> 00:31:36.667 I think you do.
00:31:37.347 --> 00:31:38.317 You do OK.
00:31:38.847 --> 00:31:39.127 Yeah.
00:31:39.207 --> 00:31:42.712 I think I did it just to be safe when I was doing that, but I
00:31:42.377 --> 00:31:42.767 Umm.
00:31:42.712 --> 00:31:44.917 wasn't sure if that's a waste of time.
00:31:43.987 --> 00:31:47.187 And you didn't have that issue with the mapping?
00:31:47.957 --> 00:31:48.527 Uh.
00:31:48.217 --> 00:31:51.612 I didn't, but I wasn't doing like a normal schema change or
00:31:51.612 --> 00:31:54.724 anything, so it wouldn't have applied to me. I guess I
00:31:53.277 --> 00:31:53.647 OK.
00:31:54.724 --> 00:31:56.817 wouldn't have ran into that anyways.
00:31:58.127 --> 00:31:58.447 OK.
00:32:20.077 --> 00:32:23.102 Great. Awesome. Well, it looks like we have some time here. Is
00:32:23.102 --> 00:32:25.886 there anything else or any other questions anybody has or
00:32:25.886 --> 00:32:28.623 anything they want to get covered? Now's a good time. If
00:32:28.623 --> 00:32:31.743 you have a question or stuck on anything. Want to pull something
00:32:31.743 --> 00:32:31.887 up?
00:32:37.237 --> 00:32:39.793 I could just go look at somebody's tasks and pick on
00:32:39.793 --> 00:32:40.227 somebody.
00:32:42.417 --> 00:32:46.945 And so I've got some Max work, some old project I started to
00:32:46.945 --> 00:32:48.207 look at it today.
00:32:48.727 --> 00:32:53.560 Ohh and when I pulled from QA all of a sudden like I had a
00:32:53.560 --> 00:32:54.707 bunch of like.
00:32:55.667 --> 00:33:00.456 SCSS files that had all been changed a bunch of CSS files
00:33:00.456 --> 00:33:05.492 like 10 files had been changed and showed changes in the git
00:33:05.492 --> 00:33:10.281 tracking like. As soon as I pulled the QA and I I'm gonna
00:33:10.281 --> 00:33:12.097 share my screen quick.
00:33:14.017 --> 00:33:14.647 I.
00:33:17.447 --> 00:33:21.057 Went to see I was not there.
00:33:22.547 --> 00:33:23.597 We see.
00:33:26.267 --> 00:33:28.647 It it says my scan in so.
00:33:29.707 --> 00:33:32.845 The advice that I took from Michael Perez was to unload the
00:33:32.845 --> 00:33:35.877 front end projects because I couldn't build the back end.
00:33:37.347 --> 00:33:38.547 If I load.
00:33:40.657 --> 00:33:43.517 The front end projects in Visual Studio.
00:33:47.007 --> 00:33:52.596 I get a build error on the storefront dot MVC and this is
00:33:52.596 --> 00:33:57.317 on Seth 2020 dot 4.8 with an angular storefront.
00:33:58.477 --> 00:33:59.887 So when I build this.
00:33:59.487 --> 00:34:03.193 If you're getting builder errors on the MVC one, honestly just
00:34:03.193 --> 00:34:06.898 unload the MVC one. It's not. You're not using it for anything
00:34:06.898 --> 00:34:07.427 normally.
00:34:08.187 --> 00:34:08.617 OK.
00:34:09.087 --> 00:34:12.047 There, it's for a project this old and for.
00:34:12.897 --> 00:34:16.092 A bug of this caliber? It's not really worth digging too much
00:34:16.092 --> 00:34:19.235 into why. If that's the only thing that's giving you errors,
00:34:19.235 --> 00:34:22.429 at least you could just remove that project from the solution
00:34:22.429 --> 00:34:25.417 altogether so nobody else has this issue and and move on.
00:34:25.367 --> 00:34:29.247 OK, I didn't know if it was being used or or not.
00:34:29.417 --> 00:34:34.272 Yeah, thankfully, thankfully, it's not that it. That would be
00:34:30.597 --> 00:34:31.707 Instantly used.
00:34:34.272 --> 00:34:38.970 if you deploy the storefront files separately. None of that
00:34:38.970 --> 00:34:42.337 MVC stuff is being used for most projects.
00:34:43.477 --> 00:34:47.373 If you're on 2021.1, it's not being used at all. Period. Full
00:34:47.373 --> 00:34:47.687 stop.
00:34:49.007 --> 00:34:53.561 2020.4 and older, a couple of projects use it and you'll know
00:34:53.561 --> 00:34:55.397 because it's nightmarish.
00:34:57.437 --> 00:35:01.808 See it built right there, but it wasn't. I don't know what I I
00:35:01.808 --> 00:35:05.970 didn't literally didn't do anything but unload the projects
00:35:05.497 --> 00:35:05.877 Umm.
00:35:05.970 --> 00:35:10.272 and now reload them and it's saying files are not missing but
00:35:10.272 --> 00:35:10.757 in the.
00:35:10.837 --> 00:35:18.574 A DNN file. This clarity dot CSS is not there. The SCSS file is
00:35:18.574 --> 00:35:23.047 there but the CSS file is not there.
00:35:21.387 --> 00:35:28.007 OK. Can you go to your self gulp config in your solution items?
00:35:28.627 --> 00:35:30.047 Yeah, I can.
00:35:33.177 --> 00:35:33.727 It's like 2.
00:35:35.287 --> 00:35:36.387 That'll be the ticket.
00:35:35.407 --> 00:35:37.337 Gotta love that gulp config.
00:35:37.357 --> 00:35:37.797 Yeah.
00:35:37.877 --> 00:35:38.497 Yeah.
00:35:38.617 --> 00:35:39.707 That'll be the ticket.
00:35:38.917 --> 00:35:41.811 This is something we don't really have to worry about. We
00:35:41.811 --> 00:35:44.855 we don't have to worry about this with react anymore because
00:35:42.637 --> 00:35:43.347 Anymore.
00:35:44.377 --> 00:35:44.877 Yeah.
00:35:44.855 --> 00:35:47.998 it's it's wired up, but I don't know. You have it, you have it
00:35:46.017 --> 00:35:46.647 Interesting.
00:35:46.147 --> 00:35:46.967 Oh yeah.
00:35:47.998 --> 00:35:51.092 there correctly. Wait, that's. Oh, wait. Clarity Converse, UI
00:35:48.057 --> 00:35:49.807 Yeah, I hear building ad.
00:35:50.137 --> 00:35:50.757 Ohh.
00:35:51.092 --> 00:35:53.137 skins. But you have 07 portals, I think.
00:35:53.437 --> 00:35:54.627 Ah.
00:35:53.677 --> 00:35:55.217 Yes, I do.
00:35:53.897 --> 00:35:54.517 That's old.
00:35:55.157 --> 00:35:58.527 OK. So that that folder path needs to be updated for all of
00:35:55.947 --> 00:35:56.327 Ah.
00:35:58.527 --> 00:36:01.727 those to be 07 portals, storefront skins, Max ecommerce.
00:36:02.047 --> 00:36:05.077 OK, so you go back to.
00:36:03.207 --> 00:36:03.537 Yeah.
00:36:04.697 --> 00:36:04.897 Nice.
00:36:06.317 --> 00:36:07.197 Sweetie.
00:36:09.237 --> 00:36:12.307 It's gonna be 07 storefront.
00:36:11.617 --> 00:36:14.404 You'll you'll update all three of them. So just, uh, if you
00:36:13.687 --> 00:36:15.067 Yeah. Ohh.
00:36:14.404 --> 00:36:17.005 well, if you you can like control like highlight one of
00:36:16.837 --> 00:36:17.747 Yeah.
00:36:17.005 --> 00:36:20.070 them and then control the if you like undo that one and then once
00:36:20.070 --> 00:36:22.067 you have highlighted just yeah that works.
00:36:22.687 --> 00:36:26.942 Control D select duplicate. Yeah, and then change them. Also
00:36:26.942 --> 00:36:28.197 be 07 dot portals.
00:36:30.347 --> 00:36:33.147 Uh slash storefront slash skins.
00:36:37.467 --> 00:36:37.667 Yeah.
00:36:39.487 --> 00:36:42.640 That ought to do it, and then you'll just have to rebuild the
00:36:42.640 --> 00:36:45.437 front end and back end or front end angular and admin.
00:36:46.107 --> 00:36:46.347 Does.
00:36:46.367 --> 00:36:47.087 Maybe admin?
00:36:46.427 --> 00:36:50.134 Matter. If it's lower case S or is it just gonna figure it out?
00:36:50.134 --> 00:36:50.887 I never know.
00:36:50.317 --> 00:36:55.107 I I would hope that it's not case sensitive, but I don't
00:36:55.107 --> 00:36:55.527 know.
00:36:55.587 --> 00:36:58.897 Just in well, no, I can't do it like that, just in case.
00:36:57.027 --> 00:36:57.437 Yeah.
00:36:59.547 --> 00:37:02.817 Yeah, the whole word skins and. But yeah, it works.
00:36:59.897 --> 00:37:00.937 You never know.
00:37:03.967 --> 00:37:07.681 Yeah, it could be done. The whole word scanned. Yeah, man, I
00:37:07.681 --> 00:37:11.274 don't use that enough. The control D stuff. I I get called
00:37:11.274 --> 00:37:13.587 out on it all the time for not using.
00:37:13.467 --> 00:37:16.559 It's a great habit to get into. It's something that you kind of
00:37:15.787 --> 00:37:17.037 I know and I just.
00:37:16.559 --> 00:37:19.264 like when you first learn it. You kind of have to force
00:37:19.264 --> 00:37:22.259 yourself to use it more than you need to, and then eventually
00:37:22.259 --> 00:37:24.287 it'll just start to become second nature.
00:37:25.097 --> 00:37:29.482 I need to I I was using it in Visual Studio, it's like Alt,
00:37:29.482 --> 00:37:34.159 Shift period. I think I need to put like a sticky note up on my
00:37:31.137 --> 00:37:32.397 Yeah. Shift alt. Yeah.
00:37:33.117 --> 00:37:36.637 Shift Alt period does the same thing in full Visual Studio that
00:37:34.159 --> 00:37:34.597 thing.
00:37:36.637 --> 00:37:38.067 Control D does in VS code.
00:37:47.447 --> 00:37:51.193 And we use GULP to build the storefront angular as well,
00:37:51.193 --> 00:37:51.587 right?
00:37:51.947 --> 00:37:55.772 Yep, still front angular and admin angular both. Uh, gold
00:37:55.772 --> 00:37:56.167 build.
00:37:58.297 --> 00:38:00.247 Has a call out and you'll run into it.
00:38:01.037 --> 00:38:04.587 If if you were working on React, you're gonna have to use NVM to
00:38:04.587 --> 00:38:07.317 switch to 11150 like you're doing, add and stuff.
00:38:05.957 --> 00:38:06.757 Yeah.
00:38:08.007 --> 00:38:08.517 Yeah.
00:38:09.647 --> 00:38:10.587 But yard ship?
00:38:15.057 --> 00:38:18.714 We'll have to bounce back and forth between the admin and
00:38:18.714 --> 00:38:22.623 reactor. It's like I've got it stapled. You know what I mean?
00:38:22.623 --> 00:38:26.532 Pretty much I I, I constantly switch back and forth, it seems
00:38:23.247 --> 00:38:23.597 Umm.
00:38:26.532 --> 00:38:26.847 like.
00:38:35.117 --> 00:38:38.196 And we can we can use Gulp watch too on the storefront, I'm
00:38:38.196 --> 00:38:38.657 guessing.
00:38:38.967 --> 00:38:39.277 Yep.
00:38:39.167 --> 00:38:42.385 Yeah, but not on the admin. That one was a. Yeah, well, can use
00:38:39.987 --> 00:38:40.407 OK.
00:38:40.207 --> 00:38:40.507 Yeah.
00:38:41.467 --> 00:38:42.357 Umm.
00:38:42.385 --> 00:38:45.552 it on the admin too, but that's that's admin. So unless you're
00:38:45.552 --> 00:38:46.457 caring about that.
00:38:47.607 --> 00:38:51.561 You'll switch to storefront here, and then you'll see your.
00:38:49.267 --> 00:38:52.117 Right. I was just gonna build them both just in case.
00:38:51.561 --> 00:38:52.747 Ohh yeah right on.
00:38:54.087 --> 00:38:57.925 Because I hadn't, like, I haven't loaded. Well, this is my
00:38:57.925 --> 00:39:00.267 first load up of the project after.
00:39:01.277 --> 00:39:01.617 Oh yeah.
00:39:02.187 --> 00:39:04.377 Setting it up right so you're setting the local.
00:39:07.247 --> 00:39:07.897 And have you ever?
00:39:07.257 --> 00:39:08.027 One little trick.
00:39:08.667 --> 00:39:09.217 Yeah, go ahead.
00:39:08.927 --> 00:39:09.657 I'll go ahead, sorry.
00:39:10.757 --> 00:39:11.327 No, you're good.
00:39:12.317 --> 00:39:16.031 I was going to say a little trick you can do to know if and
00:39:16.031 --> 00:39:19.683 this is this is like such a small time saver. So like it's
00:39:19.683 --> 00:39:23.521 really not worth sharing. But for me at least, the way I know
00:39:23.521 --> 00:39:26.987 for the GULP config is configured incorrectly. When you
00:39:26.987 --> 00:39:30.577 go to gulp build, it'll like say what skin it's building.
00:39:32.497 --> 00:39:33.517 For the CSS.
00:39:33.907 --> 00:39:34.457 Right here.
00:39:34.507 --> 00:39:34.987 So.
00:39:35.977 --> 00:39:36.917 Wait, no, that's the.
00:39:38.597 --> 00:39:41.085 Well, someone went wrong. It almost seems with yours. So what
00:39:38.717 --> 00:39:39.447 Or does it?
00:39:41.085 --> 00:39:41.687 happened there?
00:39:42.987 --> 00:39:46.358 Well, this is where I hit I didn't have and you go into the
00:39:46.177 --> 00:39:46.557 Ohh.
00:39:46.358 --> 00:39:47.257 Angel JS folder.
00:39:48.597 --> 00:39:51.902 I was just looking to see if it showed the skin that it was
00:39:51.902 --> 00:39:52.397 building.
00:39:54.687 --> 00:39:55.407 Umm.
00:39:55.807 --> 00:39:57.917 Well, maybe that was because that was in.
00:39:58.627 --> 00:40:01.097 So this is yeah this is admin, right?
00:40:01.987 --> 00:40:06.199 Yeah, I'm not sure if admin has skin stuff built in the same
00:40:03.297 --> 00:40:03.827 What did I?
00:40:04.957 --> 00:40:05.677 Did I build?
00:40:06.199 --> 00:40:09.997 way, but if you wanna expand this higher then you can.
00:40:10.847 --> 00:40:11.427 Yeah.
00:40:15.127 --> 00:40:18.249 Yeah. When you go to the store front for sure, for sure, at
00:40:18.249 --> 00:40:18.717 least in.
00:40:18.517 --> 00:40:19.247 Ohh.
00:40:19.417 --> 00:40:20.527 Current and yes.
00:40:21.017 --> 00:40:23.877 I guess I built the admin twice. I went into the admin twice.
00:40:24.587 --> 00:40:25.517 Nobody caught that.
00:40:27.197 --> 00:40:28.107 I figured.
00:40:30.317 --> 00:40:33.852 I wasn't sure. I I couldn't even see what's happening cause it so
00:40:33.852 --> 00:40:34.977 small it's be honest.
00:40:35.957 --> 00:40:37.517 That's why I asked you to make it bigger.
00:40:36.277 --> 00:40:39.975 I figured Jesse would have cost that for sure. OK, you're right
00:40:39.975 --> 00:40:40.957 here. Yeah. Yeah.
00:40:41.687 --> 00:40:42.747 I did say that right?
00:40:41.947 --> 00:40:42.467 OK.
00:40:46.087 --> 00:40:46.827 I think so.
00:40:46.887 --> 00:40:49.979 Sleazy. So that's how I tell if it's out of date without
00:40:48.957 --> 00:40:49.207 Yeah.
00:40:49.979 --> 00:40:50.847 searching files.
00:40:51.067 --> 00:40:53.837 That's what I was talking about. Being in the admin and stuff.
00:40:53.807 --> 00:40:55.687 Ohh yeah man.
00:40:54.777 --> 00:40:55.327 That's.
00:40:58.807 --> 00:41:01.697 You're just like, OK, I guess. I guess he knows what he's doing.
00:41:03.367 --> 00:41:06.087 Well, you said you would build an both, so I you know.
00:41:05.567 --> 00:41:05.997 Right.
00:41:07.267 --> 00:41:08.057 I thought it was.
00:41:10.617 --> 00:41:11.017 Alright.
00:41:16.057 --> 00:41:19.647 Jesse said. I I did. I did see it. Don't call me out.
00:41:18.987 --> 00:41:20.877 Yeah, yeah.
00:41:20.527 --> 00:41:21.417 That's exactly.
00:41:22.717 --> 00:41:23.607 That's what I was saying.
00:41:23.997 --> 00:41:27.067 Yeah, you just wanna picking it up.
00:41:25.727 --> 00:41:26.457 Ohh good.
00:41:27.527 --> 00:41:28.077 Yeah.
00:41:28.977 --> 00:41:29.697 OK, good.
00:41:31.577 --> 00:41:33.967 You see a fresh coat of paint here.
00:41:35.487 --> 00:41:35.897 No.
00:41:37.337 --> 00:41:41.224 I know of mine. New Years plans are gonna be. I'm gonna take a
00:41:41.224 --> 00:41:42.087 nice long nap.
00:41:44.057 --> 00:41:44.867 You know, like it's you.
00:41:45.747 --> 00:41:46.977 Sounds exciting, Garfield.
00:41:46.017 --> 00:41:46.847 So.
00:41:46.077 --> 00:41:46.657 The thing I.
00:41:46.787 --> 00:41:48.097 Ohh yeah.
00:41:49.607 --> 00:41:51.847 Yeah, that does sound exciting for her.
00:41:50.217 --> 00:41:53.147 They just slept like 12 hours on Christmas Day.
00:41:54.117 --> 00:41:56.467 Ohh yeah, that's the way I live man.
00:41:57.197 --> 00:42:00.596 Christmas Day. Christmas Day. Married. I slept until, like,
00:42:00.596 --> 00:42:03.995 one in the afternoon. We were like, what do we do now? Like
00:42:03.995 --> 00:42:05.467 nothing. And that's great.
00:42:07.317 --> 00:42:10.497 It still didn't build the clarity dot CSS.
00:42:11.197 --> 00:42:15.297 And you did a full on sculpt build and gulp build minify.
00:42:15.387 --> 00:42:16.127 Yeah.
00:42:17.127 --> 00:42:18.877 That weird? Umm.
00:42:19.767 --> 00:42:20.407 Yeah.
00:42:22.847 --> 00:42:23.437 Is it?
00:42:23.367 --> 00:42:26.386 And where you still don't, you don't have the thing yet. It
00:42:26.386 --> 00:42:28.347 still doesn't show up on your website.
00:42:29.297 --> 00:42:32.467 Yeah. And it's not, it's not in the, it's not in the folder.
00:42:29.467 --> 00:42:30.847 Yeah, it's still 404 ring.
00:42:31.427 --> 00:42:32.427 Do you have a?
00:42:34.617 --> 00:42:38.302 Skins Max. Is that a virtual directory or a real folder? If
00:42:38.302 --> 00:42:41.987 you copy pasted, it's going to be it's a virtual directory.
00:42:39.187 --> 00:42:40.037 The.
00:42:40.467 --> 00:42:41.547 That's the virtual directory, yeah.
00:42:41.747 --> 00:42:42.437 Yeah.
00:42:48.207 --> 00:42:53.165 And also Max's 2021.1 not 2020.4. So I'm wondering. I'm
00:42:48.767 --> 00:42:49.077 No.
00:42:53.165 --> 00:42:57.857 trying to think of maybe there were any other, yeah.
00:42:55.867 --> 00:42:56.397 Really.
00:42:58.007 --> 00:42:59.037 Is your path right?
00:42:59.097 --> 00:43:04.303 Cause 08 clarity commerce UI skins that was 2020.4 but 07
00:43:03.137 --> 00:43:03.447 Uh-huh.
00:43:04.303 --> 00:43:06.547 portals is 2021.1 and up.
00:43:07.707 --> 00:43:08.687 Yeah.
00:43:07.727 --> 00:43:11.436 Is your skin still like like the gulp config path? Was that
00:43:08.297 --> 00:43:08.977 The.
00:43:08.307 --> 00:43:08.947 Umm.
00:43:10.227 --> 00:43:11.497 So I'm wondering.
00:43:11.436 --> 00:43:11.807 right?
00:43:12.567 --> 00:43:16.717 Young the check. One thing in here real quick as well.
00:43:12.597 --> 00:43:13.247 I asked.
00:43:13.827 --> 00:43:14.817 Check that one more time.
00:43:15.607 --> 00:43:16.407 Uh.
00:43:15.717 --> 00:43:19.740 Max started as an older project and I think they were upgraded
00:43:19.740 --> 00:43:21.017 sometime in between.
00:43:20.207 --> 00:43:23.095 They yeah, they had to be upgraded. Some point there,
00:43:23.095 --> 00:43:24.057 definitely 21 now.
00:43:25.167 --> 00:43:28.210 You know, there wasn't too much moving on, Mac, so it seemed
00:43:27.467 --> 00:43:30.747 OK, I think I know what I think. I know what the issue is now.
00:43:28.210 --> 00:43:29.057 like the perfect.
00:43:31.387 --> 00:43:31.647 Umm.
00:43:32.787 --> 00:43:37.727 Umm, so this full path replace 07 portals with two more dot
00:43:37.727 --> 00:43:39.867 dots on all three of them.
00:43:39.777 --> 00:43:41.027 Uh, yeah.
00:43:40.187 --> 00:43:41.707 Yeah, that's the ticket.
00:43:40.837 --> 00:43:44.857 So so it's dot dot slash dot dot slash storefront skins.
00:43:43.937 --> 00:43:44.237 Yeah.
00:43:45.017 --> 00:43:50.027 Because it loads this from the GULP file. That's in, yeah.
00:43:46.487 --> 00:43:46.877 OK.
00:43:47.497 --> 00:43:51.316 Yeah, that's that's what was my suspicion, as was checking. And
00:43:51.316 --> 00:43:55.076 so, yeah, so UM, control D and then just dot, dot and then and
00:43:51.677 --> 00:43:53.607 Yeah, that's what I have as well. That's true.
00:43:54.777 --> 00:43:55.207 It's.
00:43:55.076 --> 00:43:56.567 then build one more time.
00:43:56.717 --> 00:44:00.921 Yeah, because the path is not relative to where that file is.
00:44:00.157 --> 00:44:02.157 Yeah, it's relative to where the build runs from.
00:44:00.921 --> 00:44:04.718 It's relative to where it's loaded. Yeah, which is, you
00:44:04.718 --> 00:44:06.277 know, 7 portals and JS.
00:44:06.737 --> 00:44:08.167 Yes, store fronting JS.
00:44:08.417 --> 00:44:09.107 Uh-huh, right.
00:44:08.917 --> 00:44:11.607 So it goes up to to get to the 07 portals folder, then goes
00:44:11.607 --> 00:44:14.342 back into storefront and it does it up to and then back into
00:44:14.342 --> 00:44:17.077 storefront instead of just up one and then just skin so that
00:44:17.077 --> 00:44:18.467 it works for the admin as well.
00:44:19.187 --> 00:44:19.727 Yeah.
00:44:19.267 --> 00:44:19.787 Yeah.
00:44:20.697 --> 00:44:22.927 So that should hopefully do it.
00:44:25.777 --> 00:44:29.053 Yeah, that's what I have. I just. I was now looking around
00:44:29.053 --> 00:44:30.107 see what was wrong.
00:44:30.687 --> 00:44:31.187 Hmm.
00:44:32.837 --> 00:44:33.387 Boy howdy.
00:44:35.747 --> 00:44:36.567 There we go.
00:44:36.977 --> 00:44:37.827 Looks like a website.
00:44:38.347 --> 00:44:39.457 Yeah, we're getting there.
00:44:38.537 --> 00:44:39.317 Noise.
00:44:40.917 --> 00:44:41.247 Nice.
00:44:41.907 --> 00:44:45.391 I just need the. I need to go on QA and get the the pictures just
00:44:45.391 --> 00:44:47.027 so I get the full effect right.
00:44:49.197 --> 00:44:50.807 But Hi 5 or.
00:44:51.927 --> 00:44:52.397 Yeah.
00:44:52.127 --> 00:44:52.757 Question.
00:44:54.167 --> 00:44:55.747 That's a high five, yeah.
00:44:54.857 --> 00:44:56.507 Got some serious lag over here.
00:44:57.647 --> 00:45:00.160 Keep trying to turn it off, but it's taking like two or three
00:45:00.160 --> 00:45:01.457 seconds after I click it and it.
00:45:02.807 --> 00:45:05.737 I will thanks guys for helping me figure that out.
00:45:06.837 --> 00:45:07.387 Totally man.
00:45:07.097 --> 00:45:08.217 No problem.
00:45:09.097 --> 00:45:11.997 Jeff stuff coming in, what's going on? You just delayed?
00:45:14.457 --> 00:45:16.197 Probably still spinning up the app pools.
00:45:16.587 --> 00:45:17.007 Yeah.
00:45:18.317 --> 00:45:21.271 I do have a question though, how do how do you make a schema
00:45:21.271 --> 00:45:22.287 change on a pipeline?
00:45:23.847 --> 00:45:27.501 You have to point your local database like your local to the
00:45:27.501 --> 00:45:29.777 QA database from the migration, yeah.
00:45:27.517 --> 00:45:28.587 OK, I gotcha.
00:45:30.087 --> 00:45:30.797 Yeah.
00:45:30.627 --> 00:45:30.917 OK.
00:45:31.237 --> 00:45:32.667 Yeah, hook up with the VPN.
00:45:33.047 --> 00:45:36.096 No. Yeah, we don't have an automated way to update it
00:45:36.096 --> 00:45:38.637 database like that. It's got it just be you.
00:45:37.197 --> 00:45:41.310 So we actually we actually do have that and it will be in
00:45:41.310 --> 00:45:45.211 2022.4 migrations will automatically run when the site
00:45:43.037 --> 00:45:43.637 Yeah.
00:45:45.211 --> 00:45:45.707 starts.
00:45:46.527 --> 00:45:51.687 Ohh yeah, I saw that it's in the global dot ASX, yeah.
00:45:47.607 --> 00:45:48.127 Nice.
00:45:50.657 --> 00:45:55.018 Yeah. Yeah. So that will take care of it in the future for
00:45:55.018 --> 00:45:57.087 projects that start in 2023.
00:45:57.747 --> 00:46:00.626 But yeah, for current projects it's just you gotta you gotta
00:46:00.626 --> 00:46:03.127 point it at the thingy and do the thing and whatnot.
00:46:04.127 --> 00:46:07.625 Yeah. So, Michael, it it, it still isn't loading in and I'm
00:46:07.625 --> 00:46:08.907 not getting, I'm just.
00:46:07.957 --> 00:46:11.767 Go to your network tab. OK well, it made calls.
00:46:08.477 --> 00:46:08.947 Umm.
00:46:09.627 --> 00:46:10.477 Just Jason.
00:46:12.597 --> 00:46:15.430 Uh, you're missing translations. That's probably. I'm guessing
00:46:12.757 --> 00:46:13.147 Yeah.
00:46:15.027 --> 00:46:17.127 Yeah. And there's a translate.
00:46:15.167 --> 00:46:16.887 Ah, yeah, OK.
00:46:15.430 --> 00:46:18.218 there's something that's like waiting on translations to load
00:46:15.537 --> 00:46:15.897 Umm.
00:46:18.077 --> 00:46:18.897 Yeah. OK.
00:46:18.218 --> 00:46:18.937 before it, yeah.
00:46:18.297 --> 00:46:20.317 Translate cloak. Uh-huh.
00:46:20.527 --> 00:46:21.027 Yeah.
00:46:20.707 --> 00:46:21.287 Gotcha.
00:46:22.107 --> 00:46:27.447 Angular JS Translate quote cloak and it'll there you have it.
00:46:22.397 --> 00:46:22.837 Alright.
00:46:26.077 --> 00:46:26.597 Yeah.
00:46:28.327 --> 00:46:29.587 There you go. Cool.
00:46:31.077 --> 00:46:31.767 Anybody else?
00:46:42.857 --> 00:46:45.657 It's great. Run those bad boys.
00:46:53.637 --> 00:46:58.130 I had a thought and then I lost it because whoever's above me
00:46:58.130 --> 00:46:58.347 is.
00:46:59.127 --> 00:47:02.137 Hammering something into the floor for some reason so.
00:47:02.077 --> 00:47:02.447 Yeah.
00:47:02.437 --> 00:47:03.277 Ohh man.
00:47:04.327 --> 00:47:05.637 My neighbors do that too.
00:47:04.747 --> 00:47:05.417 Plastic.
00:47:07.317 --> 00:47:08.937 Got gotta love people.
00:47:09.907 --> 00:47:12.409 Building furniture every day, somehow I'm not really sure
00:47:12.409 --> 00:47:14.737 what's going on up there, but it doesn't sound legal.
00:47:14.987 --> 00:47:18.243 Yeah, I thought somebody was doing something, you know, like
00:47:17.557 --> 00:47:19.407 How much furniture can you make?
00:47:18.243 --> 00:47:19.577 jumping around and stuff.
00:47:19.757 --> 00:47:22.263 I thought somebody was banging on my door this morning and it
00:47:22.263 --> 00:47:24.889 was just my cat trying to open a cabinet in the kitchen, but she
00:47:24.889 --> 00:47:27.354 wasn't strong enough to pull it all the way so she'd pull it
00:47:27.354 --> 00:47:29.697 like a few inches and then let go and it would slam shut.
00:47:29.327 --> 00:47:30.557 Slam it shut.
00:47:30.337 --> 00:47:31.147 Ah.
00:47:30.477 --> 00:47:30.847 Yeah.
00:47:31.597 --> 00:47:34.229 As like I was sitting there and I just kept hearing this thump,
00:47:34.229 --> 00:47:36.697 and then a few seconds later, another thump and I was like,
00:47:36.697 --> 00:47:38.177 what the hell is going on out here?
00:47:38.447 --> 00:47:40.597 Viego cuss somebody at the front door.
00:47:38.597 --> 00:47:38.877 Yeah.
00:47:40.637 --> 00:47:44.094 Yeah. It's like it's about to go figure out why the mailman was
00:47:44.094 --> 00:47:47.011 so adamant that I picked this package up right now or
00:47:46.927 --> 00:47:48.547 Then you punished that Kitty.
00:47:47.011 --> 00:47:47.497 whatever.
00:47:49.607 --> 00:47:52.143 I while I walked out into the kitchen and then I saw her run
00:47:52.143 --> 00:47:54.762 away from the kitchen because she knew she was doing something
00:47:54.762 --> 00:47:56.757 bad. And then when I realized what it was like.
00:47:57.567 --> 00:47:59.707 I'm too lazy to punish the cat and go back to sleep.
00:48:09.787 --> 00:48:13.157 Yes, any other fun, fun things to tackle or no.
00:48:14.397 --> 00:48:14.997 Maybe not.
00:48:18.937 --> 00:48:21.667 Trails or tip tribulations or whatever.
00:48:22.657 --> 00:48:22.987 For.
00:48:24.147 --> 00:48:25.407 That's all I had.
00:48:26.847 --> 00:48:29.903 Max. Well, I've got 1/1 hour ticket for Tasco. I'm just
00:48:29.903 --> 00:48:33.177 waiting on clarification for Mickey. Exactly what she wants
00:48:33.177 --> 00:48:36.451 me to change on it, and then that that's off the board. And
00:48:36.451 --> 00:48:39.780 then this Max stuffs all I've got left for the Sprint. Well,
00:48:39.780 --> 00:48:42.618 no, that's not entirely accurate. I've got Branford
00:48:42.618 --> 00:48:43.927 group stuff where we're.
00:48:45.257 --> 00:48:48.277 Going to your Chris Reddick and I did a.
00:48:49.447 --> 00:48:54.479 Like a little, uh, analysis of their bidding site yesterday and
00:48:54.479 --> 00:48:55.737 narrowed down a.
00:48:57.217 --> 00:49:01.110 A network call where it's fetching the page nated results
00:49:01.110 --> 00:49:05.203 for the catalog was taking like 5 seconds to complete. Every
00:49:05.203 --> 00:49:09.364 time you switch pages in their catalog. So if you bounce from
00:49:09.364 --> 00:49:13.323 Page 1 to page 2, it takes 5 seconds to load that page and
00:49:13.323 --> 00:49:17.685 then five to load the next page. And yeah, they're wanting us to
00:49:14.087 --> 00:49:14.487 Umm.
00:49:15.567 --> 00:49:17.857 Jeez, why is it so slow?
00:49:17.685 --> 00:49:18.557 improve that.
00:49:19.757 --> 00:49:25.748 I'll show you, man. Like it's it is. It's a fluster clock in
00:49:25.748 --> 00:49:30.757 there. You know what I mean? Like the code base is
00:49:30.757 --> 00:49:35.667 ridiculous. Ohly. They it's ASP .net 3.1 for the.
00:49:38.867 --> 00:49:42.595 Back in the front end is in Angular 10 and like the way that
00:49:42.595 --> 00:49:45.894 they go about fetching the paginator results from the
00:49:45.894 --> 00:49:49.500 database, I gotta connect to the VPN. I'm gonna drop for a
00:49:49.500 --> 00:49:49.927 second.
00:49:56.377 --> 00:50:00.855 Yeah, the way they go about fetching the page and made it
00:50:00.855 --> 00:50:05.874 results from the database, they pull them out and then they they
00:50:05.874 --> 00:50:08.807 use a stored procedures to catch the.
00:50:09.927 --> 00:50:12.417 Uh stuff from the database and.
00:50:13.747 --> 00:50:16.047 It's pretty wild. I'll show you just a second.
00:50:17.317 --> 00:50:19.957 I can remember my 30 password.
00:50:21.247 --> 00:50:24.094 Three guys able to narrow down why it was taken 5 seconds.
00:50:24.094 --> 00:50:25.637 There's just a really bad query.
00:50:26.497 --> 00:50:27.717 It's it's.
00:50:26.557 --> 00:50:30.017 It's just all in this. Yeah, it's all in that method or in
00:50:30.017 --> 00:50:32.597 that class and method. I don't really know.
00:50:31.567 --> 00:50:35.149 From what I yeah, from what I remember looking at the code,
00:50:35.149 --> 00:50:38.731 it's not just one bad query, it's it's a lot of bad queries
00:50:38.731 --> 00:50:41.357 and a lot of bad usage of entity framework.
00:50:42.147 --> 00:50:46.907 Umm, like they they query for the same thing a dozen times.
00:50:42.157 --> 00:50:42.477 Umm.
00:50:42.927 --> 00:50:43.407 Yeah.
00:50:48.257 --> 00:50:51.947 And when we were working on improving the bidding logic.
00:51:15.207 --> 00:51:15.767 OK.
00:51:15.817 --> 00:51:18.133 Ways to receive something that should have just been one query
00:51:18.133 --> 00:51:18.757 with a few joins.
00:51:19.547 --> 00:51:23.438 Umm, so it it's it's a lot of just really poor use of entity
00:51:23.438 --> 00:51:24.777 framework in general.
00:51:26.857 --> 00:51:28.147 Speaking of.
00:51:27.277 --> 00:51:29.097 I've refactored a ton of it.
00:51:29.747 --> 00:51:30.147 Yeah.
00:51:30.007 --> 00:51:33.495 Generally, use of entity framework. I did actually I
00:51:33.495 --> 00:51:37.247 could I could use this time to validate an article I was
00:51:37.247 --> 00:51:38.497 volentold to write.
00:51:41.697 --> 00:51:45.064 If we were delayed, take take like 13 seconds and there's a
00:51:45.064 --> 00:51:48.486 cool trick in there for anyone who's curious as to how to do
00:51:45.317 --> 00:51:45.707 Yeah.
00:51:48.486 --> 00:51:49.047 something.
00:51:51.687 --> 00:51:53.377 So it won't take much time at all.
00:51:54.807 --> 00:51:57.369 Basically the this article is just kind of trying to show
00:51:57.369 --> 00:51:57.987 people how to.
00:51:58.687 --> 00:52:01.972 Right stuff that's performant in terms of entity framework
00:52:01.972 --> 00:52:05.368 queries. So and like practices within safe. So obviously you
00:52:05.368 --> 00:52:08.653 should pretty much always be using filter by active unless
00:52:08.653 --> 00:52:10.657 you know why you're not doing that.
00:52:11.437 --> 00:52:15.069 As no tracking if you're not using the results of the query
00:52:15.069 --> 00:52:16.037 to do an update.
00:52:17.787 --> 00:52:19.997 Umm good where clauses?
00:52:18.577 --> 00:52:21.767 Or fetching the whole or fetching the whole record right?
00:52:18.977 --> 00:52:22.628 Well, yeah. I didn't say you don't have to. Yeah, you don't
00:52:22.628 --> 00:52:26.401 have to use as no tracking if the return type of the query is
00:52:24.247 --> 00:52:24.557 Yeah.
00:52:26.401 --> 00:52:27.557 not an entity type.
00:52:27.967 --> 00:52:31.669 But I will say, and I'm just putting this out there, this is
00:52:31.669 --> 00:52:35.674 a fair warning. I know that, but JG will still leave a comment on
00:52:35.674 --> 00:52:37.797 your stuff sometimes, so I'm just.
00:52:37.047 --> 00:52:39.127 Yes, that is correct.
00:52:39.337 --> 00:52:41.682 So that's why I just didn't even bother mentioning it because I
00:52:41.682 --> 00:52:43.477 don't want everyone have to go through the pain.
00:52:44.297 --> 00:52:47.861 So, but that is true. So obviously wear claws, you know,
00:52:47.861 --> 00:52:51.924 filter it down. Like if you only if you know you only need stuff
00:52:51.924 --> 00:52:55.550 that has a balance due above 0 whatever put that in there
00:52:55.550 --> 00:52:59.364 obviously like only select what you need. I mean I feel like
00:52:59.364 --> 00:53:03.177 that's obviously it's pretty self-explanatory you know don't
00:53:02.067 --> 00:53:05.789 Yeah, another fun fact. I don't. I don't know if you have this
00:53:03.177 --> 00:53:04.177 need the entire.
00:53:05.789 --> 00:53:09.216 one in there, but this one's a really interesting one. Be
00:53:08.187 --> 00:53:08.427 Yep.
00:53:09.216 --> 00:53:12.643 judicious about where you use single or deep, like single
00:53:12.643 --> 00:53:16.365 versus first or default. Only. Ever use single in places where
00:53:16.365 --> 00:53:18.137 it is a full on genuine error.
00:53:19.677 --> 00:53:23.795 If there's more than one thing that matches and there's no way
00:53:20.227 --> 00:53:21.227 Nothing comes back.
00:53:23.795 --> 00:53:27.324 because single in LINQ to entities actually returns 2
00:53:27.324 --> 00:53:27.847 results.
00:53:28.927 --> 00:53:31.725 Because otherwise, how would it know if there was more than one
00:53:31.725 --> 00:53:34.304 result that matched your query so it returns the first two
00:53:34.304 --> 00:53:35.877 things that match, and if the list?
00:53:36.597 --> 00:53:40.089 The If the result of the query is more than one item then it
00:53:40.089 --> 00:53:43.524 throws your exception. That single is known to throw. So be
00:53:43.524 --> 00:53:46.959 judicious about using it, not that it's a bad thing most of
00:53:46.959 --> 00:53:49.935 the time it doesn't really matter. The overhead for
00:53:49.935 --> 00:53:53.313 returning one thing versus 2 is generally not much, but if
00:53:53.313 --> 00:53:55.087 you're returning a lot of data.
00:53:56.127 --> 00:53:59.457 Like you have a very large select statement like a multi
00:53:59.457 --> 00:54:02.962 level select statement. A single may actually be noticeably
00:54:02.962 --> 00:54:06.643 slower than a first or default. So just know that you may only
00:54:06.377 --> 00:54:06.907 Umm.
00:54:06.643 --> 00:54:09.972 be expecting you may only be desiring 1 output from your
00:54:09.972 --> 00:54:13.653 query, but you should only use single in the scenario where it
00:54:13.653 --> 00:54:17.216 is a full on error case. If the database has two things that
00:54:17.216 --> 00:54:20.896 match this filter, or if it's just like Oh yeah, I don't care.
00:54:20.896 --> 00:54:23.817 I just need one and I've filtered it down to one.
00:54:24.517 --> 00:54:27.047 Then use first or default for better performance.
00:54:27.727 --> 00:54:30.870 OK. Yeah. I didn't include that, but that's a good one. I mean, I
00:54:30.870 --> 00:54:33.441 usually just use first or default anyways most of the
00:54:32.337 --> 00:54:32.627 Yeah.
00:54:33.441 --> 00:54:33.917 time, but.
00:54:34.487 --> 00:54:37.933 Yeah, places where it makes sense to use singular default
00:54:34.797 --> 00:54:35.667 That is a good one.
00:54:37.933 --> 00:54:41.261 would be like if you're filtering by ID, just use first
00:54:40.727 --> 00:54:41.097 Umm.
00:54:41.261 --> 00:54:44.826 or default because that's like the database will assure you
00:54:44.826 --> 00:54:48.569 like it is if the database has two things with the same ID. We
00:54:48.569 --> 00:54:51.777 have way bigger problems than whatever code we wrote.
00:54:51.297 --> 00:54:51.577 Because.
00:54:52.227 --> 00:54:52.877 Yeah.
00:54:53.117 --> 00:54:56.231 So just use first or default if you're doing a filter by ID,
00:54:56.231 --> 00:54:59.447 it's it's not worth asserting that the database is functioning
00:54:59.447 --> 00:55:02.407 as a database. We we should. We should hopefully make the
00:55:02.407 --> 00:55:03.887 assumption that it just will.
00:55:05.287 --> 00:55:08.624 But if you're if you're doing something where it's like a
00:55:05.807 --> 00:55:06.127 Yep.
00:55:08.624 --> 00:55:12.190 table where there should only ever be one record that matches
00:55:12.190 --> 00:55:15.756 a specific user ID, but that's not enforced by like a like an
00:55:15.756 --> 00:55:19.265 index or constraint or anything on the table, then yeah, you
00:55:19.265 --> 00:55:22.831 should probably use single just to make sure that no bad data
00:55:22.831 --> 00:55:25.017 has been inserted into the table. So.
00:55:25.657 --> 00:55:28.689 This will probably only be useful if the front Enders end
00:55:28.689 --> 00:55:30.727 up writing any framework queries, but.
00:55:31.517 --> 00:55:31.987 Uh.
00:55:33.337 --> 00:55:36.375 When you're when you're doing your new up, don't, don't. Don't
00:55:36.375 --> 00:55:39.317 do it to the model because it's gonna throw a link to entity
00:55:39.317 --> 00:55:41.487 error thingy, blah blah blah blah blah. But.
00:55:42.397 --> 00:55:46.135 That's a it's a neat little one if you're brand new and then
00:55:46.135 --> 00:55:49.935 another cool one is deferred execution. So like I'll use this
00:55:49.935 --> 00:55:53.489 if I'm batch loading stuff. So if anyone's ever used like
00:55:53.489 --> 00:55:55.817 filter by ID's some more than one ID.
00:55:57.177 --> 00:56:01.046 Once you get into the hundreds of ID's range, it's a good idea
00:56:01.046 --> 00:56:04.793 if you if it's possible to get back like send a request with
00:56:04.793 --> 00:56:08.416 more than X amount, it's a good idea to like do some batch
00:56:08.416 --> 00:56:08.907 loading.
00:56:09.657 --> 00:56:12.309 And you can do deferred execution of a query so you can
00:56:12.309 --> 00:56:13.587 write all your query logic.
00:56:14.327 --> 00:56:14.677 Right.
00:56:15.417 --> 00:56:19.270 And then you can call individual batches of ID for example. So
00:56:19.270 --> 00:56:23.124 that's what this goes over. So that's a cool little one that's
00:56:23.124 --> 00:56:26.977 used in payhub for like invoice loading or or paying stuff and
00:56:26.977 --> 00:56:30.708 blah blah blah. Whatever. You have hundreds of records going
00:56:28.157 --> 00:56:28.467 Yep.
00:56:30.708 --> 00:56:31.747 at the same time.
00:56:30.907 --> 00:56:33.327 Another very interesting thing looking at that specific snippet
00:56:33.327 --> 00:56:35.558 of code you have there that I want to call out while we're
00:56:35.558 --> 00:56:37.827 looking at it, can you zoom in just a hair, make the text a
00:56:37.827 --> 00:56:38.507 little bit bigger?
00:56:38.547 --> 00:56:39.387 Oh yeah, sure.
00:56:40.037 --> 00:56:43.734 OK. Perfect. Umm, so you guys could see where it says base
00:56:43.734 --> 00:56:47.743 query equals context dot sales, invoices dot blah blah blah. OK
00:56:47.743 --> 00:56:49.497 so ignoring everything else.
00:56:51.807 --> 00:56:55.428 That looks like a normal link query, but it's not actually
00:56:55.428 --> 00:56:59.294 returning data. You can think of everything until the two list
00:56:59.294 --> 00:57:03.161 async toward the bottom of this as just being a builder of the
00:57:03.161 --> 00:57:07.088 query. So what we're saying is we're building a query that says
00:57:07.088 --> 00:57:11.139 when this runs, I want to filter by active and filter by balance,
00:57:11.139 --> 00:57:15.067 do greater than zero, and filter by status key equals. Not this
00:57:15.067 --> 00:57:18.933 or this and et cetera. This is not actually running the query.
00:57:18.933 --> 00:57:21.817 All we're doing is building up the components.
00:57:21.887 --> 00:57:22.617 Of the query.
00:57:24.137 --> 00:57:28.397 With linked to entities, the thing that actually executes the
00:57:28.397 --> 00:57:32.520 query is the to list async or first or default or single or
00:57:32.520 --> 00:57:36.367 first or single or default. All those things that like.
00:57:37.087 --> 00:57:41.223 Actually like return user result or kind of quantify it. That's
00:57:41.223 --> 00:57:45.294 the part that will actually run the result. So what you can do
00:57:45.294 --> 00:57:49.365 and what this code is doing is it builds a base query that can
00:57:49.365 --> 00:57:53.501 be reused for other things. So if you know that you're going to
00:57:53.501 --> 00:57:54.147 basically.
00:57:54.257 --> 00:57:57.072 You know, for every batch of invoices that this code is
00:57:57.072 --> 00:58:00.189 loading, it always wants to be as no tracking it always wants
00:58:00.189 --> 00:58:03.154 to filter by active and it always wants the ones where the
00:58:03.154 --> 00:58:06.220 balance due is greater than this and et cetera and blah blah
00:58:06.220 --> 00:58:09.286 blah, right? We don't wanna have to repeat that same code on
00:58:09.286 --> 00:58:11.347 every one of them. That's just annoying.
00:58:12.747 --> 00:58:17.010 Every place that we wanna use that query, so instead of
00:58:17.010 --> 00:58:21.881 duplicating that code, you can write the base query and do work
00:58:21.881 --> 00:58:26.829 with it. Another interesting way to make use of that would be if
00:58:26.829 --> 00:58:31.548 you have a piece of code or like a piece of common query data
00:58:31.548 --> 00:58:35.963 that's complex in a workflow. You can write a method that
00:58:35.963 --> 00:58:39.007 returns iqueue able of the entity type.
00:58:40.087 --> 00:58:43.262 And you'll want to pass in the context as you don't want to
00:58:43.262 --> 00:58:46.753 use. You don't want to spin up a context in the method and return
00:58:46.753 --> 00:58:49.610 a query that hasn't been enumerated yet. So basically
00:58:49.610 --> 00:58:52.837 you'd have a method like. It's called like get base query or
00:58:52.837 --> 00:58:55.958 something, and you pass in a context and it will return to
00:58:55.958 --> 00:58:59.027 you a premade query ready to enumerate that you can apply
00:58:59.027 --> 00:59:02.307 additional filters and selects to, but it might handle all of
00:59:02.307 --> 00:59:05.375 the basic annoying stuff that you don't have to duplicate
00:59:05.375 --> 00:59:05.957 everywhere.
00:59:07.047 --> 00:59:10.230 So I can't. I did that on a project. I think. I think it
00:59:07.907 --> 00:59:08.367 Yep.
00:59:10.230 --> 00:59:13.469 might have been row on the scheduling querying stuff, but
00:59:13.469 --> 00:59:16.317 that can be really useful for places where you're.
00:59:17.207 --> 00:59:20.606 Writing the same like where X dot account ID equals this and X
00:59:20.606 --> 00:59:23.788 dot status is not this and etcetera. If you're gonna write
00:59:23.788 --> 00:59:27.025 that in 17 different workflow methods, you can just write a
00:59:27.025 --> 00:59:30.477 method that generates that base query for you, and then you can
00:59:30.477 --> 00:59:33.767 consume that, apply additional filters and selects and stuff
00:59:33.767 --> 00:59:37.327 like that, and then enumerate it yourself. And that's a lot more.
00:59:36.767 --> 00:59:37.237 Yeah.
00:59:39.047 --> 00:59:41.037 It just makes code a lot easier to read.
00:59:39.217 --> 00:59:40.007 Theoretically.
00:59:41.367 --> 00:59:44.937 Yeah, we have a whole lot of that in. Yeah, I'm sorry.
00:59:42.247 --> 00:59:43.347 They're a lot easier just being.
00:59:45.487 --> 00:59:49.157 Now you're good. And then, yeah, I think, Jesse, what you were
00:59:49.157 --> 00:59:52.884 talking about is probably like the the on model or like the the
00:59:52.884 --> 00:59:55.097 the model filters custom or whatever.
00:59:55.387 --> 00:59:57.337 Yeah, we have a ton of these, yeah.
00:59:57.547 --> 01:00:00.927 In the workflow layer, yeah. So you can actually hook into.
01:00:01.887 --> 01:00:04.997 The uh the search endpoints, so like the.
01:00:05.857 --> 01:00:07.997 The normal bulk get and points.
01:00:08.737 --> 01:00:12.132 Uh that get T4 generated. You can actually hook into the
01:00:12.132 --> 01:00:15.587 filtering process and this is how you add your own custom
01:00:15.587 --> 01:00:16.837 filters is you add a.
01:00:17.487 --> 01:00:21.611 Uh, you add your property onto the search model and the isearch
01:00:21.611 --> 01:00:25.669 model, and then in the workflow for that type there will be a.
01:00:25.669 --> 01:00:29.277 It's like model filters, custom or something like that.
01:00:31.157 --> 01:00:34.752 It's a method you override and it receives an I queryable of
01:00:34.752 --> 01:00:38.051 the type and returns an I queryable of the type, and in
01:00:38.051 --> 01:00:41.763 that method you can just return your query with any additional
01:00:41.763 --> 01:00:45.357 custom like dot where or filter by whatever that you want to
01:00:45.357 --> 01:00:49.128 apply to all of them that come in based on the search model. So
01:00:49.128 --> 01:00:52.782 you can then create your own custom filters and the front end
01:00:52.782 --> 01:00:56.199 can pass in and say you want to get products ordered by a
01:00:56.199 --> 01:00:59.027 specific user. I don't know why you would, but.
01:00:59.807 --> 01:01:03.452 But you could create an ordered by user ID like nullable int on
01:01:03.452 --> 01:01:06.983 the search model and then you could create. You could make it
01:01:06.983 --> 01:01:10.172 so that if the front end ever passes that in on the get
01:01:10.172 --> 01:01:11.197 products endpoint.
01:01:12.007 --> 01:01:15.390 Umm. Then you then all of that would automatically be used. You
01:01:15.390 --> 01:01:18.826 wouldn't have to create a custom endpoint that's called like Git
01:01:18.826 --> 01:01:21.945 products ordered by user, and then write that entire query
01:01:21.945 --> 01:01:25.223 yourself. You could use the Git products endpoint that exists
01:01:25.223 --> 01:01:28.500 already and build that into the filtering path, and that uses
01:01:28.500 --> 01:01:31.037 the same thing of passing inquery ables around.
01:01:31.847 --> 01:01:32.167 Yep.
01:01:32.717 --> 01:01:36.124 And any place you're passing I queryable is a is a database
01:01:36.124 --> 01:01:39.418 query that has not actually been run yet. It's just. It's
01:01:39.418 --> 01:01:40.667 basically being built.
01:01:40.757 --> 01:01:41.287 Umm.
01:01:42.677 --> 01:01:46.655 So that's a good way to know if you've if you've trained
01:01:46.655 --> 01:01:50.703 translated from from database land to in memory is if the
01:01:50.703 --> 01:01:54.681 return type of something is I queryable, you're still in
01:01:54.681 --> 01:01:59.008 database land, and with all the ups and downs that comes with
01:01:59.008 --> 01:02:03.125 UPS in terms of performance downs, in terms of what do you
01:02:03.125 --> 01:02:05.707 mean, I can't call that method here.
01:02:07.817 --> 01:02:11.396 Yeah, I was gonna say it really simple example that that I took
01:02:11.396 --> 01:02:14.415 advantage of somewhere. I forget. I think it was like
01:02:14.415 --> 01:02:17.602 there was like a a querying workflow or something and it
01:02:17.602 --> 01:02:21.180 just wasn't querying stuff for whatever reason the way I wanted
01:02:21.180 --> 01:02:24.479 it to. And I wanted to do something where, hey, I wanna do
01:02:24.479 --> 01:02:28.001 a where statement like this if this front end variable is like
01:02:28.001 --> 01:02:31.188 this or this and that's a perfect really, really, really
01:02:31.188 --> 01:02:34.654 simple example of like if this then just add the where to the
01:02:34.654 --> 01:02:36.387 base query and then ask for it.
01:02:36.487 --> 01:02:37.827 Do the two list or whatever.
01:02:38.557 --> 01:02:40.447 And configure 08 so.
01:02:41.357 --> 01:02:43.777 That's a really simplified version, but yeah.
01:02:44.567 --> 01:02:48.881 And then the very last last thing is batch updates. Now I
01:02:48.881 --> 01:02:52.897 hope no one has to do this, but I did for Payhub and.
01:02:52.267 --> 01:02:52.577 Umm.
01:02:54.417 --> 01:02:57.496 If you do, if you do want to do batch, so for example, I'm
01:02:57.496 --> 01:03:00.940 guessing most of the time people do an update, you're getting the
01:03:00.940 --> 01:03:03.967 whole entity and then you're changing properties and just
01:03:03.967 --> 01:03:04.697 saving, right?
01:03:06.217 --> 01:03:10.334 The problem is is if you're doing that for. I don't know 500
01:03:10.334 --> 01:03:14.451 entities like 500 sales invoice is good luck that things are
01:03:14.451 --> 01:03:18.433 never gonna finish running kind of thing, right? I mean it
01:03:18.433 --> 01:03:20.727 might, but might take a while so.
01:03:21.807 --> 01:03:26.348 What I did for Payhub is you can actually like new up a instance
01:03:26.348 --> 01:03:30.749 of, you know sales invoice like the entity object. You can put
01:03:30.749 --> 01:03:35.220 the ID that you know it is. So like for example if you know the
01:03:35.220 --> 01:03:39.272 ID is of the things you're updating you can just say like
01:03:39.272 --> 01:03:43.603 new sales invoice and then set the ID and then you can attach
01:03:43.603 --> 01:03:47.585 that to the context, set whatever properties you want to
01:03:47.585 --> 01:03:51.497 actually update and then you can mark them as modified.
01:03:51.767 --> 01:03:53.057 Going to make your changes so.
01:03:54.747 --> 01:03:58.888 This is an example of like a a normal updating a bunch of stuff
01:03:58.888 --> 01:04:02.900 by ID's where you're actually getting all the invoices right.
01:04:02.900 --> 01:04:06.846 The full entities making the changes and saving it. But what
01:04:06.846 --> 01:04:07.687 you could do.
01:04:08.627 --> 01:04:09.807 If you really want to.
01:04:10.747 --> 01:04:13.962 One you could query for only what you need. So let's say you
01:04:13.962 --> 01:04:17.229 did have a wear like let's say you only you wanted to get the
01:04:17.229 --> 01:04:20.390 invoices that were actually valid, right? Because you don't
01:04:20.390 --> 01:04:23.762 wanna hope the front end is like sending an IDs that are valid.
01:04:23.762 --> 01:04:27.135 So you could check to make sure the IDs are valid and let's say
01:04:27.135 --> 01:04:30.296 the things you're updating are actually gonna be updatable,
01:04:30.296 --> 01:04:33.458 right? So this is what this where clause and filter by ID's
01:04:33.458 --> 01:04:36.567 is doing. They can take all those IDs you got and then you
01:04:36.567 --> 01:04:39.518 can new up a sales invoice right where you just set the
01:04:39.518 --> 01:04:40.097 identifier.
01:04:40.527 --> 01:04:43.564 You can attach that sales invoice to the context and then
01:04:43.564 --> 01:04:46.862 you can do your updates and then after you do your updates you
01:04:46.862 --> 01:04:50.003 can actually do context dot entry and then you pass in that
01:04:50.003 --> 01:04:53.458 object your sales invoice object dot property and then you have a
01:04:53.458 --> 01:04:56.390 Lambda statement with the property and then you do like
01:04:56.390 --> 01:04:59.007 dot is modified true so that when you go to save.
01:05:00.017 --> 01:05:03.617 It'll it'll actually update for whatever sales invoice that has
01:05:03.617 --> 01:05:07.048 this ID. It'll update these fields where you set is modified
01:05:07.048 --> 01:05:08.847 to true to whatever it's set as.
01:05:09.677 --> 01:05:10.837 So that's a cool.
01:05:09.997 --> 01:05:14.037 And for anybody, for anybody who's wondering, and this really
01:05:11.487 --> 01:05:11.977 Cool thing.
01:05:14.037 --> 01:05:18.273 sucks, isn't there a better way to do this? The answer in entity
01:05:18.273 --> 01:05:22.117 Framework 6 is no, this is the best way to do it and EF 7.
01:05:22.987 --> 01:05:26.790 They finally have bulk update and bulk delete methods built
01:05:26.790 --> 01:05:28.437 directly into I queryable.
01:05:29.057 --> 01:05:30.417 Ohly nothing we ever.
01:05:29.167 --> 01:05:34.082 So yeah, it's it's much much cleaner to update a singular and
01:05:29.417 --> 01:05:29.847 Wow.
01:05:31.087 --> 01:05:31.507 Yeah.
01:05:34.082 --> 01:05:38.679 it and it basically just translates to a update table DBO
01:05:38.679 --> 01:05:43.514 dot tables set property equals this and then you can include
01:05:43.514 --> 01:05:48.270 your where so it'll do like where X equals whatever. So you
01:05:48.270 --> 01:05:52.868 can one of these days one of these days when we're on net
01:05:52.868 --> 01:05:57.386 seven and things are the sun shines every day and winter
01:05:57.386 --> 01:05:59.367 never comes and all that.
01:05:59.467 --> 01:06:00.127 Uh.
01:06:01.697 --> 01:06:04.527 We won't have to do this this really complicated way, but.
01:06:03.747 --> 01:06:05.097 When the Big Rock candy mountain.
01:06:05.847 --> 01:06:06.467 True.
01:06:07.587 --> 01:06:11.167 Wanna wanna play Mr Blue Sky while you're talking to?
01:06:14.377 --> 01:06:17.024 But yeah, that's all I had. I was just. I just wanted to scan
01:06:17.024 --> 01:06:19.757 through this and see if there's anything I missed in that, that
01:06:19.757 --> 01:06:22.446 one call out for the single or default that is a good one. I I
01:06:22.446 --> 01:06:24.880 honestly like I use that so little bit and I didn't even
01:06:24.880 --> 01:06:25.477 cross my mind.
01:06:26.037 --> 01:06:26.377 Umm.
01:06:26.227 --> 01:06:26.577 But.
01:06:26.227 --> 01:06:28.177 I never used it either really so.
01:06:28.757 --> 01:06:30.627 If anyone wants a link to the article, here you go.
01:06:31.437 --> 01:06:35.027 Kaiser curious, some of this is common sense, but.
01:06:35.757 --> 01:06:37.647 The the deferred execution.
01:06:38.867 --> 01:06:42.517 And the is modified. You know basically not querying for an
01:06:42.517 --> 01:06:46.228 entire entity and then only changing the fields. You need to
01:06:46.228 --> 01:06:50.121 change. That is pretty useful, especially if you're doing stuff
01:06:50.121 --> 01:06:53.527 in batches and you have six. So yeah, that's all I had.
01:06:55.487 --> 01:06:59.584 Yeah. And if you guys wanna compare some of how to not write
01:06:59.584 --> 01:07:00.457 link queries.
01:07:01.867 --> 01:07:02.457 Oh no.
01:07:04.277 --> 01:07:05.167 I would.
01:07:06.207 --> 01:07:10.637 No, not right them like ohh I'd put in my password again.
01:07:12.147 --> 01:07:13.087 Everybody look away.
01:07:15.617 --> 01:07:16.927 Not looking at my keyboard.
01:07:23.257 --> 01:07:23.397 Yep.
01:07:24.277 --> 01:07:25.117 You lying to me?
01:07:25.977 --> 01:07:28.007 Password so good he doesn't even know what it is.
01:07:28.257 --> 01:07:28.977 I know.
01:07:33.967 --> 01:07:34.387 Area.
01:07:35.887 --> 01:07:36.397 So.
01:07:38.277 --> 01:07:42.267 These guys use a stored procedure.
01:07:44.477 --> 01:07:50.129 Where they take so First off, all of the information regarding
01:07:50.129 --> 01:07:50.487 the.
01:07:51.577 --> 01:07:52.417 Lots.
01:07:53.577 --> 01:07:57.173 And how they want to page them and everything is all attached
01:07:57.173 --> 01:08:00.885 to the query parameters. So when the when the request comes in,
01:08:00.885 --> 01:08:01.987 it's got like 1012.
01:08:02.687 --> 01:08:04.187 Parameters on it.
01:08:05.177 --> 01:08:05.737 They.
01:08:08.347 --> 01:08:14.577 Have this huge stored procedure saved that goes in and gets.
01:08:15.587 --> 01:08:16.277 The.
01:08:16.967 --> 01:08:22.234 Lots from the database in this custom model of lock public
01:08:22.234 --> 01:08:25.537 response stored procedure then they.
01:08:26.337 --> 01:08:31.838 Do some checking to see if it is a not null. There's some there,
01:08:31.838 --> 01:08:37.084 right blah blah blah. They set some stuff here, but down here
01:08:37.084 --> 01:08:37.507 they.
01:08:39.707 --> 01:08:40.347 Person that.
01:08:52.447 --> 01:08:53.307 They have two.
01:08:55.677 --> 01:08:58.007 Collections that they used to like.
01:08:56.097 --> 01:08:56.687 There's.
01:08:57.847 --> 01:08:59.367 I saw one down there that's like.
01:09:00.157 --> 01:09:03.562 Logged in user greater than zero and lots snake a little and lots
01:09:03.562 --> 01:09:06.347 underneath and it reads the user out of the database.
01:09:08.037 --> 01:09:12.187 Yeah. So right here, they have the lot public response stored
01:09:12.187 --> 01:09:16.003 procedure that they get from their stored procedure, the
01:09:16.003 --> 01:09:20.220 results and they create a list of lot public response. This is
01:09:20.220 --> 01:09:24.370 the final what they're going to return to the front end. Then
01:09:24.370 --> 01:09:28.654 they create a middleman of lots replica and loop over and use a
01:09:28.654 --> 01:09:31.197 custom Mapper to 1st map them to the.
01:09:31.597 --> 01:09:37.119 Uh to the lock replica and then go over it again and map them to
01:09:37.119 --> 01:09:41.027 the ones that they're going to return to the.
01:09:41.877 --> 01:09:47.327 Uh, front it and like this one right here. This store procedure
01:09:45.167 --> 01:09:45.447 Hi.
01:09:47.327 --> 01:09:47.667 one.
01:09:48.847 --> 01:09:51.047 If we ah go into it.
01:09:54.047 --> 01:09:57.871 Lock public response stored procedure. It has a public and
01:09:57.871 --> 01:10:01.954 total count, but this looks like a single lot. I don't know if
01:10:01.954 --> 01:10:02.537 they are.
01:10:03.507 --> 01:10:07.037 String lots are they string of flying. All of the lots and and
01:10:07.037 --> 01:10:10.231 and storing them there and keeping a counter of how many
01:10:10.231 --> 01:10:13.593 are here. But then why does it have all of this information
01:10:13.593 --> 01:10:14.657 about a single law?
01:10:15.747 --> 01:10:17.877 And if you go back to the handler.
01:10:19.677 --> 01:10:22.935 That's what comes back from the database. The stored procedure
01:10:22.935 --> 01:10:26.089 call and then if you go into the lot replica, it's literally
01:10:26.089 --> 01:10:29.346 another entity with all of the same information that they just
01:10:29.346 --> 01:10:31.517 go over and map it all to this list type.
01:10:36.107 --> 01:10:36.437 By.
01:10:38.897 --> 01:10:41.567 All information about the law, right, like.
01:10:46.107 --> 01:10:49.587 Then they will go over it and map it all to.
01:10:50.957 --> 01:10:53.007 This same you know.
01:10:54.047 --> 01:10:58.497 It it 80% of the fields are identical on these three.
01:11:00.437 --> 01:11:03.807 Look how many fields are on that one. The returning to the.
01:11:04.777 --> 01:11:05.377 Front end.
01:11:07.107 --> 01:11:07.537 Wow.
01:11:08.847 --> 01:11:10.987 This this hurts a little bit to look at.
01:11:11.637 --> 01:11:15.687 It's so hard to follow the flow and and.
01:11:16.357 --> 01:11:20.272 To like understand why they're making the decisions that they
01:11:20.272 --> 01:11:20.587 make.
01:11:21.227 --> 01:11:21.687 Umm.
01:11:24.377 --> 01:11:27.450 Let me show you the bidding stuff that we were looking at.
01:11:27.450 --> 01:11:28.387 This is where the.
01:11:31.157 --> 01:11:31.887 The real.
01:11:34.457 --> 01:11:36.627 Bad entity framework stuff is.
01:11:40.127 --> 01:11:42.517 This multiple bids a handler.
01:11:49.147 --> 01:11:52.663 We refactored. I refactored James and myself, refactored a
01:11:52.663 --> 01:11:56.179 bunch of this. So this is what you know. We come out with.
01:11:56.179 --> 01:11:59.456 We're actually selecting the stuff that we need. We're
01:11:59.456 --> 01:12:03.210 getting as much of it as we can upstream, or that's the top of
01:12:03.210 --> 01:12:06.726 the screen and passing that information downstream instead
01:12:06.726 --> 01:12:10.599 of fetching the same information 100 times along the way. Right.
01:12:10.599 --> 01:12:14.412 And just pulling a field off of it here, pulling a field off of
01:12:14.412 --> 01:12:18.047 it. There. All these comments are me, like, trying to deduce
01:12:18.047 --> 01:12:21.622 what was happening. Right. Follow the logic so that I could
01:12:21.622 --> 01:12:22.337 refactor it.
01:12:24.137 --> 01:12:26.877 But if you look at the, I'll show you my.
01:12:27.767 --> 01:12:30.027 PR so we can look at the.
01:12:31.117 --> 01:12:33.287 Changes and how it was before.
01:12:35.567 --> 01:12:36.487 We refactored it.
01:12:37.977 --> 01:12:40.974 Pleaded. Ohh shoot. It's not gonna be in the SharePoint. Need
01:12:40.974 --> 01:12:41.747 to get back out.
01:12:53.667 --> 01:12:54.327 You did.
01:12:57.067 --> 01:13:00.267 This we've got pretty good right here, yeah.
01:13:03.177 --> 01:13:04.347 So like.
01:13:07.577 --> 01:13:09.767 So ship betting service.
01:13:11.767 --> 01:13:13.057 Like this was the original.
01:13:14.997 --> 01:13:18.705 Context not include not include, then include include, include
01:13:18.705 --> 01:13:22.412 first or default async and we're gonna get all that to get the
01:13:22.412 --> 01:13:23.177 lock catalog.
01:13:28.527 --> 01:13:30.157 Use some information off of it.
01:13:36.597 --> 01:13:39.457 I click at these conditional statements that are like a
01:13:39.457 --> 01:13:40.427 freaking mile long.
01:13:55.997 --> 01:13:59.072 Not doing a very good job at demoing this, but it's a it's a
01:13:59.072 --> 01:13:59.777 freaking mess.
01:14:02.277 --> 01:14:05.757 That this is definitely not how to write LINQ queries.
01:14:07.917 --> 01:14:11.585 Obscure stored procedures that take from the stored procedure
01:14:11.585 --> 01:14:15.016 and then map into two other things and then back out. Ohh
01:14:12.987 --> 01:14:13.457 Kinda.
01:14:15.016 --> 01:14:18.387 yeah, I don't know you're talking about man. It's great.
01:14:16.397 --> 01:14:17.427 Yeah, and like.
01:14:20.587 --> 01:14:25.095 Right here they get the law just to get the user off the lot,
01:14:25.095 --> 01:14:27.857 right to know if there if there is a.
01:14:28.537 --> 01:14:30.947 A user on the law that matches.
01:14:34.207 --> 01:14:35.507 The ID right?
01:14:36.507 --> 01:14:39.327 The lot ID or whatever the user ID.
01:14:40.357 --> 01:14:40.867 Yeah, we're.
01:14:41.567 --> 01:14:45.410 User ID is equally equal to user ID, so they get the lot to find
01:14:45.410 --> 01:14:48.957 that when you could just go to auction user and is approved
01:14:48.957 --> 01:14:52.800 where the auction ID is equal to the ID and the user ID is equal
01:14:52.800 --> 01:14:56.052 to the ID right? They did an include and then and then
01:14:56.052 --> 01:14:58.357 include to get this one Boolean right.
01:14:59.447 --> 01:15:01.637 Like, that's just absolutely abusing.
01:15:02.337 --> 01:15:03.347 The database.
01:15:05.067 --> 01:15:07.461 We're going to fetch a whole bunch of stuff that we don't
01:15:07.461 --> 01:15:07.667 need.
01:15:09.307 --> 01:15:12.162 For that we need no need right now, but we need later and just
01:15:12.162 --> 01:15:15.108 use what we need off of it right now and pitch it back and fetch
01:15:15.108 --> 01:15:15.787 it again later.
01:15:16.067 --> 01:15:19.707 Yeah, we're database. It is abused.
01:15:19.447 --> 01:15:23.250 Yeah. Yeah, man. Like, it's a broken home for this guy, for
01:15:23.250 --> 01:15:23.567 sure.
01:15:26.587 --> 01:15:26.927 Yeah.
01:15:27.807 --> 01:15:29.317 It's just it's ridiculous.
01:15:30.417 --> 01:15:34.547 Yeah, that's. I'm not very good at ad hoc demonstration so.
01:15:35.617 --> 01:15:37.097 Take what you can get out of that, guys.
01:15:39.977 --> 01:15:42.227 You demonstrated what I don't want to see.
01:15:44.107 --> 01:15:47.457 Or have to even like some of those debt like ohh man just.
01:15:48.267 --> 01:15:51.518 Scrolling through like it just seemed like it was never ending,
01:15:51.518 --> 01:15:52.127 I just like.
01:15:51.657 --> 01:15:52.387 It is.
01:15:53.207 --> 01:15:55.127 Yeah, that, that one, I'll.
01:15:53.907 --> 01:15:56.937 You should almost submit a PR at JG, fix it for you.
01:15:58.817 --> 01:16:01.727 That that one file man is like.
01:16:02.947 --> 01:16:08.957 That's like 2700 lines of logic wrapped up in placing a single
01:16:08.957 --> 01:16:10.197 bid on a lot.
01:16:12.457 --> 01:16:13.447 And it is.
01:16:14.767 --> 01:16:15.747 Ridiculous.
01:16:15.307 --> 01:16:20.164 So this is, I'm just curious. This is someone's existing like
01:16:20.164 --> 01:16:21.887 bid site that we were.
01:16:22.577 --> 01:16:24.157 Contracted to do stuff with.
01:16:23.127 --> 01:16:23.637 Yeah.
01:16:24.967 --> 01:16:29.771 They the they have an existing site and then they wanted a, you
01:16:25.277 --> 01:16:25.727 Or.
01:16:29.771 --> 01:16:31.797 know, a new one by to redo.
01:16:33.667 --> 01:16:37.671 An updated site, so they contracted a a company out of
01:16:37.671 --> 01:16:41.747 India to develop the site and like the architecture is.
01:16:43.067 --> 01:16:46.297 Something I've never seen before. Like they they're.
01:16:46.977 --> 01:16:50.967 They have projects that use .NET Framework by itself, which
01:16:50.967 --> 01:16:54.624 doesn't have a runtime environment for it. So like you
01:16:54.624 --> 01:16:58.747 have to have a facade project that literally does nothing but
01:16:58.747 --> 01:17:02.803 runs and lends its run time to the other projects that don't
01:17:02.803 --> 01:17:03.867 have a run time.
01:17:05.107 --> 01:17:09.921 And like the the the the web project is ASP .net core 3.1
01:17:09.921 --> 01:17:15.066 which I've worked in a little bit. I'm at my previous job but
01:17:15.066 --> 01:17:20.129 the the the front end is in Angular 10 and they I guess they
01:17:20.129 --> 01:17:24.942 went way over budget and way over schedule like long time
01:17:24.942 --> 01:17:29.839 over schedule and did not they they had something that was
01:17:29.839 --> 01:17:34.237 about 60% done in the ****** way that it was billed.
01:17:34.427 --> 01:17:38.430 You know, built and it was only about 60% done and we did a
01:17:38.430 --> 01:17:42.567 audit on it and I looked at ways that we could improve it for
01:17:42.567 --> 01:17:43.167 them and.
01:17:44.017 --> 01:17:47.187 Does this is that code base that you're looking at? Is that what
01:17:47.187 --> 01:17:49.137 that is like? That's what they made or?
01:17:48.297 --> 01:17:52.247 Yeah. Umm yeah, yeah.
01:17:50.407 --> 01:17:51.857 OK, that's a.
01:17:52.827 --> 01:17:55.477 Yeah, it's, uh, it's interesting to say the least.
01:17:57.887 --> 01:17:58.257 Yeah.
01:17:59.147 --> 01:18:03.279 Yeah. So they just basically sent us their their the code
01:18:03.279 --> 01:18:07.483 base that they had paid for and wanted us to give them a a
01:18:07.483 --> 01:18:11.544 working site out of it. And I spent about 30 hours doing
01:18:11.544 --> 01:18:15.961 nothing but refactoring LINQ queries and logic to improve the
01:18:15.961 --> 01:18:20.236 bidding speeds. Because when you were when we first got the
01:18:20.236 --> 01:18:24.581 project navigating the site, placing a bid on a single item,
01:18:24.581 --> 01:18:28.357 it took like 3 to 4 seconds for the bid to register.
01:18:29.047 --> 01:18:33.054 On the UI and this is like a live auction site, right? Like
01:18:33.054 --> 01:18:37.194 it took it's taken a long time for a bid to register and I've
01:18:37.194 --> 01:18:41.401 been able to not just myself. I had a lot of help from Brendan
01:18:41.401 --> 01:18:45.408 and I had a lot of help from James, but we were able to get
01:18:45.408 --> 01:18:49.682 it down to. It takes about 3 to 500 milliseconds for the bid to
01:18:48.817 --> 01:18:49.097 No.
01:18:49.682 --> 01:18:54.022 render to the UI. They're using signalr in a similar way that we
01:18:54.022 --> 01:18:54.957 use it in bid.
01:18:56.197 --> 01:19:01.287 And using it to just broadcast to the UI.
01:19:02.527 --> 01:19:05.357 All of the bid updates and.
01:19:07.037 --> 01:19:10.670 We we were primarily focused on the bidding logic where we had a
01:19:10.670 --> 01:19:13.856 meeting like 2 weeks ago and come in and the I guess the
01:19:13.856 --> 01:19:17.209 owner of the company and his partner were in there and they
01:19:17.209 --> 01:19:18.047 were just like.
01:19:18.967 --> 01:19:22.842 This guy comes out and he's like, this is not, I'm I'm. I'm
01:19:22.842 --> 01:19:26.782 disappointed in in what I'm looking at because I thought you
01:19:26.782 --> 01:19:30.786 got basically he said I thought you guys were gonna turn that
01:19:30.786 --> 01:19:34.726 into a working site in a Sprint or two, you know, in like 40
01:19:34.726 --> 01:19:38.472 hours and you guys were just gonna turn it into a working
01:19:35.617 --> 01:19:36.197 Wow.
01:19:38.472 --> 01:19:42.541 site. And he's like, I get on the, I get on here on your demos
01:19:42.541 --> 01:19:46.351 on staging site and he's like, I'm looking around and, you
01:19:46.351 --> 01:19:50.484 know, the catalogs taking, you know, Tate to 10 seconds to load
01:19:50.484 --> 01:19:52.357 and and switch between pages.
01:19:52.437 --> 01:19:57.312 And there's only a few pictures on here, and you know, we're
01:19:57.312 --> 01:20:02.427 talking about 600 lots with one to 3000 images per auction and.
01:20:04.047 --> 01:20:07.962 We were just like, well, we've been focused on the bidding
01:20:07.962 --> 01:20:11.810 logic, right? Like, that's that's what our estimates were
01:20:11.810 --> 01:20:15.724 on. That's what the primary focus has been is reducing the
01:20:15.724 --> 01:20:19.306 speed of placing a bid and making it more dynamic and
01:20:19.306 --> 01:20:22.557 respondent right to bids. And I guess they just.
01:20:23.277 --> 01:20:26.860 Took that as a we were making improvements across the whole
01:20:24.817 --> 01:20:25.567 All of it.
01:20:26.860 --> 01:20:30.682 thing. Yeah. And he, he he just kept saying like, I'm at a loss
01:20:27.537 --> 01:20:28.207 Yeah.
01:20:28.277 --> 01:20:28.677 Well.
01:20:30.682 --> 01:20:34.264 for words. I'm at a loss for words. And Mickey has been the
01:20:33.487 --> 01:20:33.817 Right.
01:20:34.264 --> 01:20:37.907 project manager on it and she was out that day and Stephanie
01:20:37.907 --> 01:20:41.669 was in there and had, you know, just a like a sideline view of
01:20:41.669 --> 01:20:45.490 the project or knowledge of the project. And it was me, her and
01:20:45.490 --> 01:20:49.312 Justin man, he hit us from left field with just like, you know,
01:20:49.312 --> 01:20:52.955 this is ship basically. You guys aren't what are what are we
01:20:52.955 --> 01:20:54.447 paying you for, you know?
01:20:55.027 --> 01:20:57.047 So it was a little bit brutal for sure.
01:20:55.627 --> 01:20:59.888 And see is he the point of contact or is that just the some
01:20:58.827 --> 01:21:03.846 No, no. Yeah. So the point of contact has been his technical
01:20:59.888 --> 01:21:02.657 head honcho? Well, I guarantee it's a.
01:21:03.846 --> 01:21:04.997 advisor, yeah.
01:21:04.647 --> 01:21:04.997 Yeah.
01:21:04.737 --> 01:21:07.323 I guarantee you more than anything else, that it's a
01:21:07.323 --> 01:21:10.153 internal issue on their end as to why that goes confused,
01:21:10.153 --> 01:21:13.129 because I bet the person he, I bet the person under him told
01:21:13.129 --> 01:21:16.300 him that the whole site was just gonna be amazing and fixed. And
01:21:16.300 --> 01:21:18.983 meanwhile when we did estimations, all that stuff were
01:21:18.983 --> 01:21:21.813 like, hey, here's we're gonna work on this Sprint mobile,
01:21:21.813 --> 01:21:24.789 blah, blah, blah, whatever. And that was just a breakdown of
01:21:24.789 --> 01:21:25.667 communication. So.
01:21:26.507 --> 01:21:29.375 Sorry you guys had to deal with that, but you know it is what it
01:21:29.375 --> 01:21:29.507 is.
01:21:50.367 --> 01:21:51.977 Umm yeah.
01:21:52.037 --> 01:21:55.906 Just it was something we come out of it alright though, and
01:21:55.906 --> 01:21:59.646 you know, I thought they. I thought we were gonna have to
01:21:59.646 --> 01:22:03.579 implement caching. Basically was what I was thinking because
01:22:03.579 --> 01:22:07.641 there's no. There's no service like caching at all implemented
01:22:07.641 --> 01:22:11.445 in it. And that was my first thought. And then Chris and I
01:22:11.445 --> 01:22:15.507 did a analysis of it yesterday and, you know, kind of targeted
01:22:15.507 --> 01:22:19.698 that endpoint as a huge smoking gun for what the problem is with
01:22:19.698 --> 01:22:22.277 the current load speeds of the catalog.
01:22:22.567 --> 01:22:26.964 And basically that endpoints taking 5 seconds to return the
01:22:26.964 --> 01:22:31.507 lots for the page, right? So that's that's the point to start
01:22:31.507 --> 01:22:31.727 at.
01:22:32.637 --> 01:22:33.727 Yeah, well.
01:22:34.627 --> 01:22:37.190 Sounds like you you guys at least have a good idea what's
01:22:37.190 --> 01:22:39.797 wrong with the site. You just have to have time to fix it.
01:22:40.467 --> 01:22:41.227 Yeah.