Automatic draft-saving plus Sefaria auto-linker leads to the post taking too long to save
If I write up a post on any other Codidact site, the auto-save feature isn't too bad; every time I click around in the text box, or pause for a moment, it briefly autosaves.
If I write up a post on Judaism Codidact that is strictly HTML-based, the same easy-to-use functionality holds.
If I write up a post on Judaism Codidact that uses a source which calls the Sefaria auto-linker is longer than some amount of characters (not sure what the limit is, but it's on the longer side), rather than taking maybe half a second to auto-save, it instead takes closer to 5-10 seconds (depending on post length and how many Sefaria links there are) to auto-save. Whereas in general clicking to a different part of my post does not trigger the auto-save unless I also pause long enough in my typing, if Sefaria Linker is called I can't click out without waiting on the auto-save to do its thing.
This bug holds regardless of browser; I can try to grab a console log if you need it. My theory atm is that the Sefaria linker is called on auto-save for the preview, and the longer the post, the more it struggles to parse the entire post in a smallish amount of time.
1 answer
We weren't able to solve the problem directly (something something Javascript is single-threaded something), but there is now a preference to disable auto-saving, which is a work-around. Go to your user profile and then to the "preferences" tab. The preference is community-specific, so you can disable autosave on only the sites that have slow rendering because of additions like Sefaria or Mathjax.
You can still save drafts; it just won't be automatic. Use the "save draft" button in the editor toolbar to trigger a save:
3 comments
Nice that there's a button! Thank you (pl.)! I wonder whether it should be a per-browser setting, inasmuch as different browsers may perform differently when rendering and saving.
@msh210 I don't know what would be involved in making it per-session as opposed to per-user; all our preferences so far apply to that user in any browser (on that community, unless global). I wonder if a userscript could help in this case, since by definition you run a script in a particular browser on a particular device. On the other hand, not all browsers support userscripts. It might be worth asking a new meta question about this to see what others can contribute (discussion, workarounds).
Thanks. I haven't time at the moment, and hope to remember to do so later. Anyone interested reading this should feel free to beat me to it.
3 comments
GitHub issue tracking this, in which I propose several approaches to what sounds like a general problem and not just the Sefaria linker. — Monica Cellio 3 months ago
Can't reproduce this one, even with stupidly long posts. Don't know what's going on there. — ArtOfCode 3 months ago
@ArtOfCode Editing works mostly fine on Firefox, but Safari consistently gives me issues. — DonielF 3 months ago