skohub-io / skohub-editor

Apache License 2.0
5 stars 4 forks source link

Editor won't load after once using a schema that breaks it #40

Open acka47 opened 4 years ago

acka47 commented 4 years ago

To reproduce (in Firefox or Chrome):

  1. Got to https://skohub.io/editor/ and the editor will load
  2. Load a schema that breaks the editor via the input box on the top , e.g. https://acka47.github.io/lrmi-profile/draft/schemas/schema.json (see #39). The window will stay blank
  3. Load https://skohub.io/editor/ again directly or after loading a schema that works via the URL (e.g. https://skohub.io/editor/?schema=https://dini-ag-kim.github.io/lrmi-profile/draft/schemas/schema.json): The page stays white.
  4. Even restarting the browser (just tried it with Chrome) won't fix it.

The problem seems to be that the browser tries to load the last schema you chose and not the default schema. Best behaviour would be: Editor loads the last schema that was used but only if it does not break the editor, otherwise the default schema is used for loading.

acka47 commented 4 years ago

Just tried a system reboot and even after that it won't work again by loading the default schema.

dr0i commented 4 years ago

Tried it on firefox 75.0, everything the same but 3), worked for me (showing not a blank site but the editor with the LRMI draft schema). Re your problem: supposed that something is cached at the harddisk but couldn't found anything:

[~/.mozilla/firefox/$id] 
$ find . -name "cache" -ls |grep skohub
literarymachine commented 4 years ago

Confirmed. This is probably due to bf9de82adbf4093c1be3a342f4f6aeea450d36f1 where the schema URL is persisted to localStorage. It should obviously be validated before loading it. For now, you can delete the schemaURL key in the Application tab of the Developer Tools (in Chrome):

image