frankcollins3 / fill_container

codecamp team project updated with new icon screen menu + puppeteer icon search, GraphQL, redux, relational psql !mongo, and accuweatherAPI
1 stars 0 forks source link

SDLC? async issue? with googleid [2:43pm] #46

Open frankcollins3 opened 1 year ago

frankcollins3 commented 1 year ago

start() function works with same clientId with which it worked before.

I believe this is an SDLC issue. Screen Shot 2023-05-26 at 2 42 43 PM

👎 component wants the clientID ready by the time it renders. There is an ImmediatelyInvokedFunc() in useEffect() facilitating: the assigning of values to already globally declared variables.

let clientId:string = ''

<GoogleLogin clientId={clientId}

the component is interacting with the clientId variable before the useEffect() completes it reassigning of that value. The async factor is that GraphQL has to wait for the process.env from serverside to perform these functions. 👎 This is because the need for NODE_ENV to discern between {url: host:3000 || 'amazonEC2/app/production' }

frankcollins3 commented 1 year ago
        {clientId.length
        ?
        <GoogleLogin  
        onSuccess={onSuccess}
        onFailure={onFailure}
        clientId={clientId}
        // clientId={GOOGLE_clientId}
        buttonText="text"
        cookiePolicy={'single_host_origin'}
        // isSignedIn={true}
        />
        :
        <pre></pre>
        }

clientId ? not sure if the empty string will validate the truthy argument of this ternary operator. clientId.length ?

👎 no change either way [2:48pm]

new proposed approach: this ternary arg setup isn't doing what is intended because the google component button never renders. The new approach is to put that ternary argument only on the clientId

[2:53pm]

frankcollins3 commented 1 year ago

Screen Shot 2023-05-26 at 2 56 52 PM async error: "value is used before being assigned"

[2:57pm]