paradigmxyz/flux

bug: openAI key modal is not dismissible even after pasting the token

altryne opened this issue ยท 13 comments

CleanShot 2023-03-28 at 15 57 41@2x

No matter what I do ,the modal won't go away.

I refresh, the token is loaded from localhost. but the model still is not going away.

When I remove the HTML via devtools the app seems to work fine.

happens in chrome and in Arc btw, with or without adblockers. Not sure what else to test, no JS errors in console

thanks for opening an issue!

issue here was that entering your api key triggers a mixpanel event, and w/o a mixpanel token that will error.

fixed here: 4786c49

I still can't run this, cache refresh, both local (pulled latest changes) and on http://flux.paradigm.xyz

Pasted the key, modal.. stays right there.
Tried on Safari, Chrome and Arc ๐Ÿซข

FLUX_OPENAI_API_KEY is stored. I don't think I have a key issue, it's been in my 1P since a year ago.

Incognito modes and all.
CleanShot 2023-03-28 at 17 06 54@2x

oh huh wtfโ€” do you see any errors the console?

and are you sure you don't have an extra space or something after the token?

No errors
image

no extra spaces (I also checked ๐Ÿ˜‚)

Are you doing validation of the API key on paste? What triggers the dismissal? Maybe I can shove a breakpoint in there and see

yup this line determines if a key is "valid" or not (which triggers the dismissal)

https://github.com/transmissions11/flux/blob/af772d947237d53d0b720a75bbd2c49f83013db0/src/utils/apikey.ts#L2

the only other thing that could block the dismissal is the typing handler throwing for some reason

could in theory be this line but you'd see an error in the console

https://github.com/transmissions11/flux/blob/af772d947237d53d0b720a75bbd2c49f83013db0/src/components/modals/APIKeyModal.tsx#L22

Mine is 43! Maybe it's super old haha?

CleanShot 2023-03-28 at 17 36 19@2x

oh weird, yeah that must be it! didn't know they changed the format... TIL

we could add support for 43 char tho im worried that might introduce some confusion

Keep it, worst case this issue is here for ref.
Tested with a new token and works ๐Ÿ”ฅ

awesome thanks for making debugging this so easy :)