hedgedoc / react-client

The frontend of the upcoming version 2.0
https://hedgedoc.dev
GNU Affero General Public License v3.0
105 stars 13 forks source link

UI Test loads with no view mode in Chrome #1113

Closed davidmehren closed 3 years ago

davidmehren commented 3 years ago

Description After pasting https://ui-test.hedgedoc.org/n/features into the Chrome Omnibox, the frontend only shows a big black box: grafik The dev tools show a variety of messages: grafik This behavior persisted over multiple reloads with cache disabled.

Manually selecting the "both" view mode switched to the correct mode after a short delay and caused two more warnings: grafik

After that the issue was not reproducible anymore.

To Reproduce

  1. Open the UI test in Chrome
  2. ...be lucky?

Expected behavior The frontend shows one of the three view modes without the user having to manually select one.

Your Setup:

mrdrogdrog commented 3 years ago

I tested it with exact this browser version aaaand.. can't reproduce. Something must be wrong with your setup.

mrdrogdrog commented 3 years ago

For a short time we had a broken service worker. Check if it is still registered in your browser (dev tools > Applications > Service Workers > unregister every service worker there)

ErikMichelson commented 3 years ago

This likely happens because we changed editorConfig local-storage syntax from editorMode: 1, 2, 3 to editorMode: view, both, edit. Clear your local-storage and try it again.

mrdrogdrog commented 3 years ago

@ErikMichelson maybe we should change the fallback. And write it back if we use it.

ErikMichelson commented 3 years ago

Well we currently do not verify the data at all (return JSON.parse(stored) as EditorConfig). I doubt that we really need to test each property - especially as this problem only appears for regular ui-test users. Also note that once you select one of the editor modes, the locally stored config will be corrected.

mrdrogdrog commented 3 years ago

Yes, but a type cast doesn't verify the data we read. I think it would be better to check the data for plausability.

ErikMichelson commented 3 years ago

For API response data validation we're tracking the progress in hedgedoc/hedgedoc#2910. As this seems to be solved, I'm going to close this now.