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

IDE fails to save sketch when backend is offline #2049

Closed
3 tasks done
CreativeRobotics opened this issue May 5, 2023 · 6 comments
Closed
3 tasks done

IDE fails to save sketch when backend is offline #2049

CreativeRobotics opened this issue May 5, 2023 · 6 comments
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@CreativeRobotics
Copy link

CreativeRobotics commented May 5, 2023

Describe the problem

Sometimes the IDE will stop saving sketches.

I just spent two hours editing code in the IDE, I was saving code regularly through the session. When I tried to compile the code the IDE wouldn't compile, the compile button got 'stuck' and the 'Compiling' pop up appeared but nothing happened. A message appeared across the bottom that said 'Offline'.

I tried to close the app but it wouldn't respond.

All through this the editor continued to work and the save option in the menu could be selected.

When I forced quit the application and restarted it, ALL the code I had written in the last two hours was gone - it had failed to save anything.

To reproduce

No idea how to reproduce apart from having a sketch open and sending the computer to sleep several times in a row.

Perhaps this is an issue related to windows in sleep mode.

I have NOT verified this in the nightly build because I can't easily reproduce it. If you insist on excluding bug reports for hard to reproduce items then you will miss some important bugs.

Expected behavior

The IDE shouldn't allow code to be edited, and respond to the save menu being selected, but not actually save anything.

Arduino IDE version

Version: 2.1.0 Date: 2023-04-19T15:31:10.185Z CLI Version: 0.32.2

Operating system

Windows

Operating system version

10

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@CreativeRobotics CreativeRobotics added the type: imperfection Perceived defect in any part of project label May 5, 2023
@P3Fab

This comment was marked as off-topic.

@per1234

This comment was marked as off-topic.

@per1234 per1234 changed the title IDE fails to save sketch IDE fails to save sketch when backend is offline Jun 17, 2023
@per1234 per1234 added the topic: code Related to content of the project itself label Jun 17, 2023
@per1234 per1234 self-assigned this Jun 17, 2023
@per1234
Copy link
Contributor

per1234 commented Jun 17, 2023

Thanks so much for reporting this @CreativeRobotics!

I see there was a later report of the bug here: #2081

The mitigation measure made in #2082 is to clearly communicate to the user that the IDE was unable to save and provide instructions for how they can avoid the loss of their sketch data:

image

I will close this issue as resolved by #2082 as was done for #2081

That change does not address the cause of the IDE going into that state. I am still very interested in that. Unfortunately it would be difficult to investigate or prepare a fix for the problem if we don't have a clear understanding of the conditions it occurs under.

You mention putting the PC through a sleep cycle. The same was also mentioned as a possible factor in other reports:

But I frequently (far more than the average user since I am regularly switching between three multiple machines as I do testing on each platform) put my computers through sleep cycles while Arduino IDE is running, yet I don't experience this problem of the IDE going into an "offline" state (where it loses communication with the backend). So it definitely doesn't occur universally on a sleep cycle.

If anyone can identify the specific conditions that produce the fault and provide use with detailed instructions we can follow to reproduce the fault, please do submit a dedicated issue report here. That would be very helpful.

@per1234 per1234 closed this as completed Jun 17, 2023
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jun 17, 2023
@CreativeRobotics
Copy link
Author

CreativeRobotics commented Nov 15, 2023

This issue is NOT resolved. The IDE can't save a sketch after a number of sleep cycles and when more than one instance is open. The issue should remain open until it is fixed so that everyone who is still dealing with this issue can be directed to an open issue thread to contribute information. The mitigation posted doesn't resolve the actual issue, its a crude workaround that is seriously impractical if you have sketches with multiple tabs.

@spilz87
Copy link

spilz87 commented Mar 16, 2024

This issue is NOT resolved. The IDE can't save a sketch after a number of sleep cycles and when more than one instance is open. The issue should remain open until it is fixed so that everyone who is still dealing with this issue can be directed to an open issue thread to contribute information. The mitigation posted doesn't resolve the actual issue, its a crude workaround that is seriously impractical if you have sketches with multiple tabs.

I confirm, I still have this issue :(

@loopyengineeringco
Copy link

Also have this issue. IDE 2.3.2, Arm Mac.
The backend going offline is annoying, but it should still allow saving. Why would it not, it makes no sense. If a program crashes and can't continue, it needs to be able to save your work.
Now I have to start multiple temporary text files to copy & paste my tabs into, to then force quit the program, to then paste the contents back in. Beyond ridiculous

@arduino arduino locked as resolved and limited conversation to collaborators May 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

5 participants