edgedb-ui icon indicating copy to clipboard operation
edgedb-ui copied to clipboard

Exceptions on Safari & Firefox

Open sbdchd opened this issue 3 years ago • 3 comments

This bit of code is exploding:

https://github.com/edgedb/edgedb-studio/blob/a73e7b1d8050ccbd83f874fef6e54b2a74c172db/shared/studio/tabs/schema/state/textView.ts#L246-L248

The value of schemaData.scalars.values() is 2k lines so put it in a gist:

https://gist.github.com/sbdchd/1b1f50612d6e66f49e56502850739c76

but here's a screenshot

image

and the errors:

image
[mobx] uncaught error in 'Reaction[Autorun]'
TypeError: undefined is not an object (evaluating 'e.name.localeCompare')

Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'e.name.localeCompare')

edit: seems the data is getting corrupted or something

[...schemaData.scalars.values()].map(x => x.schemaType)

returns a mix of "Scalar" and undefined

edit2: there should also probably be some ErrorBoundarys sprinkled around to avoid:

image

edit3: trying on Firefox I get:

image

https://github.com/edgedb/edgedb-studio/blob/a73e7b1d8050ccbd83f874fef6e54b2a74c172db/shared/studio/tabs/schema/textView.tsx#L343-L343

sbdchd avatar Jul 29 '22 02:07 sbdchd

Thanks, we'll take a look!

1st1 avatar Jul 29 '22 04:07 1st1

@sbdchd Can you post your schema? Also did this error happen the first time you used the UI, or did the error happen after a page reload?

jaclarke avatar Jul 29 '22 21:07 jaclarke

I don't think it initially happened. I'm pretty sure I navigated between a couple projects and then I tried to type the REPL and I couldn't type.

Then I looked in the console and saw an error. Later when navigating more stuff started breaking more as in white screen.

I have 3 projects setup in the UI, one is the example the default schema, and a couple empty projects with:

module default{};

for the sdl

edit:

I cleared the IndexDB and the bug persists, also noticed a different error in the console:

Fetch API cannot load http://localhost:10700/db/_example due to access control checks.

maybe related to https://stackoverflow.com/questions/63141448/safari-fetch-api-cannot-load-due-to-access-control-checks-after-reload 🤷🏻

edit2: that fetch error seems spurious, can't get it to reproduce.

sbdchd avatar Jul 30 '22 00:07 sbdchd