Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

atom showing old versions of files #8888

Closed
ChrisJefferson opened this issue Sep 22, 2015 · 47 comments
Closed

atom showing old versions of files #8888

ChrisJefferson opened this issue Sep 22, 2015 · 47 comments

Comments

@ChrisJefferson
Copy link

I have atom set up as my editor for git using atom --wait --safe (I added the safe today, this bug still appears).

When I make a commit, atom opens an old version of COMMIT_EDITMSG, from a week ago. If I go into the .git directory and do cat COMMIT_EDITMSG, I see the new copy. I can't figure out where atom is even getting these old file contents from.

@mnquintana
Copy link
Contributor

Can you try removing Atom's storage directory and seeing if you can still reproduce this? (rm -rf ~/.atom/storage)

@ChrisJefferson
Copy link
Author

I can't reproduce it any more now.

This was / is still a really terrible bug -- I badly messed up a git rebase -i, as an old rebase file was loaded and I lost some commits (well, I get them back with pain).

@maxbrunsfeld maxbrunsfeld self-assigned this Sep 22, 2015
@rasselbock
Copy link

I'm using 1.0.15. I just pulled and opened a html file to edit. Atom was showing an older version of the file. It had diff marks like it might be diffing against the new file version. Clearing the storage (rm -rf ~/.atom/storage) then restarting Atom set everything back right.

@FlorianFranzen
Copy link

Just had the same problem and lost 3 hours of work by saving before noticing something was off.

Other tabs that I did not "save" would properly display the files content once I closed and reopened them.

I am on the newest version (1.0.15) and on Windows 7.

@50Wliu 50Wliu added the bug label Sep 23, 2015
@50Wliu
Copy link
Contributor

50Wliu commented Sep 23, 2015

@rasselbock, @ChrisJefferson: What OSes are you on?

@rasselbock
Copy link

@50Wliu Oops, should have said. OSX 10.10.5 Yosemite; Git 2.2.0

@ChrisJefferson
Copy link
Author

OS X 10.11.0 GM; git 2.5.3

@ChrisJefferson
Copy link
Author

This could be related to a (for me) repeatable data-loss bug I am having, #8581

@maxbrunsfeld
Copy link
Contributor

Hey all, just want to let you know that I think this is really serious, and I'm really sorry this is happening to you, and I'm looking into it. I haven't been able to reproduce this bug yet. It's also possible that it's already been fixed by some dependency upgrades on master, and will be fixed in the next release. Anyway, I'll keep you posted.

@maxbrunsfeld
Copy link
Contributor

Can everyone check if this still happens after doing this?

  1. Close Atom
  2. rm -rf ~/.atom/storage
  3. Open Atom

@ChrisJefferson
Copy link
Author

I have tried hard to cause this bug to re-occur after clearing storage, and it isn't coming back.

I should have made a copy of the directory before I deleted it! It did have a large number (> 100) files in it.

@maxbrunsfeld
Copy link
Contributor

