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

R 4.2: Document unexpectedly opens as empty in some cases #11206

Closed
4 tasks done
kevinushey opened this issue May 13, 2022 · 6 comments
Closed
4 tasks done

R 4.2: Document unexpectedly opens as empty in some cases #11206

kevinushey opened this issue May 13, 2022 · 6 comments

Comments

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented May 13, 2022

System details

RStudio Edition : Desktop
RStudio Version : 2022.02.2+485
OS Version      : Windows 11 64-bit
R Version       : 4.2.0

Steps to reproduce the problem

Create a text document with the contents:

abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz

Save it, then try File -> Reopen with Encoding -> ISO-8859-1.

Describe the problem in detail

The file is opened as a blank file.

Describe the behavior you expected

The file should be opened without issue.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
@kevinushey
Copy link
Contributor Author

@kevinushey kevinushey commented May 13, 2022

Note: this also affects File -> Save with Encoding, in which the file is silently written as empty. Given the potential for data loss here I think we need to backport a fix ASAP!

@ronblum ronblum added the triage label May 13, 2022
@kevinushey kevinushey changed the title R 4.2: File -> Open with Encoding fails for non-UTF-8 encodings R 4.2: Document unexpectedly opens as empty in some cases May 13, 2022
@3fa
Copy link

@3fa 3fa commented May 23, 2022

Hello, checking in if there's any way to recover file contents that have been erased like this. I lost the full contents of a huge .R file for work (now 0 KB), and it's happening to other files as well. Oddly, though I found it "erased" 3 days ago, for a brief moment today I opened it and saw the code (!), and saved it as a new .R file. But, now both files are empty again (in all programs I've opened them with, and trying multiple encodings in RStudio). I should've saved it as a .txt while I had the chance.

I'm using Windows 10, RStudio 2022.02.2 build 485, and R 4.2.0. The file was saved on OneDrive, where I've been able to recover a week-old version. But I lost a week's worth of work.

I'm thinking I'll revert back to R 4.1.2 to prevent any more losses. Any solutions yet? And any possibility of recovery?

@jmcphers
Copy link
Member

@jmcphers jmcphers commented May 23, 2022

If you have saved it at 0kb, it is unlikely you can recover it. :-( You can try RsRecovr:

https://github.com/jmcphers/rsrecovr

We do have a newer build of 2022.02 that has a fix for this issue, if you'd like to try it (build 492):

https://dailies.rstudio.com/rstudio/prairie-trillium/desktop/windows/

@3fa
Copy link

@3fa 3fa commented May 23, 2022

If you have saved it at 0kb, it is unlikely you can recover it. :-( You can try RsRecovr:

https://github.com/jmcphers/rsrecovr

Thank you, I didn't know about this. I tried it and unfortunately it didn't work this time, but now I know about it for the future.

We do have a newer build of 2022.02 that has a fix for this issue, if you'd like to try it (build 492):

https://dailies.rstudio.com/rstudio/prairie-trillium/desktop/windows/

I've downloaded build 492 now, thank you! No problems so far.

@ronblum
Copy link
Contributor

@ronblum ronblum commented May 24, 2022

Verified on Windows 11 using

  • RStudio Desktop 2022.02.3+492
  • RStudio Desktop 2022.06.0-daily+438

Also double-checked that it's not an issue on RStudio Desktop on MacOS 12.4 or RStudio Server on Ubuntu 20.04.

@ronblum ronblum closed this as completed May 24, 2022
@ronblum ronblum removed the test label May 24, 2022
@ronblum ronblum self-assigned this May 24, 2022
@mlane3
Copy link

@mlane3 mlane3 commented Jun 3, 2022

@ronblum this might be "fixed" up to a point that you can control for windows.

Part of this is outside the control of R and Rstudio as synced share folders (one drive and sharepoint), still have an issue with autosave. If co-worker who has a shared business one-drive and they were still having problems this week. I will ask them to retry and see if they get the same error.

Not sure if you can flag something for better documentation or ongoing issues, but that might be the next stage of the autosave issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants