I'm not sure this counts as a question, as I don't think there's a solution to it. Might count as a rant, but definitely should be considered a warning. Maybe the moral is "keep your software updated."
This issue took place in the IDE version 1.6.12. The Arduino in question probably doesn't matter, as I think this is a software / OS issue, but for the record, this is the Vilros kit (an UNO coupled to a small breadboard). Because I'm currently on a slow Internet connection, the past couple times I've opened the IDE I've disregarded the "there is a new version available" message. I'm simply not in a position to upgrade until the bandwidth-throttling is relaxed in a few days.
The project I'm working on is intended to suss out issues I've had using an AD5220 digital potentiometer to "turn up" / "turn down" the frequency of a digital clock used to generate CLK signals for various digital projects. The details probably aren't important, but the gist of it is that I used two momentary pushbutton controls (like large tact switches, included with the Vilros kit) to bring two I / O pins, normally pulled up, LOW. On each iteration of the main loop, the Arduino checks each pin, and if either is has been grounded by its button, the controller generates a pulse to send to the CLK pin of the dpot; also, depending on which pin is LOW, it sends the appropriate SEL signal to tell the dpot which way to "turn." I have a simple LED / series resistor combo tied to the "wiper" pin of the dpot to serve as an indicator of whether the dpot is working correctly. The LED starts of at "mid" brightness, and depending on which button I press, should gradually brighten or dim accordingly.
The "turn up" functionality worked as expected, but as soon as the "up" button was released, the LED began to dim, as if the "down" button were being held down. To confirm that the Arduino was constantly detecting a "down" press, I opened a serial window and had the main loop print out the current button state. And there's where the trouble began.
The board was connected to COM5. The first time I ran with the serial window open, I got the expected result, but the window quickly filled with text, making the program's progress essentially unreadable. I disconnected the board briefly to update the code with a numeric indicator that could be more easily visually tracked in the debug window. I reconnected the board and attempted to upload the code, and the IDE couldn't find the board. There was nothing on COM5, as far as the IDE was concerned (although Windows Device Manager definitely still saw it).
After several attempts to upload the code, I saved it and closed the IDE, falling back on the time-honored "reset" approach. When I reopened the IDE, the sketch was gone.
Completely.
It wasn't on the Recently Used menu. I used the ordinary Open menu and couldn't find it either. (I don't save my sketches in the default location; I have a Microcontroller/Arduino subfolder in my Source Code folder, with additional subfolders for each board / kit and then for various projects. The corresponding folder for this project wasn't even there.)
The whole project disappeared.
I did a system-wide search for .ino files and found dozens, but none with a file creation date in this year.
The sketch was definitely previously on disk, as I opened it earlier today from the project I'd saved yesterday.
I don't suppose anybody has any idea why this would happen? It's like the IDE took the code down with it when I closed it earlier.