0:00:24
what's going on guys
0:00:27
another session of bill breaking effect
0:00:31
two of the raw coders today
0:00:39
hey hey zayn um hey everyone
0:00:42
uh yeah not much um
0:00:46
yeah not much at all
0:00:48
um yeah just can you get into it
0:00:52
it's gonna be a fun ride
0:00:56
yeah um so just before we continue i
0:00:59
just want to play the acknowledgement of
0:01:01
the country so here goes
0:01:04
i begin today by acknowledging the
0:01:06
traditional custodians of the land on
0:01:08
which we gather today and pay my
0:01:10
respects to the elders past present and
0:01:13
future i extend their respect to
0:01:15
aboriginal and torres strait islander
0:01:22
now that is all done
0:01:27
give a bit for recap um yes
0:01:30
then me and tori worked on as in
0:01:34
implementing the function
0:01:36
functionality of when we disconnect the
0:01:41
client from the websocket server
0:01:43
it actually removes the connection id
0:01:51
we're working on that while we kind of
0:01:54
implemented the functionality but it
0:01:57
wasn't really working when we it wasn't
0:02:02
um connection id so we're gonna continue
0:02:06
today okay all right
0:02:14
briefly but i think once uh once i see
0:02:19
perfect the process of getting
0:02:22
do you wanna um share your screen today
0:02:28
and then you can go get cool as well
0:02:31
and we can take it from there
0:02:53
right so i'll just add your screen
0:03:05
i like your background by the way
0:03:20
all right so yeah don't get pulled
0:03:29
oh we made changes the other day i
0:03:34
maybe i'll just undo it or you want to
0:03:36
have a look yeah uh undo it
0:04:09
uh why do you need to go to aws console
0:04:14
uh just to see what you guys did um
0:04:18
a bit better get a better idea
0:04:21
do you wanna as in do from the code or i
0:04:25
mean where you how you gonna look from
0:04:30
the edit aw console what we what we did
0:04:38
just looking at the
0:04:40
possibly the dynamo db
0:04:47
if there would be an image
0:04:49
if there would be any data there oh
0:04:54
okay right okay cool cool yeah that's
0:04:58
fine then so um what you can do yeah log
0:05:02
it is it was a console
0:05:05
sorry i thought you wanted to go to
0:05:09
uh aws console to see the actual code
0:05:14
um i'm not too sure what he means but i
0:05:18
need to confirm it but yeah i
0:05:26
oh um sorry i've got to tell you that
0:05:30
the account id has been
0:05:49
hey gangnam welcome mate good to have
0:05:53
yeah there you go this is our dragon
0:05:59
oh i'll be right back i've got to wear
0:06:32
speedy i have to be when i have to be
0:06:37
time is too precious
0:06:43
cool so what you want to basically do is
0:06:55
northern virginia you need to be
0:06:59
i panicked for a bit
0:07:01
where did my tables go
0:07:08
yeah so if you click on view items
0:07:11
on the right corner
0:07:14
orange button yeah there we go so
0:07:17
there's the one id
0:07:19
that's it basically
0:07:23
so when you connect to web socket if if
0:07:25
you want to try this
0:07:27
you can do it so if you go to
0:07:31
api on websocket api
0:07:44
which is in yeah api api gateway yes
0:07:49
um by the way dev is asking how's work t
0:07:55
pretty good dev um whether we
0:08:00
already do just before the break was
0:08:02
working on the vlog 4j stuff
0:08:05
um so yeah that was super busy
0:08:08
but it seems to have settled down now so
0:08:10
um yeah just getting back into things
0:08:14
looking at emails and
0:08:16
the time being but yeah i think it's a
0:08:19
it's slow start but yeah i guess it's
0:08:21
gonna pick up soon
0:08:31
uh so if you go to stages
0:08:51
okay go on buy something
0:09:04
and if you go back to the dyno db now
0:09:08
they should be two
0:09:14
you can open in a new tab instead
0:09:18
oh true i should do that
0:09:29
so what we have been working on so if
0:09:32
you open the code now
0:09:46
just thinking where to start now because
0:09:48
i have to explain you the background
0:09:53
continue okay cool so
0:09:56
basically how this is working at the
0:09:58
moment you know in particularly yaml
0:10:09
we need to basically
0:10:14
in order to trigger the
0:10:16
websocket and then the lambdas we need
0:10:28
uh i'm i'm pretty sure it's all
0:10:31
going above your head isn't it at the
0:10:33
yeah right yeah um so
0:10:36
actually might be a better idea if i
0:10:39
share because i i can quickly
0:10:42
highlight the code and uh explain you in
0:10:49
yeah cool so i'll just
0:10:57
workspace this is my thing
0:11:06
okay cool so are you able to see my vs
0:11:16
say in order to do what we did
0:11:22
send the connection id to
0:11:27
dynamo and that's all been done for
0:11:32
what was needed to be done was
0:11:38
you know how we all already had this
0:11:46
so all i did was added this route
0:11:54
so um and then what i did was i
0:12:02
you know what a root in websocket is
0:12:07
it's the options right that
0:12:10
pathway that yeah the website can take
0:12:14
yes um in order to identify which lambda
0:12:17
that it should trigger
0:12:21
yeah that gives me yeah
0:12:27
what happens is that the root
0:12:35
can uh trigger the lambda we need to
0:12:39
trigger the lambda function via
0:12:45
what do i mean by that
0:12:48
so see this connection root
0:12:51
we have here and from this one we're
0:12:56
giving it an ap id the root key is
0:12:59
this which you already already are aware
0:13:03
so this roots is targeting
0:13:15
which into creation is it targeting in
0:13:17
particular connect integration which is
0:13:28
connect integration is doing
0:13:42
websocket connect handler function
0:13:49
so essentially until now um
0:13:52
we uh from what i've unders understood
0:13:55
we can't directly call our
0:14:00
our lambda function through the root
0:14:03
we need to point it to the integration
0:14:10
and then there into
0:14:12
that into integration we'll call the
0:14:14
lambda function yeah okay that makes
0:14:24
lambda function always
0:14:26
saying is okay we wanna um
0:14:31
into we wanna invoke this
0:14:34
function from this into integration
0:14:40
and this function is over here
0:14:45
which has all the permissions
0:14:57
it's pointing to this
0:15:00
this hand load which is over here
0:15:06
does that make sense uh until now
0:15:09
yeah yeah have you got any
0:15:14
no no another time
0:15:19
just really a brief recap
0:15:28
and then from the integration we call
0:15:39
for us by calling this handler
0:15:46
yeah okay makes sense which is
0:15:51
you might ask okay what does this
0:15:58
so what this is doing is basically um
0:16:14
the document client
0:16:17
which is basically used to interact with
0:16:21
it's a library which is used to interact
0:16:27
yeah okay makes sense so far
0:16:30
yeah cool and now all we're doing
0:16:34
is giving it a table
0:16:41
from the environment variable
0:16:51
this is coming from
0:16:59
environment variable so because we
0:17:02
wanted to use this
0:17:08
as in this table so we enclosed it in
0:17:11
this environment variable
0:17:15
and then we used this environment
0:17:21
code because it's a best practice to not
0:17:24
to kind of hard code
0:17:32
cool and then we are basically just
0:17:34
inserting the connection
0:17:42
object which is coming from the
0:17:59
calling the put method from the library
0:18:04
document client and then simply
0:18:19
okay and this code uh i'm assuming is
0:18:24
familiar is it to you
0:18:32
did that all make sense
0:18:34
yes yeah yeah then
0:18:37
really put it in better uh context for
0:18:39
me so yeah thanks that's it that's it
0:18:42
fantastic i'm really
0:18:47
tori and i have been working on um
0:18:58
thing okay just connect with the thing
0:19:05
connection functionality
0:19:10
need to disconnect
0:19:15
actually don't worry about that
0:19:18
i'm gonna get tori's
0:19:27
this at the moment isn't working
0:19:32
but we don't know why
0:19:35
so the the entire concept of this was
0:19:48
when we disconnect from the
0:19:51
server we want to remove
0:19:59
yeah make sense okay
0:20:02
but this isn't working at the moment
0:20:14
that's one of the problems that um
0:20:17
it's not giving us as in it's not
0:20:20
triggering the um api
0:20:24
but um i think we need to go to the
0:20:31
what's happening there
0:20:33
so let's go there and in that way we can
0:21:01
to that's import for my life
0:21:07
he's an amazing person
0:21:11
okay anyway focus i need to focus
0:21:17
is this mine yeah isn't that
0:21:20
this is mine say oh sorry my bad i
0:21:23
should have done that
0:21:26
what did you do are you click done oh
0:21:37
okay now why am i opening jira
0:21:40
don't even need that
0:21:46
it's been a good productive as in how
0:21:52
15 hour hour work day
0:21:57
so like you finish walk then you jump on
0:21:59
the stream straight away
0:22:01
pretty much that's intense man
0:22:09
thing is that it's really cool because
0:22:11
the things i'm doing
0:22:16
they are actually aligned with my
0:22:21
career inspiration and in in the tech
0:22:25
i want to go into now
0:22:28
so i'm actually learning
0:22:30
from my personal hobby as well
0:22:34
nice okay which is fantastic
0:22:38
so what is the tech you want to get into
0:22:42
at the moment i want to get into azure
0:22:47
azure and i want to also
0:22:50
enhance my c-sharp skills
0:22:57
and also react for the frontend
0:23:00
i really want to do that
0:23:04
so it's a kind of the stuff you're doing
0:23:13
how about yourself
0:23:15
what text and what text tag are you
0:23:22
trading cash let's say what you say
0:23:29
um mainly i've been working with
0:23:35
terraform infrastructure stuff oh
0:23:40
yeah because it's my roles mainly
0:23:42
infrastructure sort of all but um
0:23:46
and also a lot of like unix linux stuff
0:23:51
but what i would like to move more into
0:23:56
cloud aws gcp sort of work i
0:24:05
yeah there's a lot of relation i guess
0:24:07
between the two but
0:24:10
yeah exactly what i'm aspiring towards
0:24:13
which is pretty pretty good
0:24:17
i think that the future of
0:24:23
as in everyone's moving
0:24:30
is that something you're looking to
0:24:32
improve your skills
0:24:43
i thought that was it
0:24:51
come on guys come on
0:24:55
come on zane come on
0:25:03
i don't know why that comes up as in
0:25:05
unauthorized first and then when i click
0:25:18
all right let's go to that one
0:25:23
um resources so we need to find a
0:25:33
websocket disconnect handler function
0:25:35
yeah this one and we need to check
0:25:50
right okay that's fine
0:25:53
log group doesn't exist
0:26:00
have i even enabled it
0:26:03
let me go back and check
0:26:07
do you know what could be the problem
0:26:36
no that's not my bad
0:26:41
this can yeah that's there i'm actually
0:26:44
giving it permissions as well
0:26:48
the websocket disconnects lambda
0:26:52
website kpi disconnect
0:26:55
yeah invoke disconnect yeah that's fine
0:27:02
why is it playing off with me
0:27:15
yeah because i think that might have
0:27:21
yeah that should be fine
0:27:30
credential execution role is my connect
0:27:34
taking the execution mode
0:27:46
so that means there's not even been
0:27:48
triggered in the first place
0:27:53
that is interesting
0:27:57
oh cloud watch let's go back to the
0:27:59
clouds and check the api logs
0:28:02
if there's any clues
0:28:04
oq is that the one
0:28:30
i wanna watch a video
0:28:36
actually probably not
0:28:39
i'll check what the other guy did on the
0:28:59
yeah that is the one
0:29:03
so what did we miss
0:29:08
he's using that one yet that's fine he's
0:29:12
got exactly the same thing as us
0:29:15
oh we have exactly the same thing as him
0:29:22
right is definitely not
0:29:24
lambda because that is all fine
0:29:31
you know what i'm gonna do
0:29:34
um run his repo and see how
0:29:46
oh by the way uh get this asked your
0:29:55
uh are you working on anything
0:29:57
interesting i'm working just on boarding
0:30:00
um so my project director actually told
0:30:07
i can help where i can
0:30:09
but the high the highest price as in but
0:30:17
training done as much as possible so
0:30:21
today i did work uh i did help a
0:30:30
that was pretty much fun basically for
0:30:35
a purpose for the users so
0:30:46
it's still like a lot of fun you have to
0:30:49
do like compliance modules and all that
0:30:53
um so i've done the com uh so compliance
0:30:57
and risk management i've done i'm just
0:31:01
as in the depth part now as in the
0:31:04
coding standards and if i need to do a
0:31:08
peer-to-peer review how to do the
0:31:14
for a pair and make sure everything is
0:31:20
just getting to know the
0:31:27
specific to my company yeah
0:31:31
that's all pretty much fun stuff
0:31:47
thing and see how it's working because
0:31:52
we're doing something wrong
0:31:55
i'm just looking through the code as
0:32:39
it'll be really interesting that
0:32:44
if it's just a kind of a
0:32:47
semi semicolon fix
0:32:59
start checking for um
0:33:01
bacon season pizza
0:33:15
have you found anything interesting yet
0:33:30
actually maybe what why is it structured
0:33:39
structured what do you mean the template
0:33:45
can i share my screen for a second
0:33:47
yeah of course of course
0:33:58
um so i'm just wondering
0:34:02
so you have you did your the in this
0:34:05
part you guys said connect with connect
0:34:07
integration and then
0:34:10
websocket connection
0:34:13
and then you guys got the disconnect
0:34:17
and then you do disconnect
0:34:21
disconnect it probably doesn't matter
0:34:25
um why did you get why didn't you guys
0:34:28
to the bottom of this
0:34:30
i see what you mean there
0:34:34
right right yeah there might have been a
0:34:42
at actually um how
0:34:45
has he done it i'm really curious about
0:34:50
as in the guy from the repo
0:34:53
i'm just going to share my screen now
0:34:57
see how has he done it because yeah
0:35:01
pretty sure that might be the case
0:35:11
we're not using that
0:35:14
on connect permission
0:35:32
yeah to be honest i don't think that
0:35:40
connection table hmm no i don't think so
0:35:47
because see how he's going to disconnect
0:35:50
fruit into integration and then
0:35:53
send root and then send in integration
0:35:58
and then it's coming straight to the
0:36:04
and but this and he's got their
0:36:08
uh does order matter i wonder maybe it
0:36:12
doesn't either because it's not really
0:36:15
it's just kind of defining right yeah i
0:36:20
i may be wrong i just want to see even
0:36:24
actually let's see his chain
0:36:28
code if he's actually
0:36:30
inserting and deleting
0:36:32
in the way that we are checking is
0:36:44
i'm getting confused now
0:36:48
okay that one i was
0:36:49
doing training on react
0:36:54
so which one was it
0:37:08
it has deployed right cool so let's go
0:37:11
to our cloud information and then
0:37:18
actually i don't even want to check his
0:37:20
standards we want to check if for him is
0:37:51
okay um go to cloud formation and then
0:38:02
okay so we don't okay so his connection
0:38:06
is it that's fine and what if we
0:38:09
disconnect him what happens then
0:38:22
oh okay so for him as well
0:38:26
interesting okay so
0:38:30
missing in obviously
0:38:38
right okay we need to
0:38:41
check what could be the case
0:38:50
that means that this is okay disconnect
0:38:56
disconnect key disconnect root
0:38:59
disconnect integration and in our case
0:39:22
this is disconnects
0:39:32
connection secretion
0:39:36
you know what finish i've got funny
0:39:38
feeling that you must be right on that
0:39:43
so what we might do is
0:40:10
okay websocket this connection yeah
0:40:20
i'm just gonna edit this proxy
0:40:29
on on disconnect function
0:40:36
of course share it right now
0:40:40
see if we have any
0:40:45
thing to be surprised about
0:40:55
just making sure that this is pointing
0:41:00
this is fine as well
0:41:04
just connect integration yes
0:41:11
cool all right i'm gonna
0:41:13
build it and then deploy it
0:41:32
have you had dinner yeah
0:41:43
you they're not like the frozen fish
0:41:45
just like air fry them and then i eat
0:41:50
yeah pretty standard
0:41:54
yes so have you had dinner
0:42:01
i finished work around say 9
0:42:15
you must be slapping
0:42:18
you must be starving
0:42:23
really hungry i feel like
0:42:25
eating this cold because it's not
0:42:32
eat it chew it and throw in the bin
0:42:42
have didn't know quite early
0:42:46
yeah i tried to man
0:42:50
yeah you feel better when you sleep
0:42:57
that is absolutely right man
0:43:04
possibly what time do you wake up then
0:43:08
uh like seven o'clock seven
0:43:25
how you get how much sleep do you get by
0:43:28
i guess a minimum four maximum six
0:43:40
i'm just i wouldn't say hard i would say
0:43:44
i'm just purposely really engaged
0:43:54
deployed i'm really hoping it works to
0:44:01
come on boy come on surprise me
0:44:04
i know you can you can do it
0:44:13
where's ours come the api
0:44:16
no not the api the website here
0:44:45
so if you go to our
0:44:48
dynamodb no not this one i don't want
0:44:58
websocket connections
0:45:02
now if that worked we would
0:45:23
where did it go yeah there we go
0:45:30
where are we missing i'm pretty sure
0:45:32
it's the most simplest
0:45:42
just wanted to compare
0:45:52
chat disconnect yeah
0:45:57
disconnect route and then
0:45:59
target integrations disconnect
0:46:28
non-disconnect yeah integrations
0:46:32
disconnect integration yeah okay
0:46:50
websocket disconnection
0:46:53
yeah that's when they shouldn't really
0:47:04
yeah we'll go on connect aaron
0:47:08
which is down there
0:47:12
yeah just put them in the folder
0:47:15
which is fine and it's calling app.js
0:47:20
environment variables
0:47:25
i think i might find the problem
0:47:35
um i just want to check if that is
0:47:38
included in our version as well
0:47:46
so disconnect lambda
0:47:50
we have called this one
0:47:54
dynamodb full access
0:47:57
but would that matter
0:48:03
what is the policy there
0:48:24
but it shouldn't matter because
0:48:26
i've done exactly the same for the
0:48:30
and that's working
0:48:51
where am i going wrong
0:48:55
yeah am i going wrong
0:49:04
this connector is there as well
0:49:11
actually i'm gonna
0:49:13
go in uh the logs and check if you
0:49:19
please give me logs i need those badly
0:49:25
no it didn't produce any log
0:49:33
do you want to just see the disconnect
0:49:43
what i might do actually
0:49:47
i might copy and paste their function
0:49:51
into our one and see if that makes any
0:50:21
on top of hours actually i'm not i'm
0:50:24
gonna delete always but that's
0:50:36
we have to change the api version
0:50:48
thing is that shouldn't really matter
0:50:52
that's not really enough will connect
0:50:58
um might just go ahead and see if this
0:51:24
cool let's try this and see if this
0:51:30
does any good to us
0:51:56
i found out the problem
0:52:14
all right pizza hot time
0:52:21
ah come on mate come on zayn
0:52:24
you can do better than this i know that
0:52:31
but why do you use what you use
0:52:34
how come item works in on connect
0:52:37
because you're putting the
0:52:40
record so if you insert a record you
0:52:44
item and then you're putting the
0:52:46
item but if you're deleting it there
0:52:51
finding the primary key first
0:52:54
and then deleting it
0:52:58
which happens as in you of
0:53:05
it finds the connection
0:53:11
it doesn't have to do anything with
0:53:17
okay yep does that make sense
0:53:22
oh i can't believe myself
0:53:25
such a small thing
0:53:37
but it's as good you
0:53:39
copied that code and had a look so
0:53:42
yeah triggered something in you
0:53:49
i'm happy and then
0:53:54
a while but we got that
0:54:15
not to do these these
0:54:18
kind of things again
0:54:22
learning the hard way yeah
0:54:27
it makes you think for next time like oh
0:54:29
you actually this is something that i
0:54:31
think about it sort of like you know
0:54:32
whether it's key or item
0:54:35
yeah makes you think about that as well
0:54:38
exactly yeah i totally agree
0:54:46
yeah i definitely wouldn't have thought
0:54:49
um i wouldn't blame you at all because
0:54:53
this is actually totally my fault
0:54:55
because i all i did was copy and pasted
0:55:01
code in there but i've really forgot
0:55:04
this minor detail that hang on i'm
0:55:08
it uses item and that wouldn't work with
0:55:30
let's see the magic now i'm really
0:55:32
looking forward to testing it
0:55:45
did you change the link see oh yeah i
0:55:48
did so that's four
0:55:50
and now if i did this connector should
0:55:53
actually delete the
0:55:56
uh you should only have three records in
0:56:06
no no hold on did you change the
0:56:09
the pie socket link like to where after
0:56:11
you redeployed i mean
0:56:14
no because the price talking remain um
0:56:16
the link remains the same isn't it
0:56:19
oh i'm not i'm not too sure of myself
0:56:22
just wonder i thought the link change it
0:56:25
i'll just confirm that as well just bear
0:56:27
with me might be wrong
0:56:33
which one websocket
0:56:35
is going to be website
0:56:45
it looks the same that's true
0:56:51
um i'm gonna go to clyde watch and see
0:56:54
what's it doing there please give me
0:57:00
on connect on comment lander
0:57:06
on disconnect now that that's not mine
0:57:39
so i'm going to now back to that
0:57:45
i'm deleting the data
0:58:03
table let me see i'm giving the key
0:58:08
um is that is that the problem
0:58:12
is that the problem no that's not the
0:58:25
so they eventually wasn't even the
0:58:31
actually what i might do is just
0:58:41
yeah and see what happens
0:59:03
if if it doesn't work here then it's
0:59:06
definitely something in the gmo file
0:59:10
yep yep makes sense
0:59:30
yeah i can't imagine
0:59:37
what kind of cuisines does you like
0:59:44
i mean i like asian food um
0:59:50
most i like most cuisines man
0:59:55
afghan food as well all right try
0:59:58
yeah that's pretty tasty as well
1:00:05
a bunch i really don't mind anything
1:00:16
as you can see i can pretty much eat
1:00:18
anything except noodles
1:00:28
what will we have for dinner
1:00:31
i'll probably have
1:00:39
okay let's check out now and see what it
1:00:46
attention established
1:00:51
okay one two three four five okay
1:00:54
and if i do disconnect
1:01:03
the moment of truth again
1:01:13
all right didn't do so i think it's in
1:01:17
it's definitely not here
1:01:25
yeah we will come back to it
1:01:31
the um for the yemen like looking
1:01:33
through it it's it looks like identical
1:01:35
to the to what you guys did for the
1:01:39
i don't know unless
1:01:40
unless you have to do something
1:01:42
different or i'm not sure
1:01:44
um i'm guessing so
1:01:47
well then there might be just one step
1:01:49
that we haven't probably done and
1:02:00
it's just a matter of
1:02:08
do you want to do the closing
1:02:12
uh cool thanks for joining us everyone
1:02:14
on another episode of buildbreaking fix
1:02:17
today we worked on the
1:02:27
said in tory they they got the connect
1:02:29
id to save in dynamodb and now we
1:02:33
when the user disconnects we essentially
1:02:35
want to delete that connection id from
1:02:43
we we got close but
1:02:46
something is missing although it doesn't
1:02:49
uh we're gonna continue looking at that
1:02:51
in the upcoming streams
1:02:56
we'll join you you can join us tomorrow
1:02:58
same time same place and same task
1:03:06
have a good night guys