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

Saving sketch fails silently when files are read-only #1501

Closed
3 tasks done
wilamsworld opened this issue Sep 26, 2022 · 6 comments · Fixed by #2211
Closed
3 tasks done

Saving sketch fails silently when files are read-only #1501

wilamsworld opened this issue Sep 26, 2022 · 6 comments · Fixed by #2211
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

@wilamsworld
Copy link

wilamsworld commented Sep 26, 2022

Describe the problem

If you load a read only .ino then try to save the IDE does not notify that the file is Read Only and it appears to save to this file although it has not.

To reproduce

  1. Create a sketch.
  2. Use your operating system to set the read-only attribute of the sketch file.
  3. Make a change to the read-only sketch file in the Arduino IDE editor.
  4. Select File > Save from the Arduino IDE menus.

🐛 Arduino IDE does not communicate to the user that it could not save to the file. If you open the file in a text editor you will see the change was not saved.

Expected behavior

I would expect a popup or similar to notify the file was read-only

Arduino IDE version

Original report

7c86f1f

Last verified with

8f8b46f

Operating system

Windows

Operating system version

10

Additional context

The unsaved state is indicated by the icon on the sketch tab, but this is not sufficient communication.


Additional reports:

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
@wilamsworld wilamsworld added the type: imperfection Perceived defect in any part of project label Sep 26, 2022
@per1234
Copy link
Contributor

per1234 commented Sep 26, 2022

Thanks for your report @wilamsworld!

it appears to save to this file although it has not.

Since the meaning of this was not immediately apparent to me, I'll add my findings.

File > Save

Normal saving via File > Save does not give the appearance of saving. The "dirty" marker remains on the sketch tab.

File > Save As...

There is no indication of a problem with the "Save As" operation but the new sketch does not contain the unsaved changes from the original read only file.

Close window

The IDE presents the usual save confirmation dialog. If you select Save, the window closes without any indication of a problem but the unsaved changes in the file are not saved.

@per1234 per1234 added the topic: code Related to content of the project itself label Sep 26, 2022
@per1234 per1234 changed the title no acknowledgement of read only file when saving Saving sketch fails silently when files are read-only Dec 14, 2022
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Mar 27, 2023
@kittaakos
Copy link
Contributor

kittaakos commented Mar 27, 2023

Expected behavior

I would expect a popup or similar to notify the file was read-only

After proposing a fix in Theia (eclipse-theia/theia#12354), this is what IDE2 can provide "natively" as part of the next Theia version updates (#1976):

readonly_1501.mp4

Update:

as part of the next Theia version updates (#1976):

IDE2 already has the patch in #1976—no need to wait for another Theia release cycle.

kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Apr 11, 2023
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue Apr 20, 2023
@jl-esp
Copy link

jl-esp commented Jul 18, 2023

Issues still exists in :
Version: 2.1.1
Date: 2023-06-30T16:04:40.277Z
CLI Version: 0.32.3

I get no notification that the file is read-only and unable to be saved.

@jl-esp
Copy link

jl-esp commented Jul 18, 2023

I looked at the changelog for the nightly build and it listed:” - fix: warn user when IDE cannot save the sketch [8f8b46f]”
I downloaded it and see the following:
image
There is a white dot that indicated unsaved changes. This is a huge improvement.
Any idea when this will migrate to the release version?
Thanks much!!

@kittaakos
Copy link
Contributor

kittaakos commented Jul 18, 2023

I looked at the changelog for the nightly build and it listed:” - fix: warn user when IDE cannot save the sketch [8f8b46f]”
I downloaded it and see the following:

👆 that was a fix for a different problem.

Issues still exists in :
Version: 2.1.1

It's expected. This issue is open as it is not implemented yet. The fix is available neither from the nightly nor the release build, as it (kind of) depends on eclipse-theia/theia#12354. Thanks for your patience.

@jl-esp
Copy link

jl-esp commented Jul 18, 2023

Thank you - at least this is an improvement from zero notification that I had before.

Anticipating the real fix. I read the bug you posted and it looks promising. A pop-up would be ideal.

Thanks!!

kittaakos pushed a commit that referenced this issue Sep 29, 2023
@per1234 per1234 linked a pull request Sep 29, 2023 that will close this issue
4 tasks
@kittaakos kittaakos added the conclusion: resolved Issue was resolved label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
4 participants