edemaine / coauthor

Coauthor supercollaboration/discussion forum
MIT License
245 stars 32 forks source link

Stop Editing should work before editor loads #630

Closed edemaine closed 9 months ago

edemaine commented 9 months ago

Context

Occasionally a message editor gets "wedged" in that it never succeeds in loading. It's then impossible to close the editor (e.g. to retry), without reloading the page.

image

What's wrong?

Clicking "Stop Editing" should succeed when the editor hasn't actually loaded yet. Currently it says there are unsaved changes, probably because the editor contents are still empty.

Root issue

I get this behavior a bunch when editing the message in a different tab, maybe closing it, and then switching over. Perhaps it gets the initial update of "now editing" but then fails because there is no backend editor for it to connect to? We should try to catch this or otherwise cleanup properly.

I might also be seeing an error Exception in template helper: TypeError: Cannot read properties of undefined (reading 'title'), possibly within CodeMirror. Not sure if it's caused by this though.