Skip to content
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

Recovering unsaved "drafts" #722

Open
CharliePoole opened this issue Apr 11, 2024 · 6 comments
Open

Recovering unsaved "drafts" #722

CharliePoole opened this issue Apr 11, 2024 · 6 comments

Comments

@CharliePoole
Copy link

I put "drafts" in quotes because it's really not a draft until you save it. :-) Here's what happened in my case.

  1. I was creating a new post and typed in a lot of text without saving anything (my bad).
  2. I tried to View the post, but my login had timed out.
  3. I logged back in to HTMLy and had nothing.
  4. I went to the server and found the cached html for my work in file #add#content~type=image.cache. I presume it was saved there when I clicked on View.
  5. I verified that there was no draft saved - since I had not saved it.

My immediate problem was solved by cutting and pasting the text from the cached html. I'll try to avoid this in the future and I know what to do if it happens again. However, it seems it could be made easier.

In my case, the problem arose because my login timed out. It would be great if that didn't happen but, of course, sometimes a user simply abandons a post without ever submitting anything and that has to be allowed for. In addition, the problem may arise for other reasons, such as a network outage.

So I think the better way is to make it easier to recover from a lost post.

Catch-22 is that the cache is not used for display when someone is creating content, because they are logged on. I suggest that an exception be made IFF there is no saved draft AND a cache entry exists for the particular content type being added.

In that situation, the user could be told something like "No draft exists but a partial copy has been saved in the cache. Do you want to use it?" A positive response would cause all the fields to be populated from the cache, essentially automating what I have had to do with my lost post.

As either an alternative or an addition, we could consider some kind of automatic saving of the draft.

@AutomationMan808
Copy link

How did you recover it from the cache?

@CharliePoole
Copy link
Author

I used CPanel's file explorer to examine the files in the cache and did a copy and paste.

@CharliePoole
Copy link
Author

Just happened again, this time when I clicked Save as Draft and it discovered my session had expired. Can I control that timeout, or is it hard-coded?

BTW, I had not run into this before because I've been writing offline till now. Today I started to write a new post directly in HTMLy, but it doesn't seem workable unless I can keep my session alive.

@danpros
Copy link
Owner

danpros commented Apr 11, 2024

For now try increasing the value of session.gc_maxlifetime in your php.ini. The default value is 1440 seconds (24 minutes).

@CharliePoole
Copy link
Author

I tried that and it didn't seem to work but maybe I didn't start a new session. Trying again.

@KuJoe
Copy link
Sponsor Contributor

KuJoe commented May 17, 2024

I was looking into a solution for this for shared hosting where users don't have a lot of control over the PHP settings and I ended up adding a feature that automatically saves the post as a draft every 60 seconds. I am still working out the specifics and making it look pretty, but so far testing has been pretty successful. Would something like this be a solution to this issue?

image

This was referenced May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants