I foolishly tried to create a new draft from the clipboard without realising that the text on the clipboard was about 1,900,000 characters long. This caused Drafts to hang, and it still hung when killed and restarted.
Perhaps it would have recovered eventually, but instead I deleted the draft on another device where Drafts was still responsive, emptied the trash, and deleted then reinstalled Drafts on the first device (iPad).
Maybe a sanity check on clipboard length could be introduced to avoid this.
What was the source of what was in your clipboard? I regularly test with large texts like this and it’s pretty much instant to paste here…my only though is that the source might have been HTML content, and you have “Paste HTML as Markdown” active, which could trigger a somewhat more involved conversion step before pasting.
The clipboard contained JavaScript code with a very long embedded string constant, and was generated by app.setClipboard. So no, it wasn’t HTML. I am reluctant to experiment further, given how painful the cure was.
My suggestion is that if the clipboard is longer than the permitted maximum length of a draft (900kb?), instead of attempting to create and then truncate, which probably wouldn’t give a useful result anyway, the operation could be blocked.
1 Like