Ok, let me know if you see any more problems, or find out any new information @ChrisJefferson. I was finally able to reproduce a related problem (#8849) by going back to an earlier version of Atom and then upgrading. Clearing the storage directory seems to have fixed the problem. I'm trying to think now what caused the invalid state to be stored, and if this can be prevented without requiring people to nuke that storage directory.

@rasselbock
Copy link

@maxbrunsfeld Thanks for the updates!
@ChrisJefferson Did Time Machine do a backup for you?

@maxbrunsfeld
Copy link
Contributor

Ok, I just released Atom 1.0.18. I believe it should fix this issue, if removing the ~/.atom/storage directory did not already fix it. Everyone, please let me know if you're still experiencing this on 1.0.18.

@ShaunYudin
Copy link

Worst bug of all time! Just lost hours of work :''(

@lowstz
Copy link

lowstz commented Jul 16, 2016

I have same problem on the version 1.8.0

@glebcha
Copy link

glebcha commented Jul 19, 2016

Same shit again.

@mvdobrinin
Copy link

Running into same issue on version 1.9.2.

@iampbernardo
Copy link

Same here in 1.10.2

@maxbrunsfeld
Copy link
Contributor

Anyone who is experiencing this on Atom 1.10. Could you open a new issue and provide as detailed of reproduction steps as possible?

@jacekkowalczyk82
Copy link

All, I experienced it on atom 1.13.1 at windows (I had this also on Ubuntu some time ago).
Atom editor was showing old content of some file, and I was surprised as I was remember I was editing it with some other editor. It does not happen every time.

@Justin-Mitchell
Copy link

Justin-Mitchell commented Aug 29, 2017

Experiencing same issue... When launching Atom from my work directory it opens with 10 Tabs of files. All files being past versions of themselves from what is currently in the repository. Not even recent versions, 3 month old versions. Accidentally deployed these old files costing me hours of debugging and work. Unfortunately I don't think I can continue to use this Editor unless a solution is provided.

Fully deleted app and rm -rf ~/.atom, did reinstall and problem still exists.

OSX v 10.12.6
ATOM v 1.19.4x64

@droiddk
Copy link

droiddk commented Sep 9, 2017

Experiencing same issue.
The is the absolute WORST thing an editor can do.
I don't feel safe using this editor any more.

@abepetrillo
Copy link

abepetrillo commented Sep 10, 2017

@maxbrunsfeld The work around of rm -rf ~/.atom/storage seems to fix the problem temporarily as long as you close atom first.

@maxbrunsfeld
Copy link
Contributor

/cc @ungb I've never seen this and I'm not sure how it can happen, but it'd be great to figure out a way to repro.

@sosey
Copy link

sosey commented Sep 12, 2017

I have the same issue on osx sierra, with:
Atom : 1.19.7
Electron: 1.6.9
Chrome : 56.0.2924.87
Node : 7.4.0

It appeared after I deleted a local repository and then cloned it back to the same directory.
Following the fixes above doesn't help

@BenjaminDalziel
Copy link

The work around of closing atom, then rm -rf ~/.atom/storage seemed to fix the problem for me as well.

@ghost
Copy link

ghost commented Sep 12, 2017

Atom probably needs to check more on old files/directories there.

@ungb
Copy link
Contributor

ungb commented Sep 12, 2017

I'm currently trying to get a repro for this. Very sorry for those that ran into this issue. Is everyone here using Windows? Would be useful to provide which OS you're using as well. I tried to repro on Mac and couldn't -- I'll try on windows.

Also, when Atom opens the old file, is it dirty(unsaved changes)? If you close the tab and reopen it does it open a older version still?

@BenjaminDalziel
Copy link

At least a few of us are on Mac. When the issue occurred for me, I was getting the same old version of the file each time I started Atom. I would use File->Open and select the same-named file to get the correct version. I would work on it, save changes, and close. Next time, same old version as before.

@ungb
Copy link
Contributor

ungb commented Sep 13, 2017

thanks @BenjaminDalziel interesting... When the old file opens up is it in dirty(unsaved state)?

I'm reopening this issue to investigate and hopefully we can get to the bottom of it.

image

@ungb ungb reopened this Sep 13, 2017
@sosey
Copy link

sosey commented Sep 13, 2017

I get dirty files on open. Even after completely uninstalling atom and reinstalling, when I ask to open a specific file in a repo that is clean (using cmdline), with no changes, it opens multiple tabs with a mix of clean and dirty files. I have the same issue when rebasing, when a file I was working on, and saved, is being rebased and I open in atom to resolve conflicts, the old version shows up.

@BenjaminDalziel
Copy link

BenjaminDalziel commented Sep 13, 2017

Sorry @ungb, I can't remember if the files were dirty when they appeared in my case. Thanks for looking into this!

@ungb
Copy link
Contributor

ungb commented Sep 14, 2017

@sosey a few comments above people mentioned that rm -rf ~/.atom/storage and restarting atom might fix the issue.

If you are still seeing the issue. can you try to do the following:(moving instead of deleting)

mv ~/.atom/storage ~/.atom/temp_storage

Restart atom and see if it fixes the issue for you?

If this fixes the issue, is it possible for you to share what's inside of .atom/temp_storage? In mine I just see a file application.json that has initialPaths.

This can help us narrow down the issue.

@sosey
Copy link

sosey commented Sep 14, 2017

I did try removing storage before removing atom entirely, after closing atom, and before, and it had no effect. Even with the issue, there was nothing in ~/.atom/storage, besides application.json, whenever I looked.

@sosey
Copy link

sosey commented Sep 14, 2017

To remove the atom application from everywhere, I deleted it from /Applications, the whole .atom/ directory, /usr/local/bin/atom, /usr/local/bin/apm and ~/Library/Preferences/com.github.atom.plist

Is there anywhere else that a buffer might be stored in a local working directory that I missed? After re-installing the app and opening a repo file, I still had the same issues. The new install was started with --safe and I had no extra packages installed. I feel like this might have something to do with the repo tracking, or however atom is using information in .git/. I'm not currently getting this issue when I use my fresh atom and look at other repositories elsewhere on disk. I consistently get it in the repo that I first deleted and then cloned again in the same disk location. The fresh clone had quite a few commits squashed, and the files atom displayed were from a really old commit that had been squashed before I re-cloned the repo.

@p-ugulino
Copy link

It just happened to me. Lost 3 files. :(

@maxbrunsfeld
Copy link
Contributor

It seems like a lot of people are reporting a lot of subtly different problems on this issue. When reporting that this happened to you, please report in detail, step by step, exactly what you saw. One very relevant piece of information is whether the file showed up as 'modified' (blue dot on the tab) when you reopened Atom.

@p-ugulino
Copy link

Hey @maxbrunsfeld sorry. So, I closed atom yesterday and today when I opened, I noticed the blue dots on the tabs and started saving all the files (I thought I forgot to save yesterday). Then, I put my react native project to run and a lot of my functions were not working. After checking the files, I realized they were all old files. Tried to delete the atom "store" folder but still, the old files persist.
Now I just accepted the fact that I'll have to waste some time recoding stuff

@ungb
Copy link
Contributor

ungb commented Sep 26, 2017

Another thing to try is atom --clear-window-state. This will clear all the saved project states, but unsure how someone gets into this state.

NOTE when clearing window state, any unsaved buffer on any project that was open with Atom will be lost.

@joeguinness
Copy link

joeguinness commented Oct 5, 2017

I just had this happen a couple of days ago, using Atom 1.21.0. I opened a file I had been working on a few weeks ago. When I opened it, the pale blue dot appeared at the top (even though I always save), I reflexively hit save, then I noticed yesterday that the file was an older version. I don't see any way to get back the work that was lost. I checked the ~/.atom/storage directory last night, and the only file in there was application.json.

I was really confused for a couple of days how the work had been lost. I guess I'm glad now that I think I understand what happened, but this is a really concerning issue.

@Ben3eeE
Copy link
Contributor

Ben3eeE commented Oct 5, 2017

@ungb Let's chat about this today I have some ideas

@ungb
Copy link
Contributor

ungb commented Oct 5, 2017

@joeguinness Do you know if there's been a few Atom upgrades? Wondering if something happened between Atom upgrades and not opening the file for a while between upgrades.

I'm currently trying to find a repro for this issue, but haven't been able to track down the root cause.

@joeguinness
Copy link

There may have been, but I don't know for sure. I hadn't worked on the file in a few weeks.
By the way, Atom is otherwise great. I plan to keep using it (and commit more often, which I should be doing anyway!).

@Ben3eeE
Copy link
Contributor

Ben3eeE commented Jan 5, 2018

We have investigated this and found one case where it can happen in #16081. I am going to close this issue out as fixed by atom/text-buffer#283.

The fix for this is currently scheduled to be released in Atom 1.25. If you run into this issue in Atom 1.25 or later then please open a new issue and provide as much details as possible.

@lock
Copy link

lock bot commented Jul 4, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jul 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests