Recover Unsaved Issue

I was creating a new issue with detailed notes about the problem and solution. I navigated away from the page before clicking ‘Create Issue’. When I came back, I wasn’t able to edit the notes. Refreshing the page returned ‘Invalid CSRF’ and there didn’t appear to be a way to navigate back to my lengthy note. Clearly a bonehead move on my part. Is there any chance there is a file lurking around on my laptop or the server I can use to recover from this? The server is in my home lab and I have full access.

  1. No, unlike GitHub, Gitea does not send every keystroke to the server. It only sends something when you instruct it to, i.e. by sending the message.
  2. When I came back

What exactly do you mean here? Did you navigate back by navigating one page ahead/behind (the / buttons of the browser)?
If yes, then it should have been autofilled again. It is persisted inside the browser-native storage as long as the tab is loaded.
If no, then your text will be forever lost unless you can still access the original tab in your browser history.

@delvh, thank you for your response. When I came back, it was the next day. Distraction overtook me, and I had navigated away to other tabs.

Upon my return, I looked at the “Preview” tab and tried to make some format changes. The changes would render in the “Write” tab, but not update in the “Preview” tab. That’s when I tried to refresh the page and got the “Invalid CSRF” error.

When I tried the tab in browser history, it took me to the login page. Since the “issue” wasn’t ever saved, the server didn’t have the “issue” listed.

At this point, I’ve created a new “issue” and started over. Honestly, I’ve spent more time trying to find the lost note data than it will take to start over. It was my mistake and a lesson learned.

Should “autosave” be a feature? I would think implementing such a feature would be non-trivial. My mom would say, “The juice ain’t worth the squeeze.”

My new workflow for new issues:

  1. Click “New Issue”
  2. Add Title
  3. Add short description
  4. Click “Create Issue”
  5. Click “Pencil” icon to edit or expand description if needed

The silver lining to this experience is finding this forum. I suspect other questions I have about managing my Gitea instance have already been answered here.

Thanks,

AustinPowered

That’s actually a difficult question to answer.
The short version: There are two groups within Gitea, one supports sending everything to the server as it prevents exactly such cases. The other has privacy (and usability) concerns if we send everything to the server and wants everything to stay local as much as possible.
I’m rather a member of the second group. But other maintainers may see that differently.

1 Like

And especially 1.21 : [Summary] Improve issue/PR comment editing experience · Issue #23290 · go-gitea/gitea · GitHub

After #25258 gets merged, I think the situation is much better than before.

With “form-fetch-action (AJAX)” support, the only case I can imagine about “losing content” is: browser (OS) crash or computer power-off.