-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A way to restore a lost content (autosave to local storage?) #134
Comments
BTW... let's test whether it gets submitted this time :D |
OK, so it worked this time. Which means that it might have been... everything. That shifts the focus towards – there should be a way to restore your content if something crashed. We're experiencing issues too frequently to ignore this. There was the issue I had, then #135, the editor is crashing on emojis, etc. Being able to get your content back would help. |
I'm wondering if the issue that pushed you to open this issue is not related to LastPass, as described here: #135 (comment). Anyway, we can think about some solution for content loss prevention. One idea could be constantly updating the localstorage copy of the contents on changes. Currently we do it when leaving/refreshing the page only. @Reinmar, there is one important information though... did the form post happened and the content wasn't saved? I mean, the issue was just closed without your new comment? |
@Reinmar, would you mind having an issue for this one? |
Part 1 - Current ImplementationLet me give a bit of details on the current implementation:
The above works relatively well and we didn't have had many issues. But still something has been reported, although we have no idea why it got broken. One possibility is that CKEditor itself broke and the program got stuck. The funny fact is that maybe the user was still able to type after the error occurred so they not even noticed that (I have seen this in the past)... until maybe posting the form and losing everything. It would be great if CKEditor would "reliably break", making it easier to debug issues. |
Part 2 - Live HTML Data ProcessorThe idea is simplifying things a lot -> update the GH textarea on every change. In this way, we don't care about "on submit sync" or having to handle the various submit buttons. I would love to go with this. Buuuut, the reason why things have been done differently is because I figured that calling To tackle the performance problem, I had a "great" idea... let's introduce Now, after a day working on that, I "almost" made it work... and I figured that this is impossible to be done 😭 That's because features have been developed under the assumption that the "data downcasting" will have to handle just "inserts" but not "removals" and "attribute changes". This can be clearly seen in the list plugin code, for example. Summing up, the "Live HTML Data Processor" idea (and almost implementation) died 😢 |
Up next - I need suggestionsRight now, I have two possible ways:
As for 1, I don't like it, but this seems to be anyway the way people are doing "auto-save" out there. As for 2, it is not totally safe still because we would keep the current system in place anyway ("on submit sync" and "submit buttons handling"). But it would decrease the potential loss of data. Suggestions? |
The issue can happen also in other situations, see #152 (comment) |
I've just concluded the first phase of development for this. I'm introducing the LiveModelData plugin that adds I'll be using it to update LocalStorage on every change. To be sure about performance, I wanted a simple comparison with the plain The above are the times of I got with Firefox when slowly typing in the middle of a larger content, 3x what we see here. The code is a bit risky, but the above shows that it's worth moving ahead with it. So now I know which direction to take. A solution should be coming soon. |
This issue is still happening I accidentally clicked on my own profile page while previewing an issue I was in the process of creating, and just lost 30 minutes of work :/ Text has completely disappeared, back button did not restore. Have used Github since 2014. This is disappointing. |
I've just lost 20 minutes of work because I mistakenly clicked "Close issue" and GHRTE didn't save the comment (which GH normally does). Since it overrides how the form works, the "go back" browser option didn't help either.
Besides fixing the "Close issue" button, I'd love to see some way of restoring lost content. Some sort of autosave to the local storage and ways to get the content back from it would be an amazing improvement, also over what GH offers by default. The problem here is that normally you can install browser addons which save you from losing your content but with GHRTE it's gone. Therefore, GHRTE should offer something for that.
The text was updated successfully, but these errors were encountered: